You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have to distinguish them from the main execution, through the code:
if __name__ == '__main__':
...
If I run this script from command line (running Python.exe), the __name__ is different for each process. When I run it through the py::exec, the __name__ is always __main__. How can I overcome this issue? Thanks.
The text was updated successfully, but these errors were encountered:
Hey, i'm bumping into this same issue, is there any fix yet? Is it possible to manuelly set the __name__upon creation of the CHild Process within the python process called through pybind? @Skylion007@rwgk
Hey, i'm bumping into this same issue, is there any fix yet? Is it possible to manuelly set the __name__upon creation of the CHild Process within the python process called through pybind? @Skylion007@rwgk
Could someone please send a PR with a test (that fails)? — That will be the best starting point, to fully define what the problem is, and to try out fixes.
I have a code that use the multiprocessing module to spawn new processes like this:
I have to distinguish them from the main execution, through the code:
If I run this script from command line (running Python.exe), the
__name__
is different for each process. When I run it through the py::exec, the__name__
is always__main__
. How can I overcome this issue? Thanks.The text was updated successfully, but these errors were encountered: