Re: Creating 50K text files in python

2009-03-18 Thread Laurent Rahuel
Hi, I don't know why you are forking shells using os.system. You should either use system commands to do the job or plain python, but mixing both should never be an option. Here is a plain portable python script (using the with statement. Your python should not be to old) from __future__

Re: Creating 50K text files in python

2009-03-18 Thread S Arrowsmith
venutaurus...@gmail.com wrote: >FName = "TextFile"+c+"_"+d+"_"+p+".txt" >l = 1 >for l in range(1 , 11): >os.system ("\"echo "+FName+" >> "+FName+"\"") >l = l +1 1. os.system spawns a new process, which on Windows (I'm guessing you're on Windows give

Re: Creating 50K text files in python

2009-03-18 Thread Gabriel Genellina
En Wed, 18 Mar 2009 11:50:32 -0200, venutaurus...@gmail.com escribió: On Mar 18, 6:35 pm, Peter Otten <__pete...@web.de> wrote: venutaurus...@gmail.com wrote: > Hello all, >           I've an application where I need to create 50K files spread > uniformly across 50 folders in python. The con

Re: Creating 50K text files in python

2009-03-18 Thread John Machin
On Mar 19, 12:50 am, "venutaurus...@gmail.com" >         FName = "TextFile"+c+"_"+d+"_"+p+".txt" >         l =1 >         for l in range(1 , 11): >             os.system ("\"echo "+FName+" >> "+FName+"\"") >             l = l +1 That is not the most clear code that I've ever seen. Makeover time! o

Re: Creating 50K text files in python

2009-03-18 Thread Marco Mariani
venutaurus...@gmail.com wrote: for k in range (1,1001): ... k = k+1 Man, you have a trouble with loops, all over. But the situation demands it.:-( No. I mean, the for loops are wrong. Compare with the following and see why import os base = '/tmp/foo' for outer in x

Re: Creating 50K text files in python

2009-03-18 Thread Gabriel Genellina
En Wed, 18 Mar 2009 11:40:26 -0200, venutaurus...@gmail.com escribió: On Mar 18, 6:16 pm, "venutaurus...@gmail.com" wrote:           I've an application where I need to create 50K files spread uniformly across 50 folders in python. The content can be the name of file itself repeated 10 time

Re: Creating 50K text files in python

2009-03-18 Thread Peter Otten
venutaurus...@gmail.com wrote: > On Mar 18, 6:35 pm, Peter Otten <__pete...@web.de> wrote: >> venutaurus...@gmail.com wrote: >> > Hello all, >> > I've an application where I need to create 50K files spread >> > uniformly across 50 folders in python. The content can be the name of >> > file itself

Re: Creating 50K text files in python

2009-03-18 Thread venutaurus...@gmail.com
On Mar 18, 6:58 pm, Marco Mariani wrote: > venutaurus...@gmail.com wrote: > >     for k in range (1,1001): >        ... > >         k = k+1 > > Man, you have a trouble with loops, all over. But the situation demands it.:-( I've to create 5 folders and 10 folders in each of them. Each folder again

Re: Creating 50K text files in python

2009-03-18 Thread Marco Mariani
venutaurus...@gmail.com wrote: for k in range (1,1001): ... k = k+1 Man, you have a trouble with loops, all over. -- http://mail.python.org/mailman/listinfo/python-list

Re: Creating 50K text files in python

2009-03-18 Thread venutaurus...@gmail.com
On Mar 18, 6:35 pm, Peter Otten <__pete...@web.de> wrote: > venutaurus...@gmail.com wrote: > > Hello all, > >           I've an application where I need to create 50K files spread > > uniformly across 50 folders in python. The content can be the name of > > file itself repeated 10 times.I wrote a c

Re: Creating 50K text files in python

2009-03-18 Thread venutaurus...@gmail.com
On Mar 18, 6:16 pm, "venutaurus...@gmail.com" wrote: > Hello all, >           I've an application where I need to create 50K files spread > uniformly across 50 folders in python. The content can be the name of > file itself repeated 10 times.I wrote a code using normal for loops > but it is taking

Re: Creating 50K text files in python

2009-03-18 Thread Tim Chase
I've an application where I need to create 50K files spread uniformly across 50 folders in python. The content can be the name of file itself repeated 10 times.I wrote a code using normal for loops but it is taking hours together for that. Can some one please share the code for it using

Re: Creating 50K text files in python

2009-03-18 Thread Peter Otten
venutaurus...@gmail.com wrote: > Hello all, > I've an application where I need to create 50K files spread > uniformly across 50 folders in python. The content can be the name of > file itself repeated 10 times.I wrote a code using normal for loops > but it is taking hours together for th

Creating 50K text files in python

2009-03-18 Thread venutaurus...@gmail.com
Hello all, I've an application where I need to create 50K files spread uniformly across 50 folders in python. The content can be the name of file itself repeated 10 times.I wrote a code using normal for loops but it is taking hours together for that. Can some one please share the code for