Skip to main content

All Questions

Tagged with
1 vote
0 answers
350 views

How to get the index of a data point when the cursor clicks on it?

I have a scatter plot and I want to get the initial index of the data sample when clicked on it. fig, ax = plt.subplots() sc = plt.scatter(features[:, 0], features[:, 1], c=labels) On an on-click ...
Berkay Berabi's user avatar
0 votes
2 answers
813 views

Receiving data in python callback function from dll

I am writing a program in Python that communicates with a spectrometer from Avantes. There are some proprietary dlls available whose code I don't access to, but they have some decent documentation. I ...
Guilherme B.M.'s user avatar
0 votes
1 answer
474 views

How to draw free and horizontal lines using mouse events and flags?

I try to build a code, in which I can draw lines above the image using OpenCV. In my code, I can draw lines freely, but I want draw horizontal lines, while I'm pressing the shift key. Actually, I didn'...
Yong Hwan Kim's user avatar
0 votes
2 answers
3k views

Best practice in sending message in python telegram bot from a 3d party listener

I have a custom code that does its routine and I want to send a message to myself in Telegram if something goes wrong. In my case I use python-telegram-bot library along with apscheduler and its ...
Good Pen's user avatar
1 vote
3 answers
3k views

Registering a function to be called on an event in Python

I want to write a function that will be called after an event occurred but only if the user has registered it. e.g. #Defination def fnBookUber(objUser): print 'Inside fbBookUber()' #calling ...
Iqra.'s user avatar
  • 733
0 votes
0 answers
354 views

How to emit a PyQt-signal out of a cffi-callback

I am a bit stuck right now. This is more of a "how to approach this problem the right way" kind of question since I dont even know what exactly to type into google. I got a scientific camera from ...
user3183627's user avatar
0 votes
0 answers
228 views

Python Matplotlib Buttons widgets and SpanSelector events

I am trying to write a program that switches between signals by clicking "previous" and "next" button, and at the same time gives the possibility to select and save part of the plot. This is what I ...
Stefania R's user avatar
0 votes
1 answer
31 views

What's the right approach to manually adding a callback to an existing module method?

For example... There are several methods that I'd like to treat as 'events', and fire my own functions once they've been called. I do not manually invoke these. As someone that's not well-versed ...
Donkey's user avatar
  • 1
0 votes
1 answer
60 views

Python/Tkinker Combobox event not launching [duplicate]

I'm pulling my hair out and sure I'll be embarrassed by how simple my mistake is. I have created a Combobox which is supposed to launch a function each time is it selected. However nothing happens ...
Tom's user avatar
  • 1,043
0 votes
1 answer
128 views

wxpython: How to influence wx objects from another wx object's callback function?

I'm coding a small GUI at the moment and wanted to know how I could influence wxpython widgets' states from within another's callback function. At the moment, I can't influence widgets from my ...
Ampig's user avatar
  • 209
1 vote
2 answers
587 views

Gaining access to events in tkinter between objects

In this sample python/tkinter script I have 3 classes. My first class SandBox sets up a notebook with two tabs, each tab is a separate class object. This script is not a real world script I'm ...
user1904898's user avatar
2 votes
2 answers
10k views

Event callback after a Tkinter Entry widget

From the first answer here: StackOverflow #6548837 I can call callback when the user is typing: from Tkinter import * def callback(sv): print sv.get() root = Tk() sv = StringVar() sv.trace("w"...
aless80's user avatar
  • 3,290
0 votes
1 answer
195 views

How do I pause a script in python to keep 2 sensors from being detected at same time?

I have this function in a python script that detects 2 vibrations sensors, the problem is the sensors are very sensitive so usually when one is hit they are both detected which gives me a false ...
Ryan D's user avatar
  • 751
1 vote
2 answers
3k views

Bind callback to the object instance

I'd like to bind a class method to the object instance so that when the method is invoke as callback it can still access the object instance. I am using an event emitter to generate and fire events. ...
Giuseppe Pes's user avatar
  • 7,862
0 votes
0 answers
764 views

Python keyboard event callback

I want some of my class functions to be called when a some keyboard keys are pressed, no matter which window is active. how to do that in LINUX. What I was using until now is OpenCV and waitKey() ...
Mehdi's user avatar
  • 1,486

15 30 50 per page