NameError: global name 'win32netcon' is not defined

995 views Asked by At

Hey I'm trying to run scripts in Python 2.7 and I've downloaded the matching Python for Windows extension package. For some reason I'm still getting this error. Does anyone know where I can download win32netcon?

win32wnet.WNetAddConnection2(win32netcon.RESOURCETYPE_DISK,
NameError: global name 'win32netcon' is not defined
1

There are 1 answers

1
Safoyeth On

You need to import win32netcon first.

import win32wnet, win32netcon

win32wnet.WNetAddConnection2(win32netcon.RESOURCETYPE_DISK, password, username, flags)