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__
[email protected] 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
En Wed, 18 Mar 2009 11:50:32 -0200, [email protected]
escribió:
On Mar 18, 6:35 pm, Peter Otten <[email protected]> wrote:
[email protected] wrote:
> Hello all,
> I've an application where I need to create 50K files spread
> uniformly across 50 folders in python. The con
On Mar 19, 12:50 am, "[email protected]"
> 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
[email protected] 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
En Wed, 18 Mar 2009 11:40:26 -0200, [email protected]
escribió:
On Mar 18, 6:16 pm, "[email protected]"
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
[email protected] wrote:
> On Mar 18, 6:35 pm, Peter Otten <[email protected]> wrote:
>> [email protected] 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
On Mar 18, 6:58 pm, Marco Mariani wrote:
> [email protected] 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
[email protected] 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
On Mar 18, 6:35 pm, Peter Otten <[email protected]> wrote:
> [email protected] 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
On Mar 18, 6:16 pm, "[email protected]"
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
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
[email protected] 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
13 matches
Mail list logo