E:\dev>cd VARESE~1 E:\dev\VARESE~1>python >>> import os >>> os.getcwd() 'E:\\dev\\VARESE~1' >>> exit() E:\dev\VARESE~1>cd .. E:\dev>cd VAResearchDemo E:\dev\VAResearchDemo>python >>> import os >>> os.getcwd() 'E:\\dev\\VAResearchDemo' >>> exit()
As you can see, if I run the python directory in VARESE~1 , os.getcwd() returns a short path. If I run python in the same directory but with a long path, it returns a long path.
So, you should try running python in C:\myfolderisafolder\test (check link properties or how to run it).
But if you need to convert the short path to the long path, you need to call the win32 function GetLongPathName
qehgt source share