Hi
Can I send date and time like Hex in to the Serial port or file.
------------------------------------
from time import *
def TimeMake():
'''Formating time and data (dd-mm-yy hh:mm) and change it like ASCII'''
Time=list(localtime()) #get Time and Date
Time[0]=str(Time[0]) #Make (yy) str
Time = '%02d-%02d-%s %02d:%02d' % (Time[2], Time[1], Time[0][2:],
Time[4], Time[5]) #Formating (dd-mm-yy hh:mm)
TimeHex = []
for i in Time: #Take ASCII
TimeHex.append(ord(i))
Time =[]
for i in TimeHex: #Make ASCII in hex format
Time.append(hex(i))
return Time
Time=TimeMake()
#When I write it in the some file is a string but must to be like hex
------------------------------------
--
Криле имат само тия, дето дето сърцето им иска да лети !
_______________________________________________
Tutor maillist - [email protected]
To unsubscribe or change subscription options:
http://mail.python.org/mailman/listinfo/tutor