开发者

Create console in python

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 o开发者_Python百科f setup code, and when ready, the user should have a command prompt. What would be the best way to achieve this?


Either use readline and code the shell behaviour yourself, or simply prepare the environment and drop into IPython.


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.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜