Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Python > python printout format

Reply
Thread Tools

python printout format

 
 
Yong Wang
Guest
Posts: n/a
 
      02-01-2006
Hi,
I have a data set like row = [[1,2,3,4,5], [6,7,8,9,10], [11,12,13,14,15]]
when I use loop to print out data, I got compile error in printout statment.
while j<24:
print ' ',string.ljust(str(units[0]), 5),
print ' ',string.ljust(str(ports[j], 3),
print ' ',string.ljust(PortlinkbeatInv[row[j][0]],14),
print ' ',string.ljust(PortStatusInv[row[j][1]], 19),
print ' ',string.ljust(PortTestResultInv[row[j][2]],17),
print ' ',string.ljust(PortVisualInv[row[j][3]],19),
print ' ',string.ljust(PortAddrVioInv[row[j][4]],15)
j=j+1
misc.doPg('Port status listing on ' + tag + ' (Page %d):',
vals,doBanner,doRow)

Error messages are:
python -c "import compileall; compileall.compile_dir('.',0)"
Listing . ...
Compiling ./Ciscoports.py ...
File "./Ciscoports.py", line 753
print string.ljust(PortlinkbeatInv[row[j][0]],14),
^
SyntaxError: invalid syntax


How should I change to printout row data [1,2,3,4,5] in one row in assigned format?
Many thanks,

Yong

 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Python printout Avrajit Python 1 01-03-2013 12:01 PM
Imbedding Word Files in Printout Bill Dennis Java 0 12-05-2003 09:50 PM
updated exam printout Mark Scott MCSE 3 11-02-2003 02:18 PM
printout of object property settings TJS ASP .Net 0 10-17-2003 05:17 PM
Can I output a printout as a tif? Mike Grace Java 1 08-27-2003 05:55 PM



Advertisments
 



1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57