当前位置:网站首页>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边栏推荐
- HDU1231 最大连续子序列(分治or动规or双指针)
- HDU1232 畅通工程(并查集)
- C#学习笔记
- The SQL implementation has multiple records with the same ID, and the latest one is taken
- list. files: List the Files in a Directory/Folder
- 行测--资料分析--fb--高照老师
- How can Oracle SQL statements modify fields that are not allowed to be null to allow nulls?
- Intelligent target detection 59 -- detailed explanation of pytoch focal loss and its implementation in yolov4
- 2022年PMP项目管理考试敏捷知识点(7)
- R language learning notes 1
猜你喜欢

Intelligent target detection 59 -- detailed explanation of pytoch focal loss and its implementation in yolov4

Self summary of college life - freshman

Set theory of Discrete Mathematics (I)

Machine learning Seaborn visualization

Concurrent programming - deadlock troubleshooting and handling

Import CV2 prompt importerror: libgl so. 1: Cannot open shared object file: no such file or directory

DataGrid offline installation of database driver

Unforgettable summary of 2021

大学生活的自我总结-大一

Delayqueue usage and scenarios of delay queue
随机推荐
What if the DataGrid cannot see the table after connecting to the database
With the help of Navicat for MySQL software, the data of a database table in different or the same database link is copied to another database table
The problem of configuring opencv in qt5.13.2 is solved in detail
Hdu1231 maximum continuous subsequence (divide and conquer or dynamic gauge or double pointer)
[software testing] 02 -- software defect management
Chapter 2: try to implement a simple bean container
HDU1232 畅通工程(并查集)
Cookie operation
golang定时器使用踩的坑:定时器每天执行一次
GPIO port bit based on Cortex-M3 and M4 with operation macro definition (can be used for bus input and output, STM32, aducm4050, etc.)
借助 Navicat for MySQL 软件 把 不同或者相同数据库链接中的某数据库表数据 复制到 另一个数据库表中
Idea common settings
Unforgettable summary of 2021
Jenkins reported an error. Illegal character: '\ufeff'. Class, interface or enum are required
Web page Chinese display (print, etc.) GBK error, solution, software
C learning notes
Play with grpc - go deep into concepts and principles
Anaconda pyhton multi version switching
Import CV2 prompt importerror: libgl so. 1: Cannot open shared object file: no such file or directory
U-boot initialization and workflow analysis