Name | Modified | Size | Downloads / Week |
---|---|---|---|
pythonizing1_1.zip | 2022-06-13 | 61.1 kB | |
Pythonizing1_1ProjectFiles.zip | 2022-05-30 | 523.1 kB | |
Pythonizing1_0Project Files.zip | 2022-05-30 | 427.5 kB | |
readme.txt | 2022-05-30 | 3.1 kB | |
pythonizing1_0.zip | 2022-05-23 | 60.6 kB | |
Totals: 5 Items | 1.1 MB | 0 |
Recipe for downloading and running the Pythonizer ------------------------------------------------- Note 1: This recipe is designed for Windows. The Pythonizer will run on any platform that runs the Python interpreter, but you will need to modify some of the steps. Note 2: You will need administrator permission for some of the steps. 1. Download the "pythonizing1_1.zip" file into a temporary folder, such as "Temp". 2. Unzip the "pythonizing1_1.zip" file to make a folder "pythonizing1_1". 3. Create a folder "Pythonizer" in your "Program Files" folder. 4. Move the "pythonizing1_1" folder into it. 5. Find the environment variables for your system (Settings/System/About/Advanced System Settings/Environment Variables) 6. In the "User Variables" section, Find the "Path" environment variable. 7. Add the path of the "pythonizing1_1" folder to it. You can do this by selecting the "Path" variable, and pressing the "Edit" button. When the list of paths appears, press the "New" button and add the new path. (e.g. "C\Program Files\Pythonizer\pythonizing1_1") 8. The "pythonizing1_1" folder contains a file "pythonize.bat" which allows you to run the pythonizer from anywhere in the folder tree by saying pythonize fred.java (or whatever your source file is called) The pythonizer will run and, if successful, will produce a folder "fred.py" in the same folder as the java source file. You will need to modify the "pythonize.bat" file if: a) you do not use the command "python" to run Python on your system b) you have not downloaded the "pythonizing1_1" folder into "C\Program Files\Pythonizer", but have used some other name. c) you are working on a Unix or Mac system, in which case the name will have to be changed too. 9. Enjoy fast translation of your legacy Java files to Python. Note that: a) The Pythonizer expects the controlled statement of an if, for, while or do statement to be a block. This is good practice anyway, but even the most meticulous programmer sometimes forgets! b) The Pythonizer does not attempt to analyse Java expressions, but merely copies them, changing the names as required. So, for example, Java conditional expressions, which have no equivalent in Python, will be translated as-is, question-mark and all. (In both these cases, a little editing of the original Java file will sort the problem. Still much quicker than hand-translation!) c) If the Java source is not valid Java (version 1.8 or before) the Pythonizer may fail with an exception. No line number is given, but it is usually fairly easy to see where the error occurred by examining the resulting Python file. Again, a little editing will usually sort the problem. 10. Please send any comments or queries to me, Richard Bosworth, by email on talkguibits@gmail.com