I have two files in the same directory, A module has a function that is continously running and has no way to stop or pause in between,
# script.py
def run():
i = 0
while True:
print('\r', i, '\r', end='')
i += 1
Then there is a custom made debugger module which captures if the directory has been updated,
# debugger.py
import os
import wait
from multiprocessing import Process, Queue
def capture_change(processesQueue):
prev = os.path.getsize('wait.py')
while True:
curr = os.path.getsize('wait.py')
if curr != prev:
print('Changes Detected!!')
process = processesQueue.get()
process.kill()
process.start()
processesQueue.put(process)
prev = curr
if __name__ == "__main__":
processesQueue = Queue()
p1 = Process(target= wait.run)
processesQueue.put(p1)
p2 = Process(target= capture_change, args= (processesQueue, ))
p1.start()
p2.start()
I am getting this error,
raise TypeError(
TypeError: Pickling an AuthenticationString object is disallowed for security reasons
What should I do? I have searched alot but all the ways for data sharing among other processes are not allowing Process instance itself to be shared among them. Is there any other way around??