[Q] A better way to print?

Eric Gorr eRrEiMcOgVoErMrE at cox.net
Sat Feb 22 15:00:41 EST 2003


I have some print code that looks like:

  for i in range(N-1):
    print W[i],
    sys.stdout.softspace = 0
    print '-',
    sys.stdout.softspace = 0

  print W[-1]

and this outputs things of the form:

  1-0-1-0-0-0

is there a better method?

My knowledge of python is somewhat limited.

Thank you.




-- 
== Eric Gorr ========= http://www.ericgorr.net ========= ICQ:9293199 ===
"Therefore the considerations of the intelligent always include both 
benefit and harm." - Sun Tzu
== Insults, like violence, are the last refuge of the incompetent... ===




More information about the Python-list mailing list