C Smith wrote:
Here's an example that
cycles through 3 number, 0, 1, and 2:
###
>>> j=0
>>> for i in range(10):
.. print j
.. j = (j+1)%3
..
0
1
2
0
1
2
0
1
2
0
###
A nice way to do this is with itertools.cycle():
>>> import itertools
>>> cyc = itertools.cycle(range(3))
>>> for i in range
Hi Jacob,
Watch out with your code,
###
if i==1000:
i=0
else:
i=i+1
###
Since this test is done after you have stored your data you are
actually going to store 1001 pieces of data.
i starts at 0
you store 0
you do your test and i is incremented
{that's set 1}
i is 1
you store
Max Noel wrote:
Forwarding to the list -- please use Reply to All.
Begin forwarded message:
From: jrlen balane <[EMAIL PROTECTED]>
Date: March 16, 2005 04:13:40 GMT
To: Max Noel <[EMAIL PROTECTED]>
Subject: Re: [Tutor] creating a tab delimited filename
Reply-To: jrlen balane <[
Forwarding to the list -- please use Reply to All.
Begin forwarded message:
From: jrlen balane <[EMAIL PROTECTED]>
Date: March 16, 2005 04:13:40 GMT
To: Max Noel <[EMAIL PROTECTED]>
Subject: Re: [Tutor] creating a tab delimited filename
Reply-To: jrlen balane <[EMAIL PROTECTED]&g
On Mar 16, 2005, at 03:54, jrlen balane wrote:
how would i make this the correct path:
filename = "%s%s.txt" %('C:\Documents and Settings\nyer\My
Documents\Info',time.strftime("%Y%m%d%H%M"))
table_file = open(os.path.normpath(filename),"a")
running on IDLE, i get the following error:
Traceback (mos
how would i make this the correct path:
filename = "%s%s.txt" %('C:\Documents and Settings\nyer\My
Documents\Info',time.strftime("%Y%m%d%H%M"))
table_file = open(os.path.normpath(filename),"a")
running on IDLE, i get the following error:
Traceback (most recent call last):
File "C:/Python23/prac
that is exactly what i am looking for, but how would i add this to my
filename???
should i use this:
output_file = open(os.path.join(self.Save_Session.GetValue(),
time.strftime('%Y%m%d%H%M')), 'w')
the self.Save_Session.GetValue() is generated by a dirdialog
Uck,uck, uck, no...
That's what Kent's
that is exactly what i am looking for, but how would i add this to my
filename???
should i use this:
output_file = open(os.path.join(self.Save_Session.GetValue(),
time.strftime('%Y%m%d%H%M')), 'w')
the self.Save_Session.GetValue() is generated by a dirdialog
On Tue, 15 Mar 2005 09:41:35 -0600, C
On Tuesday, Mar 15, 2005, at 05:01 America/Chicago,
[EMAIL PROTECTED] wrote:
how am i going to change the filename automaticaly?
for example:
#every 5 minutes, i am going to create a file based on the
data above
for i in range(100)
output_file = file('c:/output' +.join(i) +'.txt
jrlen balane wrote:
so for example, i have 5 arrays, i can do this (is this correct):
data1[1,2,3,4,5 (and so on)]
data2[1,2,3,4,5 (and so on)]
data3[1,2,3,4,5 (and so on)]
data4[1,2,3,4,5 (and so on)]
data5[1,2,3,4,5 (and so on)]
datas = [data1, data2, data3, data4, data5]
for data in datas:
l
On Mar 15, 2005, at 03:35, jrlen balane wrote:
how am i going to change the filename automaticaly?
for example:
#every 5 minutes, i am going to create a file based on the
data above
for i in range(100)
output_file = file('c:/output' +.join(i) +'.txt', 'w')
#guess this won't work
so for example, i have 5 arrays, i can do this (is this correct):
data1[1,2,3,4,5 (and so on)]
data2[1,2,3,4,5 (and so on)]
data3[1,2,3,4,5 (and so on)]
data4[1,2,3,4,5 (and so on)]
data5[1,2,3,4,5 (and so on)]
datas = [data1, data2, data3, data4, data5]
for data in datas:
lines.append('\t'.j
On Sun, 13 Mar 2005, Brian van den Broek wrote:
> jrlen balane said unto the world upon 2005-03-13 19:37:
> > so for example, i am creating a text file with file.write()
> >
> > how am i going to make the file a tab-delimited file??? any
> > parameters needed???
> >
>
> >>> record1 = ['Foo', 'B
jrlen balane said unto the world upon 2005-03-13 19:37:
so for example, i am creating a text file with file.write()
how am i going to make the file a tab-delimited file??? any
parameters needed???
>>> record1 = ['Foo', 'Bar', 'Baz']
>>> record2 = ['Ham', 'Spam', 'Eggs']
>>> records = [record1, reco
specifically, I want to write an array in to a text file, how am i
going to make the file a tab-delimited file???
On Mon, 14 Mar 2005 08:37:35 +0800, jrlen balane <[EMAIL PROTECTED]> wrote:
> so for example, i am creating a text file with
> file.write()
>
> how am i going to make the file a tab-
so for example, i am creating a text file with
file.write()
how am i going to make the file a tab-delimited file??? any parameters needed???
On Sun, 13 Mar 2005 15:59:46 -0800 (PST), Danny Yoo
<[EMAIL PROTECTED]> wrote:
>
>
> On Sun, 13 Mar 2005, jrlen balane wrote:
>
> > what does a tab del
On Sun, 13 Mar 2005, jrlen balane wrote:
> what does a tab delimited filename mean? how am i going to make this?
> also how does it differs from space delimited, csv, and others?
Hello,
As Kent mentioned, you probably mean "tab delimited file", which means a
file whose lines are split up into
jrlen balane wrote:
what does a tab delimited filename mean? how am i going to make this?
also how does it differs from space delimited, csv, and others?
I think you probably mean "tab-delimited file", not "filename".
A tab-delimited file is similar to a space-delimited file. It is typically a rec
what does a tab delimited filename mean? how am i going to make this?
also how does it differs from space delimited, csv, and others?
can't really find an article that could put me in the right direction
so i posted here. thanks in advance.
___
Tutor ma
19 matches
Mail list logo