FazBrowse GitHub Viewer
|
Trending
|
URL:
|
Home
Tools:
[Download Repo ZIP]
[View Raw Code]
[Original HTTPS Page]
PythonLearning/75.MultiprocessingInPythonPart3.py at Pythontuts · aditya0035/PythonLearning · GitHub
aditya0035
/
PythonLearning
Public
Notifications
You must be signed in to change notification settings
Fork
0
Star
0
Code
Issues
0
Pull requests
0
Actions
Projects
Security and quality
0
Insights
Additional navigation options
Code
Issues
Pull requests
Actions
Projects
Security and quality
Insights
Expand file tree
Breadcrumbs
PythonLearning
/
75.MultiprocessingInPythonPart3.py
Copy path
More file actions
More file actions
Latest commit
History
History
History
24 lines (22 loc) · 612 Bytes
Breadcrumbs
PythonLearning
/
75.MultiprocessingInPythonPart3.py
Copy path
File metadata and controls
24 lines (22 loc) · 612 Bytes
Raw
Copy raw file
Download raw file
Open symbols panel
Edit and raw actions
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
from
multiprocessing
import
Process
,
Manager
def
ask_user
():
user_input
=
input
(
"Enter Your Name"
)
greet
=
f'Hello
{
user_input
}
'
print
(
greet
)
def
Complex_Calculation
():
print
(
"Starting Calculation"
)
x
=
[
x
**
2
for
x
in
range
(
10000000
)]
print
(
"Ending Calculation"
)
return
x
if
__name__
==
"__main__"
:
result
=
{}
result
=
Manager
().
dict
()
process1
=
Process
(
target
=
Complex_Calculation
)
process2
=
Process
(
target
=
ask_user
)
x
=
process1
.
start
()
y
=
process2
.
start
()
process1
.
join
()
process2
.
join
()
print
(
x
)
print
(
y
)
print
(
result
)
Back
|
FazBrowse Home
|
New Git URL