RE: Create directories and modify files with Python

2012-06-12 Thread Prasad, Ramit
Thanks for the directions. By the way, can you see my post in Google Groups? I'm not able to, and I don't know why. They may have copied the Gmail idea that you never need to see anything anything you posted yourself. I can see all my posts in a Gmail thread/conversation but if there are

Re: Create directories and modify files with Python

2012-06-08 Thread Robert Miles
On 5/1/2012 5:51 AM, deltaquat...@gmail.com wrote: Il giorno martedì 1 maggio 2012 01:57:12 UTC+2, Irmen de Jong ha scritto: [snip] Focus on file input and output, string manipulation, and look in the os module for stuff to help scanning directories (such as os.walk). Irmen Thanks for the

Re: Create directories and modify files with Python

2012-05-04 Thread Hans Mulder
On 1/05/12 17:34:57, ru...@yahoo.com wrote: from __future__ import print_function #1 #1: Not sure whether you're using Python 2 or 3. I ran this on Python 2.7 and think it will run on Python 3 if you remove this line. You

Re: Create directories and modify files with Python

2012-05-03 Thread deltaquattro
I'm leaving the thread because I cannot read any posts, apart from Irmen's. Anyway, I would like to publicly thank all who contributed, in particular rurpy who solved my problem (and kindly sent me a personal email, so that I could see his/her post :) Best Regards Sergio Rossi --

Re: Create directories and modify files with Python

2012-05-01 Thread deltaquattro
Il giorno martedì 1 maggio 2012 01:57:12 UTC+2, Irmen de Jong ha scritto: Hi, 0 I would like to automate some simple tasks I'm doing by hand. Given a text file foobar.fo: [...] At first, I tried to write a bash script to do this. However, when and if the script will work, I'll

Re: Create directories and modify files with Python

2012-05-01 Thread Peter Otten
deltaquat...@gmail.com wrote: At this point, I go for a Fortran/C code, which takes me longer to write. If you already have a basic programming knowledge the tutorial that comes with Python should be an excellent starting point: http://docs.python.org/py3k/tutorial/index.html Now I'd like

Re: Create directories and modify files with Python

2012-05-01 Thread Chris Angelico
On Tue, May 1, 2012 at 9:45 PM, Peter Otten __pete...@web.de wrote: In that spirit I'd like to make an alternative offer: put some effort into the job yourself, write a solution in bash and post it here. I (or someone else) will then help you translate it into basic Python. That will typically

Re: Create directories and modify files with Python

2012-05-01 Thread ru...@yahoo.com
On 04/30/2012 05:24 PM, deltaquat...@gmail.com wrote: Hi, I would like to automate some simple tasks I'm doing by hand. Given a text file foobar.fo: 073 1.819 085 2.132 100 2.456 115 2.789 I need to create the directories 073, 085, 100, 115, and copy in each directory a modified

Re: Create directories and modify files with Python

2012-05-01 Thread Irmen de Jong
On 1-5-2012 12:51, deltaquat...@gmail.com wrote: But if you really want to go this way (and hey, why not) then first you'll have to learn some basic Python. A good resource for this might be: http://learnpythonthehardway.org/ Ehm...name's not exactly inspiring for a newbie who's short on time

Create directories and modify files with Python

2012-04-30 Thread deltaquattro
Hi, I would like to automate some simple tasks I'm doing by hand. Given a text file foobar.fo: 073 1.819 085 2.132 100 2.456 115 2.789 I need to create the directories 073, 085, 100, 115, and copy in each directory a modified version of the text file input.in: . . . foo = 1.5 ! edit this

Re: Create directories and modify files with Python

2012-04-30 Thread Mark Lawrence
On 01/05/2012 00:24, deltaquat...@gmail.com wrote: Hi, I would like to automate some simple tasks I'm doing by hand. Given a text file foobar.fo: 073 1.819 085 2.132 100 2.456 115 2.789 I need to create the directories 073, 085, 100, 115, and copy in each directory a modified version of the

Re: Create directories and modify files with Python

2012-04-30 Thread Irmen de Jong
On 1-5-2012 1:24, deltaquat...@gmail.com wrote: Hi, 0 I would like to automate some simple tasks I'm doing by hand. Given a text file foobar.fo: [...] At first, I tried to write a bash script to do this. However, when and if the script will work, I'll probably want to add more features