Well you're right about the paths... print(os.getcwd()) outputs when run from notepad++: c:\program files\Notepad++
when double clicked: actual directory path I'd like to use notepad++ to execute the scripts I edit, is there a way to solve this problem? On Sat, May 30, 2009 at 3:45 PM, Alan Gauld <alan.ga...@btinternet.com>wrote: > > "xbmuncher" <xboxmunc...@gmail.com> wrote > > Traceback (most recent call last): >> File "C:\path to file\script.py", line 1, in >> <module> >> h = open('file2.dat', 'rb') >> File "C:\Python30\lib\io.py", line 278, in __new__ >> return open(*(args, **kwargs) >> File "C:\Python30\lib\io.py", line 222, in open >> closefd) >> File "C:\Python30\lib\io.py", line 619, in __init__ >> >> > You don't have the full traceback here so we can't see > the actual error condition but I suspect its a problem with > paths. Python probably can't find the file because its > looking in the wrong place. Does it worik if you give the > fuill path to the file? > > > The WEIRD thing is, is that I can double click the same unchanged >> script.py >> file and it will run from the same program python.exe and it will display >> this output: >> \xb7\lots of these types of \xb codes >> Press ENTER to exit >> >> So my question is, why does it have different output run from the same >> python.exe program when the script remains the same. >> > > Probably Python is being called with the editors startup folder > so cannot find your file. > > Maybe I can turn off traceback info? >> > > You could but its not wise, the traceback means there is an error > so turning the messages off won't help your program to run, > you just won't get any clues as to why its not working! > > HTH, > > -- > Alan Gauld > Author of the Learn to Program web site > http://www.alan-g.me.uk/ > > _______________________________________________ > Tutor maillist - Tutor@python.org > http://mail.python.org/mailman/listinfo/tutor >
_______________________________________________ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor