Re: print without ()

2017-09-06 Thread Glenn Hutchings
On Thursday, 7 September 2017 07:14:57 UTC+1, Andrej Viktorovich wrote: > Sometimes I find code with strange print function usage. String is passed > without brackets. > > #!/usr/bin/python > list = ['physics', 'chemistry', 1997, 2000]; > print "Value available at index 2 : " > print list[2] > l

Re: print without ()

2017-09-06 Thread Jan Erik Moström
On 7 Sep 2017, at 8:14, Andrej Viktorovich wrote: If I use command print "aaa" in console I get error. So, why this is allowed in sample? You're probably using Python 2 for the listed script and Python 3 when you try in the console. = jem -- https://mail.python.org/mailman/listinfo/python-l

Re: print without newline "halts" program execution

2006-04-15 Thread Karlo Lozovina
Jay Parlar <[EMAIL PROTECTED]> wrote in news:[EMAIL PROTECTED]: > Your problem is that the 'print' statement is sending the text to > sys.stdout, and sys.stdout is buffered. I thought it was something like this, but I couldn't find it in the docs : (. > print 'Start: %f,'% st, > sys.stdout.flu

Re: print without newline "halts" program execution

2006-04-13 Thread Jay Parlar
On Apr 13, 2006, at 5:57 PM, Karlo Lozovina wrote: > Consider this short script: > > --- > from time import time, sleep > > st = time() > print 'Start: %f, ' % st, > sleep(10) > sp = time() > print 'Stop: %f, Duration: %f' % (sp, (st - sp)) > --- > > On my environment (Linux, py24), when run, Pyt