Can I embedding a (python) console on python program?

Lie Ryan lie.1296 at
Sat Feb 20 08:33:30 CET 2010

On 02/20/10 16:38, Kee K Y CHEN wrote:
> HI All,
> Apologize for being a newbie to python area and sorry for my English. 
> Actually what I need is embedding a python interactive console(or other
> shell console alike module) on my python program for debugging and
> controlling purpose during the program runtime. 
> For example, print/set some important value, query some runtime status
> when I remote login to host via telnet/ssh when the program running on
> the host. One of the idea is I can write the program use the GUI tech,
> but that is not fit for someone use a text based session.
> In summary, in my scheme, it should something looks like the GEdit
> extension - python console and but may interactive with tty/vty lines.
> Can anyone give a brief to me? 
> Thanks in advance.  

Look how IDLE and pdb does it. I believe the `cmd` built-in module is
specifically written for this case.

More information about the Python-list mailing list