Home > other >  God help me quickly see ah, so hurry
God help me quickly see ah, so hurry

Time:03-16

How to solve this? I am running under Windows, make a mistake,,,,,,,

The import multiprocessing
The import time

Sing #

Def sing () :
For I in range (3) :
Print (" singing ")
Time. Sleep (1)


# dance
Def dance () :
For I in range (3) :
Print (" dance ")
Time. Sleep (1)
If __name__=="__main__ ':

Class # 2. Use the process to create process object
Var=multiprocessing. Process (target=sing)
Ded=multiprocessing. Process (target=dance)
Var. The start ()
Ded. Start ()


Traceback (the most recent call last) :
The File "D:/pythonProject/123/hm_34_ use multiple processes implement multitasking. Py", line 24, in & lt; module>
Sing_process=multiprocessing. Process (target=sing)
TypeError: 'module' object is not callable

CodePudding user response:

The process==& gt; Process

CodePudding user response:

Thank you, thank you very much

CodePudding user response:

This is not a multi-process?
  • Related