stupid question about os.listdir

John Hunter jdhunter at ace.bsd.uchicago.edu
Thu Jun 26 22:37:57 EDT 2003


>>>>> "Jason" == Jason Kratz <eat at joes.com> writes:

    Jason> oops.  almost forgot.  if I run interactively in the python
    Jason> interpreter it works as I expect.  its when doing 'python
    Jason> script.py' from the command line that it only uses the
    Jason> current directory.

Code, we need more code.  Please post an example, your platform, and
python version.

The following works for me on linux w/ python2.2 called as 
 > python scriptname.py

import os
print os.listdir('/home/jdhunter')
print os.listdir('/home/jdhunter/python')

and the same script (w/ different test paths) works on win32 w/ python
2.2.

JDH





More information about the Python-list mailing list