473,614 Members | 2,508 Online
Bytes | Software Development & Data Engineering Community
+ 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 1390
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**********@g mx.netha scritto nel messaggio
news:ma******** *************** *************** @python.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*********@no where.orgha scritto nel messaggio
news:2Y******** ***********@new ssvr13.news.pro digy.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*******@libe ro.itwrote:
"Thomas Ploch" <Th**********@g mx.netha scritto nel messaggio
news:ma******** *************** *************** @python.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**********@i nvalid.invalidh a scritto nel messaggio
news:Xn******** *************** **@127.0.0.1...
"halex2000" <po*******@libe ro.itwrote:
>"Thomas Ploch" <Th**********@g mx.netha scritto nel messaggio
news:ma******* *************** *************** *@python.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
3362
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 my IIS but refuses to work on the Apache. All I know is that the script stops working at move_uploaded_file() function. The warnings echo'ed are: Warning: move_uploaded_file(images/nieuws/TIDEEY%7E1.jpg): failed to open
5
1976
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
2143
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 point. I can still set breakpoints and when debugging the breakpoints get hit - just like it would work normally.
4
7562
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 subsequently be viewed on the site's pages. My hosting provider is requiring that any files my Web app writes get written to a folder that is above the app's root folder (for security purposes). When writing the files I understand how to use MapPath to...
9
1946
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 I want to have : myexample.com/cat1/cat2/
6
1601
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
1998
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 textbox. The problem is that duplicate text occurs. Hopefully my code will explain better what I'm trying to do and what i'm doing wrong :) Thanks for your help! Public Class Form1 Private Sub btnRun_Click(ByVal sender As System.Object, ByVal e...
7
4218
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) File.Delete(L3Global.VideoFileName) ' The following is not working - reports directory not empty exception ' Directory.Delete(fDir)
4
4214
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 the 2 of them together. This is what I tried: Sub Page_Load(.....) Dim dInfo As DirectoryInfo dInfo = New DirectoryInfo(Server.MapPath(MyDir))
6
7591
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 work. Please review my work and let me know if you see that one little thing that is throwing me for a loop. HTTPD.CONF # # This is the main Apache HTTP server configuration file. It contains the # configuration directives that give the...
0
8591
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
8294
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8444
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
7115
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
6093
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 presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
4058
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
4138
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2575
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
1
1758
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.