from multiprocessing import Process
import os
-sharp
def run_proc(name):
print("")
if __name__=="__main__":
print("Parent process %s." % os.getpid())
p = Process(target=run_proc, args=("test",))
print("Child process will start.")
p.start()
p.join()
print("Child process end.")
python
Processpycharm
multiprocessing:
there is no Process.py file, so how does python execute the code without reporting an error?
I think python is very difficult. I used to use Java,Java as long as it imported the path of the package. If eclipse reports red, it will definitely report an error. But in the face of the python, editor, it has become popular, but there is no problem in running it. I am so confused.
all the multiple processes I found on the Internet about python, the first sentence is from multiprocessing import Process,. Hasn"t anyone encountered the problem of Process popularity? Or did you use a smarter python editor than IDE like pycharm?