PythonWin Open(file) path bug?
vector
Vector180W at netscape.net
Wed Apr 9 01:51:36 EDT 2003
newbie,pythonwin,2.2.2
im simply trying to open a file
script snip...
cfg_file = open("lptctrl.cfg", "rb") #open config text file
end snip..
File "E:\Md_prj\md_422\Code\Python\LptCtrl_104.py", line 20, in __init__
cfg_file = open("lptctrl.cfg", "rb") #open config text file
IOError: [Errno 2] No such file or directory: 'lptctrl.cfg'
the file is in the same folder as the python script
i get the same error if opened from the interactive window
import sys
print sys.path
indeed shows the script dir is on the path so why cant it find the
config file?
If i call the script direct from explorer (no IDE) it works fine
if I open lptctrl.cfg within pythonWin and save As it then runs and
finds the file(it must be save as, even modifing and just save dosent
change the error)
any ideas
a bug or am i dong something wrong
I dont want absolute addressing, the file will always be in the "current
dir"
More information about the Python-list
mailing list