Anybody can help on this?

Jeff Shannon jeff at ccvcorp.com
Thu Feb 21 17:16:02 EST 2002


husam wrote:

> Jeff, thanks alot for the enlightening remarks. I will try them. By the way,
> "glob.glob('*pdb') does read the files properly, but when I pass each of the to
> the other program for processing it doesn't work. I only work with files red
> with "popen".  A side problem when using "popen('ls *pdb')" I get an error
> message saying that "ls" got to many arguments. I got the same error in the
> shell. So I worked around this problem by copying all the *pdb file to a
> separate directory.

I'm not sure exactly what you're getting from your popen('ls...'), but glob()
returns the filenames with no path info.  You may simply need to append the path
back onto the filename, which you can do with os.path.join(directory, file) or
perhaps os.path.abspath(file) -- join() lets you specify any directory, while
abspath() normalizes its filename based on the current directory (which can be set
with os.chdir() ).

Jeff Shannon
Technician/Programmer
Credit International





More information about the Python-list mailing list