[pygame] Update Python 2.7 project to work with Python 3

1 view
Skip to first unread message

Jeff Mitchell

unread,
Apr 27, 2021, 2:25:20 AM4/27/21
to pygame...@seul.org

Is there an easy way to update an old project (https://sourceforge.net/projects/twodracing/) to work with the latest Python/Pygame? I'd like to get this 2D driving simulator to run.

BW

unread,
Apr 27, 2021, 2:43:56 AM4/27/21
to pygame...@seul.org
Hi Jeff. Do a web search for "python 2to3" code convertor.

On 4/26/2021 10:26 PM, Jeff Mitchell wrote:
>
> Is there an easy way to update an old project
> (https://sourceforge.net/projects/twodracing/
> <https://sourceforge.net/projects/twodracing/>) to work with the

Thomas Kluyver

unread,
Apr 27, 2021, 6:51:37 AM4/27/21
to pygame-users
You can try the 2to3 command line tool included as part of Python: https://docs.python.org/3/library/2to3.html

This can quickly and reliably do the simple, repetitive work like changing 'print x' to 'print(x)' for Python 3. But you'll probably still need to spend a while manually debugging the code on Python 3, because not everything can easily be fixed by an automatic tool.

Thomas

Jeff Mitchell

unread,
Apr 27, 2021, 3:07:26 PM4/27/21
to pygame...@seul.org

This project uses a GUI and the program source may not be compatible with the latest version of the GUI. I'd be better off to write from scratch. Even if I don't implement drag or acceleration, I can use pi and trig to have an object travel at angles, as a minimum (one step at a time). When I've paid more of my student debt I'd like to study some basic maths papers at university so I can learn all the theories of 2D physics.

David

unread,
Apr 27, 2021, 8:59:45 PM4/27/21
to pygame...@seul.org
just dump 2.7 and move to the more relevant 3.x

On Tue, Apr 27, 2021 at 2:25 AM Jeff Mitchell <ch...@jeff-mitchell.co.nz> wrote:

Is there an easy way to update an old project (https://sourceforge.net/projects/twodracing/) to work with the latest Python/Pygame? I'd like to get this 2D driving simulator to run.



--
David
Running Linux since 1994
IT Tech Support & SysAdmin
We are using Linux daily to UP our productivity - so UP yours!
Reply all
Reply to author
Forward
0 new messages