Python multiprocessing questions, Python process memory sharing, Python DLL, Python library sharing, Python initialization sharing

Asked 2 years ago, Updated 2 years ago, 18 views

Hello.

I'm going to use the Python code to use multiprocessing Every time I created another process, I imported and initialized libraries separately, which slowed me down.

How can other processes share the parts that import and initialize functions?

Is there anyone who solved the related problem?

python

2022-09-22 13:33

1 Answers

my_imports.Write py like this.

import example1, example2
__all__ = ['example1', 'example2']

Try this in another file, other_file.py~

from my_imports import *
print example1.~~~

It can be stated in this way

from my_imports import example1, example2


2022-09-22 13:33

If you have any answers or tips


© 2024 OneMinuteCode. All rights reserved.