In Linux the usual commands work natively. I can past a string into the game console with CTRL-V, while with CTRL-C I can copy the whole input line I am typing.
To copy the output of a command instead, I launch the game through the terminal:
Code:
> cd /path/to/game/
> ./GAME_NAME.sh
then I open the game console. To redirect the output of the Ren'py console to the pc terminal, I just use "print()" in the former. For instance, to display the variables list:
Alternatively, it is possible to create a text file and use it to read/write data. I guess this solution works on Windows/Mac too.
For instance, if I want to save the variables list:
Code:
fp = open('dummy.txt', 'w')
fp.write(str(dir()))
fp.close()
(being the output of "dir()" an object, I convert it into a string).
To input a string instead:
1) first, I write the string in my dummy file (for instance "dir()" without quotation marks)
and I name the file "dummy.txt"
2) then I type in the game console:
Code:
fp = open('dummy.txt', 'r')
eval(fp.readline())
fp.close()
If I replace "eval" with "exec", the output is redirected to the pc terminal.
In both cases the game looks for the dummy file in the directory with the .exe.