events

How to receive automatic notifications about changes in tables?

How to receive automatic notifications about changes in tables? Question: What I am using: PostgreSQL and Python. I am using Python to access PostgreSQL What I need: Receive a automatic notification, on Python, if anyone records something on a specific table on database. I think that it is possible using a routine that go to …

Total answers: 3

Canceling events after the .after() method has been called on them?

Canceling events after the .after() method has been called on them? Question: I’m writing a little game with python tkinter module using a canvas widget. There is the person, who is just a ball, and bombs that spawn every 10 seconds. 3 seconds after a bomb spawns, it begins a process of “exploding” which I …

Total answers: 3

Turn off PyQt Event Loop While Editing Table

Turn off PyQt Event Loop While Editing Table Question: I’m developing a GUI with PyQt. The GUI has a qListWidget, a qTableWidget, and a plot implemented with Mayavi. The list refers to shapes that are plotted (cylinders and cones for example). When a shape is selected in the list, I want the shape’s properties to …

Total answers: 3

How can I fire a Traits static event notification on a List?

How can I fire a Traits static event notification on a List? Question: I am working through the traits presentation from PyCon 2010. At about 2:30:45 the presenter starts covering trait event notifications, which allow (among other things) the ability to automatically call a subroutine any time a trait has changed. I am running a …

Total answers: 2

Getting a callback when a Tkinter Listbox selection is changed?

Getting a callback when a Tkinter Listbox selection is changed? Question: There are a number of ways of getting callbacks when Text or Entry widgets are changed in Tkinter, but I haven’t found one for Listbox‘s (it doesn’t help that much of the event documentation I can find is old or incomplete). Is there some …

Total answers: 4

threading ignores KeyboardInterrupt exception

threading ignores KeyboardInterrupt exception Question: I’m running this simple code: import threading, time class reqthread(threading.Thread): def run(self): for i in range(0, 10): time.sleep(1) print(‘.’) try: thread = reqthread() thread.start() except (KeyboardInterrupt, SystemExit): print(‘n! Received keyboard interrupt, quitting threads.n’) But when I run it, it prints $ python prova.py . . ^C. . . . . …

Total answers: 5

"select" on multiple Python multiprocessing Queues?

"select" on multiple Python multiprocessing Queues? Question: What’s the best way to wait (without spinning) until something is available in either one of two (multiprocessing) Queues, where both reside on the same system? Asked By: cdleary || Source Answers: You could use something like the Observer pattern, wherein Queue subscribers are notified of state changes. …

Total answers: 9

Which Python packages offer a stand-alone event system?

Which Python packages offer a stand-alone event system? Question: I am aware of pydispatcher, but there must be other event-related packages around for Python. Which libraries are available? I’m not interested in event managers that are part of large frameworks, I’d rather use a small bare-bones solution that I can easily extend. Asked By: Josip …

Total answers: 16

How do you run your own code alongside Tkinter's event loop?

How do you run your own code alongside Tkinter's event loop? Question: My little brother is just getting into programming, and for his Science Fair project, he’s doing a simulation of a flock of birds in the sky. He’s gotten most of his code written, and it works nicely, but the birds need to move …

Total answers: 5