Argaman Argaman - 1 year ago 185
Python Question

Python - EOF error while using multiprossecing and input

I'm trying to run a Python file, while using multiprossecing.

when I'm trying to use input on the same function I'm prossecing, it gives me EOF error, as follows:

Process PXB:
Traceback (most recent call last):
File "C:\Users\user\AppData\Local\Programs\Python\Python35-32\lib\multiprocessing\", line 254, in _bootstrap
File "C:\Users\user\AppData\Local\Programs\Python\Python35-32\lib\multiprocessing\", line 93, in run
self._target(*self._args, **self._kwargs)
File "C:\Users\user\PycharmProjects\PROJECT-XBIT\", line 56, in start
inputcode = input("Enter Passcode: ")
EOFError: EOF when reading a line

If you have any solution or maybe replacement for the multiprossing, that will still can count how much time the program will work, please explain how to use it, Thank you!

Answer Source

I think when you create a new process it gets its own standard input. If you use a thread instead it should be fine.

You can also just forget threads and processes and put a check on how much time has passed in the loop in the start function.

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download