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 <[EMAIL PROTECTED]>

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"))
print filename
might be helpful here

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')

table_file.close() might help...do you get any error messages or just no file written?

Kent


===========================
it is printing the array so i assume that that the problem is in this
table_file...

please, i need help




_______________________________________________
Tutor maillist  -  Tutor@python.org
http://mail.python.org/mailman/listinfo/tutor

Reply via email to