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
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
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
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