When I run this code in python 2.7, I get this error:
Traceback (most recent call last):
File \"C:\\Python26\\Lib\\site-packages\\pyutilib.subprocess-3.5.4\\
If all you are looking for is to get your current working directory os.getcwd()
will give you the same thing as os.path.dirname(__file__)
as long as you have not changed the working directory elsewhere in your code. os.getcwd()
also works in interactive mode.
So
os.path.join(os.path.dirname(__file__))
becomes
os.path.join(os.getcwd())