PythonWin Open(file) path bug?

Gilles Lenfant glenfant at NOSPAM.bigfoot.com
Wed Apr 9 09:20:57 EDT 2003


Hi,

PythonWin files and misc resources are hosted at sourceforge now.

https://sourceforge.net/projects/pywin32/

You should use the appropriate tracker from there to write your bug
scenario.

Don't forget to say what build you use (menu Help > About PythonWin...)

--Gilles

"vector" <Vector180W at netscape.net> a écrit dans le message de news:
3E93B4E8.6020003 at netscape.net...
> 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