Hello. I've been trying out some basic multiprocessing method, to share variables between 2 python script.
They are in Python 2.7, run on Raspberry Pi 3B
However, the output shows exactly nothing, even though its the same code as the tutorial.
import multiprocessing
def is_even(numbers, q):
for n in numbers:
if n % 2 == 0:
q.put(n)
if __name__ == "__main__":
q = multiprocessing.Queue()
p = multiprocessing.Process(target=is_even, args=(range(20), q))
p.start()
p.join()
while q:
print(q.get())
What is even the problem?
Is this code working for you?
Any idea?
Thanks in advance
Tutorial in question https://code.tutsplus.com/tutorials/introduction-to-multiprocessing-in-python--cms-30281
Tested it out on my server, works as expected.
https://files.facepunch.com/forum/upload/109818/960427bf-0e68-4df1-9cdb-b459523c34e1/putty_2018-08-09_20-38-19.png
Tested on both my Intel Atom server and a Raspberry Pi 3B. Could be something weird with your Raspbian installation.
Ok thats weird..
Can you try to execute the acript from the. 'run' option on Python app window instead of console command?
Ok, other people has tested, and it works in their computers. Probably something's wrong with mine
Tbh. I am kinda amazed by your persistance and resilience. Keep working on your stuff my dude, I really enjoy watching your progress through your help threads.
Sorry, you need to Log In to post a reply to this thread.