[Theory] How to speed up python code execution / pypy vs GPU

Chris Angelico rosuav at gmail.com
Wed Nov 9 20:50:12 EST 2016


On Thu, Nov 10, 2016 at 12:16 PM, BartC <bc at freeuk.com> wrote:
> But now that I was about to use it, another problem. The Ubuntu Python is
> 2.7. The Windows one has both 2.7 and 3.4 (and my IDE can select either).
>
> The bit of code I wanted to run has Py3-style print functions. I tried
> 'import six' as someone suggested recently, but that didn't help as it sees
> a syntax error in the Print line before 'six' can do its thing.
>
> I suppose I can get rid of the prints for the test I wanted to do, or find
> out how to do the same thing under Py2 print. Or install Py3 on Ubuntu,
> which is a big job and I've no idea how to switch between them.
>
> Or I could just leave it all until tomorrow...

On recent Ubuntus, Python 2.7 isn't even installed by default. Use
Py3. It's there.

And if you want to use print() on Py2, learn about the __future__.

ChrisA



More information about the Python-list mailing list