Код: Выделить всё
from multiprocess import Process
import time
def longSquare(num,results):
print('Check!')
time.sleep(1)
print(num**2)
time.sleep(1)
print('Check1')
p1=Process(target=longSquare, args=(1,results))
time.sleep(1)
print('Check2')
p2=Process(target=longSquare, args=(2,results))
p1.start()
p2.start()
p1.join()
p2.join()
Код: Выделить всё
line 3, in longSquare NameError: name 'time' is not defined. Did you forget to import 'time'?Код: Выделить всё
Check1Код: Выделить всё
Check2Подробнее здесь: https://stackoverflow.com/questions/792 ... r-notebook
Мобильная версия