0
Buttons in python
I have wrote a script thats a virtual vending machine. How can i turn the script into an app alike ? I meant the buttons how do u creat a button that lead to a function?
3 Answers
+ 3
Brosk Jako here is a small python calculator I made sometime back... look inside the textarea / python code and the inputs at the top part of the python code and the buttons.
https://code.sololearn.com/W7ITsQjn96yK/?ref=app
+ 3
You can try various python modules/libraries that allow you to make a GUI.
In your case I recommend you to use Tkinter/Pygame to simulate a virtual vending machine.
Creating buttons is very easy with Tkinter.
https://www.tutorialspoint.com/python/tk_button.htm
If you want to simulate a whole vending machine process i would recommend you to use pygame for the whole process as its better with animations etc.
+ 2
Thanx alot :))