current position：Home>Can I access UI components in Python multi process?
Can I access UI components in Python multi process?
2022-02-02 21:46:56 【CSDN Q & A】
I tried to access... In the process pool UI Component to modify , Like this ,ui Is the object created . The error information is below . The process pool can access UI Components ？
func = partial(self.to_main, ui) with ProcessPool(processes= 8) as pool: res = pool.map(func, path_list)
File "E:\PycharmProjects\test.py", line 30, in tomain res = pool.map(func, DB_path_list) File "D:\Program Files (x86)\Python\Python37\lib\multiprocessing\pool.py", line 268, in map return self._map_async(func, iterable, mapstar, chunksize).get() File "D:\Program Files (x86)\Python\Python37\lib\multiprocessing\pool.py", line 657, in get raise self._value File "D:\Program Files (x86)\Python\Python37\lib\multiprocessing\pool.py", line 431, in _handle_tasks put(task) File "D:\Program Files (x86)\Python\Python37\lib\multiprocessing\connection.py", line 206, in send self._send_bytes(_ForkingPickler.dumps(obj)) File "D:\Program Files (x86)\Python\Python37\lib\multiprocessing\reduction.py", line 51, in dumps cls(buf, protocol).dump(obj)TypeError: can't pickle mywindow objectsBackend TkAgg is interactive backend. Turning interactive mode on.
Refer to the answer 1：
Multithreaded access UI You need to use delegation
I don't know if multiple processes work
Refer to the answer 2：
author[CSDN Q & A],Please bring the original link to reprint, thank you.
The sidebar is recommended
- *PTR is a value and a is a pointer. How can they be equal? Shouldn't it be * PTR = & A?
- Specify local time to run code?
- Why is a < B short circuited?
- Usually in face recognition, what operations do we need to do (such as division)? How many times does each operation need to be done? What is the data specification of the operation?
- Firefox browser of win10 system is not connected to the Internet
- Must JNA load DLL be an absolute path? The relative path will report an error every time it is loaded lang.UnsatisfiedLinkError
- Server error in '/ CMS parameters' application.
- The MAC installs windows virtual machine and QT reports an error
- On string array as function parameter
- How to figure out HTML5
guess what you like
What is the specific idea to realize the comment function
The number of occurrences of certain fields in SQL query
Programming with eclipse Java
Get function usage, how to use, high adoption rate
MNIST dataset with KNN algorithm
The so-called palindrome number is the same number from left to right and from right to left. For example, 121 is a palindrome number. Write a program to find the number of palindromes that can be divided by 3 in the range of 100-m. (can anyone see where
Solve the problem of binding this point in anti chattering throttling
Find the factorial of 0-5 by function
JSP get the current URL parameter
Why does this program time out?
- Why did you output more
- Text file problem output new file
- Guess numbers and write programs in C + +
- For the field of int type set, when 0 is entered, the database is null and empty
- Design a mathutils Java class file
- The problem of C language do while loop
- Using random class, randomly generate five integers between 1 and 100, add the generated random integers to a list set, and then calculate the sum of all numbers in the set
- Python pyecharts draws a line chart, and the line breaks randomly
- When the ie11 browser fetches local files, it gets stuck for about 1 minute. How can I solve it?
- How can we understand the data structure and algorithm?
- It is said that the new project given by the company can run before. Now I run and report this error, and I don't know why to add the GIT of the configuration file. Can you help me have a look
- Import data into the database and analyze it
- In vue3 setup, the data change of the object cannot be observed by the watch, and the reason is unknown
- Single chip microcomputer four digit nixie tube rolling display 0-F
- The applet customizes the slider slider and makes the number in decimal form
- How to solve the problem that the time caused by VPN is not the same as the system time?
- Is there anyone to answer
- 2. If there are multiple catches in a program segment, which of the following conditions will the program execute?
- Why delete an element in the set and return 1 Σ (っ ° Д °;) っ？
- GetElementsByTagName ('li ') whether to obtain Li elements of the same level or all Li elements in it
- Why is the time complexity of nested while loops in for still o (n)
- Spring cannot load the context. What's the problem
- What's the problem, please
- C language reading program, why 5? Seek explanation
- How can the Java background distinguish the clients of different users when the company has the same LAN
- Batch import needs to be added in the system
- I can't even paste it a little
- The input value is incorrect. There are two inputs, but only one can be entered
- Why judge whether the triangle is wrong and how to write it.
- How to solve the hidden bug of fluent Web text overflow overflow
- C sharp mouse penetration
- Idea uses el and JSTL expressions respectively, which are written in JSP files and display blank space on the web. What's the problem.
- H3C help me, you fool. I really didn't attend class
- What's the problem with not running at all
- How to open with sqlyog Enterprise Edition MDF and LDF files. SQL Server2008 is not used in class teaching
- C language and application file programming program
- What does the code in Android XML mean? Please have a look
- The branch jump instruction in risc-v requires several branch delay slots
- No change with non singleton labels? What's wrong