aegirhall / console-menu

A simple Python menu system for building terminal user interfaces.
MIT License
365 stars 58 forks source link

demo doens't work #77

Closed saepien closed 2 years ago

saepien commented 2 years ago

I copied/pasted the demo code as-is to try it out. Got this error:

→ ./menu.py from: can't read /var/mail/consolemenu from: can't read /var/mail/consolemenu.items ./menu.py: line 6: syntax error near unexpected token (' ./menu.py: line 6:menu = ConsoleMenu("Title", "Subtitle")'

aegirhall commented 2 years ago

Hi @saepien, I believe you're facing two issues here:

1) If you're going to execute the example code directly as a standalone script, such as "./menu.py", you'll need a "#!" at the top of the file, e.g., #!/usr/bin/python. Otherwise, you'll need to execute it as "python menu.py".

2) You'll need to ensure that the python environment you're invoking already has console-menu installed, e.g., pip install console-menu.