当前位置:网站首页>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边栏推荐
- 2022 PMP project management examination agile knowledge points (7)
- Delayqueue usage and scenarios of delay queue
- How can Oracle SQL statements modify fields that are not allowed to be null to allow nulls?
- Microservice registry Nacos introduction
- Idea push project to code cloud
- Oracle code use
- Course learning accumulation ppt
- 第 2 章:小试牛刀,实现一个简单的Bean容器
- The SQL implementation has multiple records with the same ID, and the latest one is taken
- SOC_ SD_ CMD_ FSM
猜你喜欢

Idea common settings

Set theory of Discrete Mathematics (I)

Miracast技术详解(一):Wi-Fi Display

剑指 Offer 56 数组中数字出现的次数(异或)

Anaconda navigator click open no response, can not start error prompt attributeerror: 'STR' object has no attribute 'get‘

arcgis_ spatialjoin

SOC_ SD_ DATA_ FSM

Ue5 hot update - remote server automatic download and version detection (simplehotupdate)
![[idea] efficient plug-in save actions to improve your work efficiency](/img/6e/49037333964865d9900ddf5698f7e6.jpg)
[idea] efficient plug-in save actions to improve your work efficiency

Machine learning Seaborn visualization
随机推荐
行测--资料分析--fb--高照老师
What does soda ash do?
611. Number of effective triangles
[software testing] 05 -- principles of software testing
Daily Practice:Codeforces Round #794 (Div. 2)(A~D)
QT small case "addition calculator"
C#学习笔记
ImportError: No module named ‘Tkinter‘
Simple use of timeunit
R language learning notes 1
The number of occurrences of numbers in the offer 56 array (XOR)
Ggplot2 drawing learning notes in R
Ugnx12.0 initialization crash, initialization error (-15)
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
Professional knowledge of public security -- teacher bilitong
The SQL implementation has multiple records with the same ID, and the latest one is taken
Microservice registry Nacos introduction
【idea】Could not autowire. No beans of xxx type found
Graduation thesis project local deployment practice
Simple operation with independent keys (hey, a little fancy) (keil5)