From: Paolo <pl...@ka...> - 2008-05-29 14:40:05
|
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> <html> <head> </head> <body bgcolor="#ffffff" text="#000000"> Hi, i have this python script<font face="Times New Roman, Times, serif"><br> <br> //load.py<br> <i>def loadText(start, file):<br> """load data from a (opened) file in TI-Text format"""<br> next = start + 1<br> startAddr = start<br> segmentdata = []<br> #Convert data for MSP430, TXT-File is parsed line by line<br> while next >= 1:<br> #Read one line<br> l = file.readline()<br> if not l: break #EOF<br> l = l.strip()<br> if l[0] == 'q': break<br> elif l[0] == '@': #if @ => new address => send frame and set new addr.<br> #create a new segment<br> if segmentdata:<br> self.segments.append( Segment(startAddr, string.join(segmentdata,'')) )<br> startAddr = int(l[1:],16)<br> segmentdata = []<br> else:<br> for i in string.split(l):<br> segmentdata.append(chr(int(i,16)))<br> if segmentdata:<br> self.segments.append( Segment(startAddr, string.join(segmentdata,'')) )</i><br> <br> </font>how can i to execute the script from java passing the argument start e file ?<br> <br> thanks<br> </body> </html> |