473,404 Members | 2,170 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,404 software developers and data experts.

python printout format

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

Feb 1 '06 #1
0 978

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: sebb | last post by:
Hi, I want to do a script in python. Users will answer to some questions in rough text and, at the end, it will be saved in a format like abiword's one. Now, I want to know how to write...
11
by: Maksim Kasimov | last post by:
in php-scripts, to insert data to database, i'm doing like this: ... $query_param = array( 'field0' => 1, 'field1' => 3, 'field2' => $var2, 'field3' => $var3, ); ...
2
by: Geoff Jones | last post by:
Hiya Can anybody remind me of the format command, or otherwise, to print a number of the same character e.g. if I wanted to printout 20 *'s ******************** then I'm sure there is an...
10
by: Python_it | last post by:
Python 2.4 MySQL-python.exe-1.2.0.win32-py2.4.zip How can I insert a NULL value in a table (MySQL-database). I can't set a var to NULL? Or is there a other possibility? My var must be variable...
1
by: P | last post by:
Hi, Access 2002. I am trying to use the PrintOut function to print the current record of the current open form in landscape format to the default Windows printer. Any suggestion on how to set...
3
by: marwa mohamed | last post by:
salamo alikom hi all when i run report that includes image control linked to a field in the table that contains the image path(on the server)and the record source of the report contains over 30...
34
by: Anthony Irwin | last post by:
Hi All, I am currently trying to decide between using python or java and have a few quick questions about python that you may be able to help with. #1 Does python have something like javas...
15
by: lixinyi.23 | last post by:
Hi! I'm currently working on a scientific computation software built in python. What I want to implement is a Matlab style command window <-> workspace interaction. For example, you type...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.