On Mon, Feb 22, 2021 at 5:01 PM gayatri funde <fundegaya...@gmail.com> wrote:
> I have 2 files mainModule.py and loggingModule.py files as below:
> In loggingModule.py file i am managing new log to create , which i am 
> importing to mainModule.py file.
>
> def child_Process(var1):
>     while True:
>         time.sleep(10)
>         logging.info('Log from Child Process')
>
> if __name__ == "__main__":
>     var1 = "LotsOfSunshine"
>     time.sleep(1)
>     logging.info("Log from Main process")
>
>     child_Multiprocess = multiprocessing.Process(target=child_Process, 
> args=(var1,))
>     child_Multiprocess.start()
>

When you spawn a subprocess, its variables are completely separate
from the parent. I suspect that you'll do far FAR better with
threading here, rather than trying to share things across processes.

ChrisA
-- 
https://mail.python.org/mailman/listinfo/python-list

Reply via email to