473,386 Members | 1,798 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,386 software developers and data experts.

path(file)

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

Yahoo! Mail
Stay connected, organized, and protected. Take the tour:
http://tour.mail.yahoo.com/mailtour.html

Jul 19 '05 #1
3 1330
What about start reading http://docs.python.org/lib/module-os.path.html?

Jul 19 '05 #2

Sara Khalatbari wrote:
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

Jul 19 '05 #3
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

Jul 19 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: John G | last post by:
How can I Programmatically access maximum path, file, and sum of both lengths? I am using VB.NET 2003. The PathTooLongException indicates that a path < 248 characters, filename < 260...
1
by: LP | last post by:
If you can't seem to eliminate throwing this exception, then the answer is to look for a different file opened previously with an invalid or missing filename. For example, assume the following...
0
by: John G | last post by:
How can I Programmatically access maximum path, file, and sum of both lengths? I am using VB.NET 2003. The PathTooLongException indicates that a path < 248 characters, filename < 260...
0
by: John G | last post by:
How can I Programmatically access maximum path, file, and sum of both lengths? I am using VB.NET 2003. The PathTooLongException indicates that a path < 248 characters, filename < 260...
3
by: vellyna | last post by:
how to appear path file name? for example, i have select "books" from list, then i browse the file.. after browse the file, i want to appear the path file name that will save the file in a...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.