Thursday, June 25, 2015

python print without newline suppress newline

#Only for use in Python 2.6.0a2 and later
from __future__ import print_function
This allows you to use the Python 3.0 style print function without having to hand-edit all occurrences of print :)
On python 2.x 
simply add   ","  i,e   print  "var1",
>>> for i in range(11):
...     print i,
...
0 1 2 3 4 5 6 7 8 9 10
print() is function in python 3.x
print "xxxx" is statement in python 2.x

No comments:

Post a Comment