I’m trying to have a timer going that I can use to update values in multiple windows with pyqt5. What I have so far, the main window opens with buttons to open the other windows, but when I press either button, it crashes. The number of threads is printed out. I have also tried putting in each AnotherWindow(2) init function,
Tag: python-multithreading
How to encapsulate an imported module into a method for multithreading in python?
I’m new in python and I have a concurrent problem when using internal functions of importing libraries. The problem is that my code calculates different kinds of variables and in the last process they are saved into different files. But I have the same problem when reading and writing. This is an example code that works because is linear: But
Threads not running in parallel for a system command
This is my script It appears that both starts are executed immediately. However, the sounds are not played in parallel but one after the other. When running the following shell script both sounds play at the same time. What makes Python run the commands sequentially instead of parallel? I’m using Big Sur with with the standard Python (2.7). Answer I
Python thread.join(timeout) not timing out
I am using threading python module. I want to execute a function which runs an expression entered by a user. I want to wait for it to finish execution or until a timeout period is reached. The following code should timeout after 5 second, but it never times out. Why is this and how can I fix this behaviour? Should
missing 1 required positional argument: ‘loop’
I am struggling with incorporating threading into my tkinter program. This program is basically a discord bot that you are able to start, restart and other various things through a gui application. I realised that i need to incorporate threading into my tkinter gui in order to be able to use different buttons in the gui as the bot is
Python Tkinter variable not updating in other thread
So I have a python script which accesses a website every minute, reads the page, and pings me if a certain data was placed on the website in that minute. I’m expanding this script to have a menu and a way to switch between different data points. The GUI and the script work well independently. However, the variable current_event_id does
Start and Stop threads with while loop
I’m building a tkinter GUI to retrieve incoming data from a device (through request) and appending them into a csv file, while having a preview of these data. I use thread but struggle to understand it properly, especially how to pause and restart it. When I click on the start button, my threads are working properly. Once I try to
threading.Thread.start() method execution time depends on the Thread target method
I am wondering why threading.Thread().start() method execution time is dependent on the Thread’s target method. I assumed that start() method just signalizes system that Thread can execute and does not do any processing. To illustrate this behavior: Results: Why threads start time differs for pass_target_function and calculate_target_function? Edit: Based on Steve’s answer individual thread start time is measured. Result match
asyncio: Wait for event from other thread
I’m designing an application in Python which should access a machine to perform some (lengthy) tasks. The asyncio module seems to be a good choice for everything that is network-related, but now I need to access the serial port for one specific component. I’ve implemented kind of an abstraction layer for the actual serial port stuff, but can’t figure out
What is the use of join() in threading?
I was studying the python threading and came across join(). The author told that if thread is in daemon mode then i need to use join() so that thread can finish itself before main thread terminates. but I have also seen him using t.join() even though t was not daemon example code is this i don’t know what is use