Re: [Tutor] search path
On Sun, Jul 6, 2008 at 3:47 PM, Robert Johansson [EMAIL PROTECTED] wrote: Running the script file she gets error messages claiming that the textfiles cannot be found when they are to be opened with fileid=file('textfilename.txt','r') even though the same thing works fine on my system. Anyone how knows what the cause of this is? Are you sure the filename is correct? As I understand it, Window's filesystems are case insensitive, so 'textfilename.txt' would also work for files named 'TextFileName.txt', or 'textfilename.TXT', etc. I believe the Mac's filesystem is case sensitive, so all of those names would be different files, and could in fact all reside in the same directory together. -- Jerry ___ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor
Re: [Tutor] search path
On Sat, Jul 22, 2006 at 09:57:01AM -0400, johnsonv3 wrote: Hi, If one does this... import sys sys.path.append(C:\\panda\direct) Is the change to python search path only temporary? Thanks. As we quibblers like to say, That depends on the meaning of the word temporary. Modifications to sys.path (insert or append) last until the end of the execution of your program. Although there are times when modifying sys.path at run-time is necessary, there is usually a better way. Usually you will want to add a path to the environment variable PYTHONPATH. How you do that depends on your platform (Linux, MS Windows, ...). Dave -- Dave Kuhlman http://www.rexx.com/~dkuhlman ___ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor
Re: [Tutor] search path
johnsonv3 schrieb: If one does this... import sys sys.path.append(C:\\panda\direct) Is the change to python search path only temporary? Yes, it only changes the search path within that program. The system-wide default search path is not changed. Chris ___ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor
Re: [Tutor] search path
johnsonv3 schrieb: When one installs a program (such as Panda or Livewires) into python sitepackage folder is the python search path automnatically updated to search the newly installed folders and files? Generally speaking, yes. The Python package (to use the proper name) either needs to have a files '__init__.py' in its package directory (see http://pytut.infogami.com/node8.html, section Packages) or the name of its package directory needs to be added to a .pth file (see http://docs.python.org/lib/module-site.html) Chris ___ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor