Hi, I'm looking to have the same functionality (history, ...) as when you simply type python in your terminal. The script I have goes through a bunch of setup code, and when ready, the user should have a command prompt. What would be the best way to achieve this?
+9
A:
Either use readline
and code the shell behaviour yourself, or simply prepare the environment and drop into IPython
.
viraptor
2010-09-14 00:53:11
Thank for the links, looks promising.
sharvey
2010-09-14 01:20:26
detly's answer is simpler and fits the problem at hand. Thanks for the info, i'll definitely bookmark that.
sharvey
2010-09-14 02:49:20
+3
A:
Run the script from the console with python -i
. It will go through the commands and drop you in the usual Python console when it's done.
detly
2010-09-14 01:22:09