path(file)

  • Thread starter Sara Khalatbari
  • Start date
A

alex23

Sara said:
Suppose I have a list of files & I wanna know their
path.
is there a command that helps me do so in python?

Do you _really_ intend to learn Python one question to this list at a
time?

There's a tutorial list that exists to help early users:
http://mail.python.org/mailman/listinfo/tutor

You'd also benefit from going through their archives:
http://mail.python.org/pipermail/tutor/

I'm sorry if this reply sounds a little terse, I'm just concerned about
comp.lang.python's gradual decline into a search engine for questions
that can be quickly and easily answered by even a casual check of the
documentation.

-alex23
 
F

Fuzzyman

Can you give us an example of the way the 'list of files' is stored in.

import os
print os.path.abspath(filename)

Will do *something*... so long as 'filename' contains a path relative
to the current working directory. What you want is undoubtably in the
os and os.path modules.

Regards,

Fuzzy
http://www.voidspace.org.uk/python
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
474,238
Messages
2,571,193
Members
47,830
Latest member
ZacharySap

Latest Threads

Top