I tried running the following python code in Eclipse on Windows but it is showing errors saying pwd
is not a valid import:
import os
import pwd
import socket
pinfo=pwd.getpwuid(os.getuid())
Can I use if not win32
to bypass this part so when it runs on Windows it just jumps at and doesn't create an error?
if not win32:
import os
import pwd
import socket
pinfo=pwd.getpwuid(os.getuid())
else:
return
If yes, what do I need to do to use this win32
since it's also showing an error saying undefined variable
?