Fwd: [Tutor] creating a tab delimited filename

Max Noel maxnoel_fr at yahoo.fr
Wed Mar 16 12:09:55 CET 2005


Forwarding to the list -- please use Reply to All.

Begin forwarded message:

> From: jrlen balane <nbbalane at gmail.com>
> Date: March 16, 2005 04:13:40 GMT
> To: Max Noel <maxnoel_fr at yahoo.fr>
> Subject: Re: [Tutor] creating a tab delimited filename
> Reply-To: jrlen balane <nbbalane at gmail.com>
>
> why is this not working, what i am trying to do is create a table like
> file based on 6 arrays. i 've used the forward slashes so i assume
> that the text file was created, but to no avail, there were no text
> file.:
>
>
>     for k in range (rx_len-9):
>         if byte[k] == 70 and byte [k+2] == 6 and sum(byte[k:k+10]) & 
> 0xff == 0:
>             temp1.append(byte[k+3])
>             temp2.append(byte[k+4])
>             pyra1.append(byte[k+5])
>             pyra2.append(byte[k+6])
>             voltage.append(byte[k+7])
>             current.append(byte[k+8])
>             print temp1[i], temp2[i], pyra1[i], pyra2[i], voltage[i], 
> current[i]
>
>     if i==1000:
>         i = 0
>     else:
>         i = i+1
>     ser.flushInput()
> filename = "%s%s.txt" %('C:/Documents and Settings/nyer/My
> Documents/Info',time.strftime("%Y%m%d%H%M"))
> table_file = open(filename,"a")
> lendata = len(temp1)
>
> for ii in xrange(lendata):
>     table_file.write('%i\t'%temp1[ii])
>     table_file.write('%i\t'%temp2[ii])
>     table_file.write('%i\t'%pyra1[ii])
>     table_file.write('%i\t'%pyra2[ii])
>     table_file.write('%i\t'%voltage[ii])
>     table_file.write('%i\t'%current[ii])
>     table_file.write('\n')
>
>
> ===========================
> it is printing the array so i assume that that the problem is in this
> table_file...
>
> please, i need help
>
>
-- 
maxnoel_fr at yahoo dot fr -- ICQ #85274019
"Look at you hacker... A pathetic creature of meat and bone, panting 
and sweating as you run through my corridors... How can you challenge a 
perfect, immortal machine?"



More information about the Tutor mailing list