state

PYTHON – How to change data entry state to normal?

PYTHON – How to change data entry state to normal? Question: I can disable the calendar widget with the ‘Disable’ button, but if I want to reactivate it, I get the following error: tkinter.TclError: unknown option "-normal" If i try to use the calendar.config(state="normal") command, I get the following error: tkinter.TclError: unknown option "-state" import …

Total answers: 1

Smooth Movement with pygame states

Smooth Movement with pygame states Question: I’m currently working on a project, which basically is creating the pokemon game with pygame. To do so, I adapted an online code that consisted on game states (https://python-forum.io/Thread-PyGame-Creating-a-state-machine) I created a game state where the user will move the sprite with wads keys, the problem is that, although …

Total answers: 1

Preserving global state in a flask application

Preserving global state in a flask application Question: I am trying to save a cache dictionary in my flask application. As far as I understand it, the Application Context, in particular the flask.g object should be used for this. Setup: import flask as f app = f.Flask(__name__) Now if I do: with app.app_context(): f.g.foo = …

Total answers: 3

How to change Tkinter Button state from disabled to normal?

How to change Tkinter Button state from disabled to normal? Question: I need to change the state of a Button from DISABLED to NORMAL when some event occurs. The button is currently created in the DISABLED state using the following code: self.x = Button(self.dialog, text="Download", state=DISABLED, command=self.download).pack(side=LEFT) How can I change the state to NORMAL? …

Total answers: 3