当前位置:网站首页>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边栏推荐
- Anaconda navigator click open no response, can not start error prompt attributeerror: 'STR' object has no attribute 'get‘
- Import CV2 prompt importerror: libgl so. 1: Cannot open shared object file: no such file or directory
- 行测--资料分析--fb--高照老师
- [software testing] 03 -- overview of software testing
- Now there are HTML files and MVC made with vs (connected to the database). How can they be connected?
- 公安专业知识--哔哩桐老师
- Using GEE plug-in in QGIS
- 目标检测系列——Faster R-CNN原理详解
- M2DGR 多源多场景 地面机器人SLAM数据集
- And let's play dynamic proxy (extreme depth version)
猜你喜欢

How to deal with excessive memory occupation of idea and Google browser

【Node】nvm 版本管理工具

CADD course learning (5) -- Construction of chemosynthesis structure with known target (ChemDraw)

Microservice registry Nacos introduction

QT small case "addition calculator"

Ethtool principle introduction and troubleshooting ideas for network card packet loss (with ethtool source code download)

(tool use) how to make the system automatically match and associate to database fields by importing MySQL from idea and writing SQL statements

Hdu1232 unimpeded project (and collection)

Play with grpc - go deep into concepts and principles

Altimeter data knowledge point 2
随机推荐
[vscode] search using regular expressions
DelayQueue延迟队列的使用和场景
Ugnx12.0 initialization crash, initialization error (-15)
UE5热更新-远端服务器自动下载和版本检测(SimpleHotUpdate)
NPM and package common commands
The problem of configuring opencv in qt5.13.2 is solved in detail
GBK error in web page Chinese display (print, etc.), solution
Target detection series - detailed explanation of the principle of fast r-cnn
Use of Pai platform
Binary search (half search)
行测--资料分析--fb--高照老师
SD_ CMD_ SEND_ SHIFT_ REGISTER
PostMessage communication
[tf1] save and load parameters
Unforgettable summary of 2021
Rough notes of C language (1)
Basic series of SHEL script (II) syntax + operation + judgment
What if the DataGrid cannot see the table after connecting to the database
ImportError: No module named ‘Tkinter‘
Database SQL practice 3. Find the current salary details of the current leaders of each department and their corresponding department number Dept_ no