Python Forum

Full Version: Create menu with selectable items
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Hi, I'm pretty new to python but enjoying learning. I have done quite a bit of searching for this but come up empty handed so have signed up here. Any help would be much appreciated.

What I would like to do it create a menu in python that you can select items and then use those items as variables. I'm sure you have seen scripts before where you get a list of options and you use spacebar to select an item/s.

What I am trying to achieve is this;

- Write a script that backs up Cisco routers to a folder by their IP address (I have completed this)
- Have a function in the script lists all of the files in a specific folder and allow you to select two of them to compare.]

Don't worry, I'm not asking how to write the whole script, I was just hoping someone could point me in the example of how to create that menu with selectable options. I don't want t use TkInter, just want it to show up in the script.

Thank you
SaladFingers
you can use this package: https://pypi.org/project/curses-menu/
It's a bit old, but I installed it and it runs fine in python 3.7.4
install with:
pip install curses-menu
(Sep-26-2019, 12:54 AM)Larz60+ Wrote: [ -> ]you can use this package: https://pypi.org/project/curses-menu/
It's a bit old, but I installed it and it runs fine in python 3.7.4
install with:
pip install curses-menu

Thanks Larz, that's great, I will look into this. Seems like just what I need though.
If you want something simple, I wrote a tutorial on command line interfaces that might fit the bill.
(Sep-26-2019, 12:53 PM)ichabod801 Wrote: [ -> ]If you want something simple, I wrote a tutorial on command line interfaces that might fit the bill.

That's great, thank you. I will check it out as well.