Last active
April 29, 2020 02:01
-
-
Save wangwanzhong/ad04848b7b9642023bf9978a81f27d9d to your computer and use it in GitHub Desktop.
select menu to excute in interactive model
Menu
- Start script
- Stop script
- status script
- Quit script
Enter your option:1
None is not a valid choiceProcess finished with exit code 0
isn't it should be start should execute?
Thanks for your feedback.
problem is choice = input("Enter your option: ")
returns string rather than integer,
i fix it through changing self.choices
keys from integer to string.
self.choices = { 1: self.start, 2: self.stop, 3: self.status, 4: self.quit }
to
self.choices = { '1': self.start, '2': self.stop, '3': self.status, '4': self.quit }
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Menu
Enter your option:1
None is not a valid choice
Process finished with exit code 0
isn't it should be start should execute?