Graphical menu in terminal

Post here if you need help with creating a Graphical User Interface in Python.

Graphical menu in terminal

Postby thevdm » Sat Nov 23, 2013 1:59 pm

Hello, I am new to Python and am developing a script designed to be run over SSH (i.e. through Putty), I currently have the script set up to ask a question and give a list of answers like so:

What would you like to do?

1: Create a new virtual server
2: Edit a virtual server
3: Delete a virtual server
4: Change service port numbers
q: Quit to the terminal

>>


I would like to know if it's possible to use Python to create a basic graphical menu within the terminal similar to that used with the Debian installer allowing the user to chose options with the arrow keys and hitting enter to select them.

For those who aren't familiar with the Debian installer here is a screen shot of what I would like to achieve from the web:
Image

I've tried searching but am either barking up the wrong tree or using the wrong search terms.

Regards
Jim
thevdm
 
Posts: 5
Joined: Thu Nov 21, 2013 12:01 pm
Location: Kent, United Kingdom

Re: Graphical menu in terminal

Postby stranac » Sat Nov 23, 2013 2:13 pm

Yes, there are a few libraries that make that possible.
urwid is probably the best one.
Friendship is magic!

R.I.P. Tracy M. You will be missed.
User avatar
stranac
 
Posts: 882
Joined: Thu Feb 07, 2013 3:42 pm

Re: Graphical menu in terminal

Postby thevdm » Sat Nov 23, 2013 2:15 pm

Thank you very much,

I have just installed Urwid and will have a look through the documentation to see what I can come up with.

Thanks again
Jim
thevdm
 
Posts: 5
Joined: Thu Nov 21, 2013 12:01 pm
Location: Kent, United Kingdom

Re: Graphical menu in terminal

Postby thevdm » Sat Nov 23, 2013 2:58 pm

Strangely enough after searching for ages I found a link from a page about Urwid to the Dialog module, it's in German but is easy enough to follow.

If anybody else is interested in the menu system the tutorial I found is here - http://www.linux-community.de/Internal/Artikel/Print-Artikel/LinuxUser/2010/11/Entwicklung-textbasierter-Oberflaechen-Teil-3/(printView)/true
thevdm
 
Posts: 5
Joined: Thu Nov 21, 2013 12:01 pm
Location: Kent, United Kingdom


Return to GUI

Who is online

Users browsing this forum: No registered users and 1 guest