Copy-paste into Python interactive interpreter and indentation -
this piece of code, test.py:
if 1: print "foo" print "bar" can succesfully executed execfile("test.py") or python test.py, when 1 tries copy-paste python interpreter:
file "<stdin>", line 3 print "bar" ^ syntaxerror: invalid syntax why so? can interpreter configured in such way read copy-pasted text succesfully? guess may affect typing in interpreter, that's ok me.
indentation lost or broken.
have @ ipython -- it's enhanced python interpreter many convenient features. 1 of them magic function %paste allows paste multiple lines of code.
it has tab-completion, auto-indentation.. , many more. have @ site.
using %paste in ipython:

and copy-and-paste stuff 1 of things fixed in qt console, here's using plain old copy-and-paste of code block "just works" in new ipython qtconsole:

Comments
Post a Comment