Calling one method from another within same class in Python

To call the method, you need to qualify function with self.. In addition to that, if you want to pass a filename, add a filename parameter (or other name you want). class MyHandler(FileSystemEventHandler): def on_any_event(self, event): srcpath = event.src_path print (srcpath, ‘has been ‘,event.event_type) print (datetime.datetime.now()) filename = srcpath[12:] self.dropbox_fn(filename) # <—- def dropbox_fn(self, filename): … Read more

Simplest way for PyQT Threading

You should use the built in QThread provided by Qt. You can place your file monitoring code inside a worker class that inherits from QObject so that it can use the Qt Signal/Slot system to pass messages between threads. class FileMonitor(QObject): image_signal = QtCore.pyqtSignal(str) @QtCore.pyqtSlot() def monitor_images(self): # I’m guessing this is an infinite while … Read more