当前位置:网站首页>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边栏推荐
- PostMessage communication
- CADD课程学习(6)-- 获得已有的虚拟化合物库(Drugbank、ZINC)
- String alignment method, self use, synthesis, newrlcjust
- How to modify the file path of Jupiter notebook under miniconda
- Database SQL practice 3. Find the current salary details of the current leaders of each department and their corresponding department number Dept_ no
- Idea push project to code cloud
- What is soda?
- What is sodium hydroxide?
- Brief description of inux camera (Mipi interface)
- Binary search (half search)
猜你喜欢

Explanation of parallel search set theory and code implementation

行测--资料分析--fb--高照老师

Ugnx12.0 initialization crash, initialization error (-15)

SOC_ SD_ CMD_ FSM

2022 PMP project management examination agile knowledge points (7)

How to modify the file path of Jupiter notebook under miniconda

Concurrent programming - deadlock troubleshooting and handling

I 用c I 实现队列

Pytorch has been installed in anaconda, and pycharm normally runs code, but vs code displays no module named 'torch‘
![[node] NVM version management tool](/img/26/f13a2451c2f177a86bcb2920936468.png)
[node] NVM version management tool
随机推荐
How to deal with excessive memory occupation of idea and Google browser
Qu'est - ce que l'hydroxyde de sodium?
2022.06.27_ One question per day
Microservice registry Nacos introduction
Simple use of timeunit
The problem of configuring opencv in qt5.13.2 is solved in detail
[software testing] 02 -- software defect management
Jenkins reported an error. Illegal character: '\ufeff'. Class, interface or enum are required
Machine learning Seaborn visualization
第 2 章:小试牛刀,实现一个简单的Bean容器
And let's play dynamic proxy (extreme depth version)
(top) pretty girl binary color code portal
repo. conda. An example of COM path error
String alignment method, self use, synthesis, newrlcjust
(tool use) how to make the system automatically match and associate to database fields by importing MySQL from idea and writing SQL statements
M2DGR 多源多场景 地面机器人SLAM数据集
Concurrent programming - deadlock troubleshooting and handling
How to delete the virus of inserting USB flash disk copy of shortcut to
D2L installation
Solve tensorfow GPU modulenotfounderror: no module named 'tensorflow_ core. estimator‘