You are not logged in.
I'd like to write a basic shell in Python, with primitive line editing capabilities. I know about cmd module, but I need multi-window capabilities within a terminal which I'd like to implement with curses module. However, curses works at low level and for implementing even rudimentary line editing functionality, one needs to do a lot of coding for primitive tasks such as characters inserting, deleting, moving the cursor and the like. I wonder, does there exists some "framework" or sample application for creating shell-like application with Python-curses, which provides basic line-editing functionality?
I came across this example of an interactive curses-shell, but it lacks almost any editing functionality.
EDIT: After some research on the topic it seems that the required functionality can be implemented without reinventing the wheel via interaction of three modules: curses, curses.textbox and cmd.
EDIT2: Also bpython, proposed in the thread, seems like a good example.
Last edited by nbd (2015-01-31 09:58:23)
bing different
Offline
Offline
firecat53
Thanks! Seems like a good example!
bulltmark
Yes, I currently use 'readline' with 'cmd' and it has excellent functionality, but I couldn't figure out how to use it with 'curses'.
bing different
Offline
For curses based applications look at the urwid package.
Whitie
Offline
For curses based applications look at the urwid package.
Whitie
Yep, I saw it, but for my needs it's a bit over the top.
bing different
Offline