I dont know what "$fn" is, it was there already so I left it.
The
$fn is a Zeus macro tag and it get substituted with a value.
In this case the
$fn is the
file name tag and it is replaced with the name of the currently active document.
Similarly there is a
$fdd which is is the
file drive and directory tag.
For lots more tag examples paste this line of text into a new document in Zeus and the use the
View, Open File menu to load the file:
Now to the error you are seeing:
Code: Select all
Fatal Python error: Py_Initialize: unable to load the file system codec
What has happened is you have tried to run the current file using the version of Python found here:
Now this has caused an issue only because Zeus also ships with a version of Python and these two versions are different.
To make Python work seamless inside Zeus, it sets the
PYTHONPATH to point to it's version of the Python library:
Code: Select all
C:\Users\Jack\AppData\Roaming\Xidicone\Zeus\zScript\PyLib\
Now when you compile the script it runs the other version of Python and it uses that
PYTHONPATH value, meaning it runs using the wrong version of the Python library.
Now you could fix this issue by running the other version of Python via a batch file, which would then allow you to set the
PYTHONPATH to point to the correct library.
However, a much simpler option would be to just run the version of Python that is installed with Zeus:
So all you really need to do is change the compiler command line to be this:
However there is one thing you should note.If you have a Python
test.py file open, in the
Macros menu you will see this option (towards the end of the menu):
That menu item will run your Python script.
While you can also run the script using the compile menu using your compiler options, where this will cause problems is when your macro script asks for user input.
When the compiler is run it never expects user input so it never checks for user input.
So if your script does ask for user input that will not run as expected using the compiler menu.
However, the macro menu approach does check for user input so the Python script will run perfectly with or without user input

FYI the default Zeus Python compiler command would have been set to this:
If you open that zpython.cmd batch file, you will see all the batch file does it try to syntax check the Python code found in the file.
Cheers Jussi