menu

How to add image/icon in menu item on pysimplegui

How to add image/icon in menu item on pysimplegui Question: I am using PySimplegui for UI development,want to know if there is a way to add menu icon as shown in the image below this can be done with Tkinter and is working fine ,but i am failed to find any references in pysimplegui any …

Total answers: 2

Why do I need to input 'q' more than once to quit the while loop?

Why do I need to input 'q' more than once to quit the while loop? Question: I am making a text-based menu and wanted to have the program end when the letter ‘q’ is inputted however I need to do it more than once (2 or 3, I am not sure why it can be …

Total answers: 1

How to loop menu choice validation in python?

How to loop menu choice validation in python? Question: I am trying to make a loop to validate my menu choices to be integers, but receiving this error when inputting lettersline 138, in <module> option = int(input("Enter your option:")) ValueError: invalid literal for int() with base 10: ‘test’ . Sorry if code is a mess …

Total answers: 3

How to make menu using dict evaluation for small python guessing game

How to make menu using dict evaluation for small python guessing game Question: menu = { "1": "start_game()" "2": "player_stats()" "3": "high_scores()" "0": "exit_game()" } So let’s say if user inputs 1 in menu screen, I want to call start_game() function, I know there is other way to do this but just interested in this …

Total answers: 1

Pygame segmentation fault: issue with classing and recursion?

Pygame segmentation fault: issue with classing and recursion? Question: The error is: Fatal Python error: (pygame parachute) Segmentation Fault Aborted (core dumped) On a different machine there is an output about max recursion depth. There are a few places where recursion could be occurring. There is a pygame while event loop that is called within …

Total answers: 1

Spyder 3.0 won't let me run file

Spyder 3.0 won't let me run file Question: Spyder 3.0, Windows 10 64-bit Hello everyone, I used to be able to write code and run the files in Spyder without a problem but now the button to run the code is greyed out and I can’t run the file. Not even using F5 or clicking …

Total answers: 4

Hide or removing a menubar of tkinter in python

Hide or removing a menubar of tkinter in python Question: I can set my menu with the following instruction: my_tk.config(menu=my_menu_bar) But, How do I remove it or hide it completely? my_tk.config(menu=None) doesn’t work 🙁 Asked By: Cabu || Source Answers: Is this what you’re looking for: from tkinter import * root = Tk() menubar = …

Total answers: 3

Keyboard shortcuts with tkinter in Python 3

Keyboard shortcuts with tkinter in Python 3 Question: I’ve created a menubar in Python 3, and I’m wondering how to add keyboard shortcuts and accelerators to it. Like hitting “F” for File Menu and whatnot. Through some digging around I found the “underline=” attribute, but it doesn’t seem to work in Python 3. It didn’t …

Total answers: 2