Python Interactive Prompt
Logging a session
Automatic logging of input
The input entered during an interactive shell is automatically logged in ~/.python_history.
To view the last 100 commands:
tail -100 ~/.python_history
To view the last 10 commands:
tail -10 ~/.python_history
Log session output and input
To store the entire contents of a session in a file, we recommend using the bash command script which is preinstalled on your vlun. To log the entire contents of a session:
script /var/log/python_interactive
Complete your interactive session as normal
Start session with sb_python and end with exit()
At the conclusion of your session, to turn off the console log use the following command:
exit
A confirmation message will be printed:
Script done, file is /var/log/python_interactive