event-handling

Kivy app not detecting touch events when using cv.VideoCapture()

Kivy app not detecting touch events when using cv.VideoCapture() Question: I am working on a Kivy app. At some point, the user will have to touch the screen to indicate where the corners of a tennis court are. I want to take the coordinates of this touch, and create a ROI. I did this using …

Total answers: 1

Python – Mock/trigger file creation event while monitoring it in same script/thread?

Python – Mock/trigger file creation event while monitoring it in same script/thread? Question: I’m writing a test script and use below function detect_event_and_get_json_data() to monitor for newly Json created event/s in a json_path and parse these data for checking. But the problem is: inside this while loop for waiting Json event/s, is there any way …

Total answers: 1

tkinter callback event to retrieve value from Entry and write to text file

tkinter callback event to retrieve value from Entry and write to text file Question: *First of all, i am trying to create a register system saved into textfile(not real system, i know its not safe to write into textfiles) Created the GUI and then i defined multiple functions which is Menu, register and submit. Submit …

Total answers: 1

Why has the tkinter key-event <Tab> a higher priority than the tkinter key-event <key>?

Why has the tkinter key-event <Tab> a higher priority than the tkinter key-event <key>? Question: I am writing an editor (using the tkinter text widget), which replaces tab-characters (inserted by the user) on the fly by 4 blanks. The replacement is done by a binding to the tabulator-key-event ("Tab"), which inserts 4 blanks and returns …

Total answers: 1

How to call function when space key is pressed inside the lineEdit

How to call function when space key is pressed inside the lineEdit Question: I want to call a function that checks words count in a lineEdit whenever I press space key inside the lineEdit. But how can I do that. After executing the python file press ‘Start Game’ to go to the lineEdit. Thanks! Here’s …

Total answers: 1

Turtle graphics – screen updates with tracer not working as expected

Turtle graphics – screen updates with tracer not working as expected Question: I’m trying to put in scheduled refreshes for a pong game, so the screen updates after a time interval so the paddles (which I have segmented) move in sync on the screen. What is the functional difference between these two blocks of code? …

Total answers: 1

ModX in event.state in tkinter?

ModX in event.state in tkinter? Question: I’ve been figuring out how to parse tkinter events via event.state to reduce the number of times that I have to call root.bind() (e.g., I can avoid binding both "<ButtonPress-1>" and "<Shift-ButtonPress-1>" by finding if shift was pressed via event.state). Of course, I’ve relied heavily on the tkinter source …

Total answers: 1

Python Equivalent of VB6 DoEvents

Python Equivalent of VB6 DoEvents Question: Is there Python equivalent of VB6 DoEvents statement where the handler will temporarily pass to the OS? I found similar code in http://code.activestate.com/recipes/496767-set-process-priority-in-windows/ def setpriority(pid=None,priority=1): “”” Set The Priority of a Windows Process. Priority is a value between 0-5 where 2 is normal priority. Default sets the priority of …

Total answers: 2

Calling one method from another within same class in Python

Calling one method from another within same class in Python Question: I am very new to python. I was trying to pass value from one method to another within the class. I searched about the issue but i could not get proper solution. Because in my code, “if” is calling class’s method “on_any_event” that in …

Total answers: 1