Page 1 of 1
python: testing loops via input(): Possible within Zeus
Posted: Sun Jan 31, 2010 10:31 pm
by werbarral
Compiling command shows the result given out by the installed python engine.
My question:
Can I test loops, e.g. via the input() without opening another editor? The request to put in a number or else is shown in the result.
Posted: Mon Feb 01, 2010 12:35 am
by jussij
Unfortunately there is no way to configure Zeus so that the keyboard input is sent to a running script
The best that can be done is to have the script run in it's own console window which allows the user to interact with the script and then have Zeus capture the output once the script ends.
To do this you will need to use the
tee.exe utility found in the Zeus install folder.
Next create a
test.cmd batch file to run the script that looks something link this:
Code: Select all
@echo off
rem Run the the script through tee to capture its output
call python c:\temp\test.py | tee c:\temp\output.txt
rem Let Zeus see the output
type c:\temp\output.txt
Now add the
test.cmd file to the Zeus tools menu as a visible
DOS Command with the
c:\temp\compile.cmd argument and with output captured.
IMPORTANT NOTE: The batch file must be configured as a tool and not a compile, because Zeus always runs the compilers as hidden.
What will happen is the script will be run in a new console window and when the script ends the output will be captured into Zeus.
Cheers Jussi