Welcome!
This is the community forum for my apps Pythonista and Editorial.
For individual support questions, you can also send an email. If you have a very short question or just want to say hello — I'm @olemoritz on Twitter.
Curses/TUI alternative
-
Hi everyone,
Python noob here. From my understanding, Pythonista does not support curses module. Does anyone know of alternatives to provide a cross platform Text User Interface that plays well with Pythonista? So far I've been using a self-made bare bones menu system but wondering if there are any recommendations of TUI frameworks that Pythonista support.
Thanks in advance!
-
@daraux Why a TUI over a GUI? Is it issues with cross-platform support?
-
Yes I should have prefaced my thread by saying that. Interactive scripts running across multiple platforms (Linux, *BSD). Curses is easiest enough to work with but breaks on iOS. I use my iPad for about 25% of my work so using a common interface would be nice :-). Any suggestions would be appreciated.
-
As I understand it, the main functionality of
curses
is manipulating a traditional terminal display's properties, such as cursor position, text color and style, whether keyboard input is echoed, etc. The Pythonista console is not very similar to a "real" terminal or even a terminal emulator likecmd.exe
,Terminal.app
orxterm
. The Pythonista console displays continuous rich text output and has a separate input text field. Terminals are based on a grid of monospace characters and a freely moving cursor, which may be used for normal text I/O, but can also be modified arbitrarily. It would be very difficult to emulatecurses
in the normal Pythonista console without some major redesigning (which I would not find very useful IMHO).Recent versions of stash provide limited terminal emulation, most importantly cursor movement detection (for more advanced features than basic line editing) and understanding of ANSI escape codes for text formatting.
If you want to write a program that runs well on Pythonista and normal computers, then you're basically stuck with command-line arguments,
print
,raw_input
andgetpass.getpass
for user interaction. Advanced terminal features aren't supported by Pythonista itself, and none of the major desktop GUI frameworks are available for iOS (let alone Pythonista) either. -
Thanks dgelessus, that helps me understand why it's not really doable under Pythonista. Cheers.