events

matplotlib/seaborn get x (date) value on click (it's in a different scale)

matplotlib/seaborn get x (date) value on click (it's in a different scale) Question: I am able to generate events on clicks, but I have noticed the values are like 19000 when there is date data underneath. The y-value is correct. Setting up clicks: from matplotlib import pyplot import seaborn as sns import pandas as pd …

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

MediaPipe pose estimator with multiprocessing hangs on its process function

MediaPipe pose estimator with multiprocessing hangs on its process function Question: I am currently trying to implement MediaPipe pose estimator as an independent event-based process with Python’s multiprocessing library, but it hangs on the MediaPipe’s Pose.process() function. I input the frame with another process (readFrames). Whenever a frame is captured, it is written into a …

Total answers: 2

Python TK Notebook tab change check

Python TK Notebook tab change check Question: Newbie programmer here. I am building a tk based desktop app and ran into an issue: I have a main window with several stuff in it including two tabs: global nBook nBook = ttk.Notebook(self, name=”book”) nBook.place(x=300,y=400) frameOne = ttk.Frame(nBook, width=100, height=100) frameTwo = ttk.Frame(nBook, width=100, height=100) nBook.add(frameOne, text=’T1′) …

Total answers: 3

Tkinter event for DownPress of mouse button (holding down)?

Tkinter event for DownPress of mouse button (holding down)? Question: UPDATE: This seams to be a version issue. The event does not fire on click for python 3.6.1 but works on 2.7 that I have tested so far. UPDATE: Bryan’s answer did fix my problem with the event not working correctly however the issue of …

Total answers: 3

Capture all key-presses in PyQt

Capture all key-presses in PyQt Question: I am trying to capture all of key pressed in my program def keyPressEvent(self, event): event = event.key() if (event == QtCore.Qt.Key_Q): print (‘Q!.’) That function works fine when i am trying to capture keys in my window. (in this case Q_Key) But if the key was pressed in …

Total answers: 1

QUIT pygame event is not defined

QUIT pygame event is not defined Question: I have two for loops: for event in pygame.event.get(): if event.type == QUIT: pygame.quit() quit() if event.type == KEYDOWN: if event.key == K_p: banana = False sportscar = True for event in pygame.event.get: if event.type == QUIT: pygame.quit() quit() Whenever I run my code, I get this error: …

Total answers: 2