I have some code that goes like this:
from multiprocessing import Process
def foo():
while True:
f=input('Input: ')
print('Why doesn't this print?')
if __name__=='__main__':
p1 = Process(target=bruh)
print('this prints')
p1.start()
print('and so does this')
But when ran, I recieve this error:
Traceback (most recent call last):
File "C:\Program Files (x86)\Python38-32\lib\multiprocessing\process.py", line 315, in _bootstrap
self.run()
File "C:\Program Files (x86)\Python38-32\lib\multiprocessing\process.py", line 108, in run
self._target(*self._args, **self._kwargs)
File "C:\Users\(myUsername)\Desktop\program.py", line 739, in foo
f=input('still running')
EOFError: EOF when reading a line
I belive this is because the process ended when it reached the input function, causing it to give an end of field error, but I don't know. Please Help!
(using python 3.8.3)