当前位置:网站首页>Process (P) runs, and idle is different from pycharm
Process (P) runs, and idle is different from pycharm
2022-07-05 07:29:00 【work-harder】
background :
win8.1, python idle 3.9.7, pycharm 2021.3.1
The phenomenon :
process (p) Code to run after creation , stay idle China and pycharm Different .
terms of settlement :
pycharm Sub processes can be called in : p.start() and p.run() Fine
#idle in , only p.run() Can call the subprocess ,p.start() no way .
[ to update ] idle in , p.run() Will execute sub processes print sentence , but p.start() Not execute print sentence . If there is time.sleep() sentence ,p.start() Will perform time.sleep() sentence .
[ to update ] use vs code ( My is 1.64.2) Can be fully demonstrated p.join() and p.join(timeout) The role of
Example
from multiprocessing import Process
from time import sleep # to update
def run_test():
print("...run_test Start ...") # to update
sleep(10) # to update
print("...run_test end ...") # to update
if __name__ == "__main__":
print(" Main process in progress ")
#p = Process(target=run_test()) # No call required p.run()
p = Process(target=run_test)
#p.start() # Only in pycharm Can be called run_test
p.run() # stay pycharm (2021.3.1) and idle(python3.9.7 Bring their own ) You can call run_test
边栏推荐
- Basic knowledge of public security -- FB
- repo. conda. An example of COM path error
- Efficiency difference: the add method used by the set directly and the add method used by the set after judgment
- ORACLE CREATE SEQUENCE,ALTER SEQUENCE,DROP SEQUENCE
- What if the DataGrid cannot see the table after connecting to the database
- [software testing] 05 -- principles of software testing
- R language learning notes 1
- Simple operation of running water lamp (keil5)
- ImportError: No module named ‘Tkinter‘
- 行测--资料分析--fb--高照老师
猜你喜欢
DelayQueue延迟队列的使用和场景
[software testing] 04 -- software testing and software development
Delayqueue usage and scenarios of delay queue
Intelligent target detection 59 -- detailed explanation of pytoch focal loss and its implementation in yolov4
Pytorch has been installed in anaconda, and pycharm normally runs code, but vs code displays no module named 'torch‘
Brief description of inux camera (Mipi interface)
CADD课程学习(5)-- 构建靶点已知的化合结构(ChemDraw)
[vscode] prohibit the pylance plug-in from automatically adding import
CADD课程学习(6)-- 获得已有的虚拟化合物库(Drugbank、ZINC)
Ethtool principle introduction and troubleshooting ideas for network card packet loss (with ethtool source code download)
随机推荐
[vscode] search using regular expressions
(tool use) how to make the system automatically match and associate to database fields by importing MySQL from idea and writing SQL statements
The number of occurrences of numbers in the offer 56 array (XOR)
Do you choose pandas or SQL for the top 1 of data analysis in your mind?
Machine learning Seaborn visualization
Install deeptools in CONDA mode
Simple operation of nixie tube (keil5)
Efficiency difference: the add method used by the set directly and the add method used by the set after judgment
QT small case "addition calculator"
DataGrid offline installation of database driver
Play with grpc - go deep into concepts and principles
The difference between NPM install -g/-save/-save-dev
Typescript get timestamp
Light up the running light, rough notes for beginners (1)
2022.06.27_每日一题
Set theory of Discrete Mathematics (I)
Qu'est - ce que l'hydroxyde de sodium?
String alignment method, self use, synthesis, newrlcjust
Matrix keyboard scan (keil5)
CADD course learning (6) -- obtain the existing virtual compound library (drugbank, zinc)