The same script can now be run on Python 2 and Python 3
Main issues between Python 2.x and Python 3.x on this script are the handling of bytes/strings and the print statements.
Changes made:
Changed print statements to use the print() function that both versions support
Added another set of encrypt/decrypt functions that are chosen using version detection.
There are no changes to the functionality of the script. You can run it with exactly the same arguments as you could before. Should be more or less a drop in replacement for everyone as long as the print statement formatting doesn't screw things up for you. It also allows for people to use this script with Python 3 in the future.
If you don't like the giant if statement you can choose which functions you want depending on the version you are using and delete the other one in your own projects. First set of encode/decode is for python3 the second set is for python 2
The same script can now be run on Python 2 and Python 3
Main issues between Python 2.x and Python 3.x on this script are the handling of bytes/strings and the print statements.
Changes made:
There are no changes to the functionality of the script. You can run it with exactly the same arguments as you could before. Should be more or less a drop in replacement for everyone as long as the print statement formatting doesn't screw things up for you. It also allows for people to use this script with Python 3 in the future.
If you don't like the giant if statement you can choose which functions you want depending on the version you are using and delete the other one in your own projects. First set of encode/decode is for python3 the second set is for python 2