On 12/26/2011 07:23 AM, Stayvoid wrote:
Simply that python is saying it cannot find the file.
So it is probably in a different folder to the one in which the program is 
running. You need to provide a valid path to the file,
Those files are in the same folder:
/Users/Username/Python_modules/

I don't want to write a full path here:
if __name__ == '__main__':
    print test('lengthcounter_lutz.py')

How to add this directory to the search path?
Once again, there is no search path for the open() function. You can either supply an absolute name (eg. starting with leading slash), or you can supply a path relative to the current directory. If you're not sure what the current directory is, you can fetch it with something like:

import os

print os.path.abspath(os.curdir)

But if you're running the script from the terminal window, it should simply be the current directory for that window. If you're running it from some other shell, you'd have to consult that shell's docs.




--

DaveA

_______________________________________________
Tutor maillist  -  Tutor@python.org
To unsubscribe or change subscription options:
http://mail.python.org/mailman/listinfo/tutor

Reply via email to