GEOS-ESM / WxMap

Apache License 2.0
2 stars 2 forks source link

Automated Python 2 to Python 3 conversion? #15

Open ashiklom opened 4 days ago

ashiklom commented 4 days ago

Has anyone tried to see if automatically converting this project from Python 2 to Python 3 would "just work"?

Assuming you have Python 3 loaded, a command like the following should work:

2to3 -nw .
# Note: This will *not* create backups!
# To backup the original files, remove the -n flag:
# 2to3 -w .

From my quick test (using 2to3-3.12, the latest version of the tool designed for Python 3.12), this produced pretty reasonable-looking results, but I haven't had a chance to actually run anything with it. You can see the results here: https://github.com/ashiklom/WxMap/tree/python3

Orcus-IRL commented 3 days ago

upgrading python won't affect any functions in the code