[Tutor] Re: Sample9.py and Sample9.pyc & seting path to Python open files ...

David tayi177 at hotmail.com
Wed Nov 26 00:00:03 EST 2003


Danny, you are right !!


I have unfortunatelly mixed-up some terms/operations, IMPORTING file (or module) with .py extension, reading lines which are in that (somename.py) file, with sys.path.append("D:\\PROGRAM~1\Lib\idlelib\Saves\somefile.py) method, and READING file (I suppose ? with any extension ? - or .txt files for certain), with inp = open("somename.txt","r") method ...


But anyway the problem, that I could not OPEN that file (not import module), with inp = open ... method still exist ...

It says, as mentioned in previous mail: No such file or directory: 'somename.txt'



The thing is, that I could open files, write/read in/from them yesterday, da before yestarday, etc., but today, I just couldn't do it anymore (used the same inp = open ... method).

I also tryed to copy different copys of this file to all "essential" Python directoryes, D:\Program Files\Python\Lib\idlelib\Saves\, D:\Program Files\Python\, even in D:\Windows directory (and just in case in C:\Windows too), but always got that error message ...



About Danny written: "Show us the code, and we can take a look" - honestly, it doesn't deserve to be called "code". There are just some basic "learning lines", just to become familiar with read/write functions, options, etc., so I think, it wouldn't mean any help to you. I was just attending to write something more "complex". 

And also I haven't got poblems processing this code, but already opening file, so I assume the problem is not in the code ...



Thanks again
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.python.org/pipermail/tutor/attachments/20031126/5dac5a88/attachment.html


More information about the Tutor mailing list