473,490 Members | 2,495 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

working with files and directories

Hi all, I'm new with Python, and I thought to use it to automatically rename
some files in a directory, but I don't know where should I search the
functions: to get all the files of a directory, to rename the files and so
on.
Thank you.
Nov 27 '06 #1
7 1384
halex2000 wrote:
Hi all, I'm new with Python, and I thought to use it to automatically rename
some files in a directory, but I don't know where should I search the
functions: to get all the files of a directory, to rename the files and so
on.
Python programmers are constantly looking at:

http://docs.python.org/lib/lib.html

In this case, see 14.1.4, 11.1, and 11.10.

Happy hacking.

--
--Bryan

Nov 27 '06 #2
"halex2000" wrote:
Hi all, I'm new with Python, and I thought to use it to automatically rename some files in a
directory, but I don't know where should I search the functions: to get all the files of a
directory, to rename the files and so on.
see

http://effbot.org/pyfaq/how-do-i-del...-questions.htm
http://docs.python.org/tut/node12.html

and the relevant modules in the library reference.

</F>

Nov 27 '06 #3
halex2000 schrieb:
Hi all, I'm new with Python, and I thought to use it to automatically rename
some files in a directory, but I don't know where should I search the
functions: to get all the files of a directory, to rename the files and so
on.
Thank you.

Have you actually even tried to find some "documentation"?
Have you placed a google search "python directories rename files"?
Thomas
Nov 27 '06 #4

"Thomas Ploch" <Th**********@gmx.netha scritto nel messaggio
news:ma**************************************@pyth on.org...
Have you actually even tried to find some "documentation"?
Have you placed a google search "python directories rename files"?
Thomas
Actually I did it on the documentation file provided with the windows
distribution. I took a look at 11 ("File and Directory Access") but the
listed functions doesn't appear to be what I need. 14.1.4 should do the job,
but was not as intuitive to find as the previous one.
Nov 27 '06 #5

"Bryan Olson" <fa*********@nowhere.orgha scritto nel messaggio
news:2Y*******************@newssvr13.news.prodigy. com...
halex2000 wrote:
>Hi all, I'm new with Python, and I thought to use it to automatically
rename some files in a directory, but I don't know where should I search
the functions: to get all the files of a directory, to rename the files
and so on.

Python programmers are constantly looking at:

http://docs.python.org/lib/lib.html

In this case, see 14.1.4, 11.1, and 11.10.

Happy hacking.

--
--Bryan
Thank you very much :-)
Nov 27 '06 #6
"halex2000" <po*******@libero.itwrote:
"Thomas Ploch" <Th**********@gmx.netha scritto nel messaggio
news:ma**************************************@pyth on.org...
>Have you actually even tried to find some "documentation"?
Have you placed a google search "python directories rename files"?
Thomas

Actually I did it on the documentation file provided with the windows
distribution. I took a look at 11 ("File and Directory Access") but
the listed functions doesn't appear to be what I need. 14.1.4 should
do the job, but was not as intuitive to find as the previous one.
Do you know about the search tab in windows help? Searching for "rename
files", or indeed a search identical to the one suggested for Google will
both find 14.1.4 as the top hit.
Nov 27 '06 #7

"Duncan Booth" <du**********@invalid.invalidha scritto nel messaggio
news:Xn*************************@127.0.0.1...
"halex2000" <po*******@libero.itwrote:
>"Thomas Ploch" <Th**********@gmx.netha scritto nel messaggio
news:ma**************************************@pyt hon.org...
>>Have you actually even tried to find some "documentation"?
Have you placed a google search "python directories rename files"?
Thomas

Actually I did it on the documentation file provided with the windows
distribution. I took a look at 11 ("File and Directory Access") but
the listed functions doesn't appear to be what I need. 14.1.4 should
do the job, but was not as intuitive to find as the previous one.
Do you know about the search tab in windows help? Searching for "rename
files", or indeed a search identical to the one suggested for Google will
both find 14.1.4 as the top hit.
I'm aware of it, thank you. I usually don't use to ask for infos that I
could easily find myself in a few seconds, but I had not the time at the
moment to even start a search (of course, If I knew it would have been so
quick, I would have done it myself). I was just under the impression that I
was looking in the wrong place.
Nov 27 '06 #8

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

Similar topics

6
3337
by: Stijn Goris | last post by:
HI all, I have created a script that allows a user to upload a picture. I have an IIS server runing on my own pc but the actual site runs an Apache server. The upload script worked perfectly on...
5
1968
by: Tum | last post by:
Hi folks, I've been trying to make a decision and it's driving me crazy. Is a directory a file or is a directory NOT a file but a node? Should I have A)
7
2124
by: Mikael Östberg | last post by:
Hello all! I have been working on a project for some time now and yesterday, my debugger stopped working. It is a class library which I run from a Win32 test app, so no IIS involved at this...
4
7551
by: Jerry | last post by:
I'm having just a bit of trouble wrapping my brain around the task of working with folders that are above the site's root folder. I let users upload photos (.jpg/.gif files) which can...
9
1931
by: craigkenisston | last post by:
Hi, I'm writing an HttpModule in order to replace the parameters in the aspx pages to look like subdirectories. i.e. instead of having : myexample.com/default.aspx?category=cat1&subcat=cat2...
6
1598
by: ZR | last post by:
Hi, I am trying to delete multiple files in a particular directory. The code will like this \\\ Dim s As String For Each s in Directory.GetFiles(...) system.io.file.delete(s) Next s ///
2
1993
by: dmoonme | last post by:
I'm trying to rename some files in a directory. Pretty basic stuff - renaming the files works fine but the problem I have is updated the text in textbox. All I want to do is appendtext to a...
7
4210
by: Anil Gupte | last post by:
Private Sub mnu2Exit_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles mnu2Exit.Click Dim fDir As String = Path.GetDirectoryName(L3Global.VideoFileName) ...
4
4184
by: rn5a | last post by:
I have a ListBox which should list all the files & directories that exist in a particular directory. The problem is I can get the ListBox to list either all the files or all the directories but not...
6
7579
by: josequinonesii | last post by:
I've searched, I've read, I've tested and re-read numerous post but to no avail yet... Quite simply, the settings I've applied to my httpd.conf, httpd-vhost.conf and my hosts files simply does not...
0
7112
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
6974
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...
0
7146
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
1
6852
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
7356
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
5448
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
1
4878
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
4573
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
277
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

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.