Skip to content

if __name__ == "__main__": not working. #275

Closed Answered by falkoschindler
jpj73ak asked this question in Q&A
Discussion options

You must be logged in to vote

This has been discussed here #181 and here #252.

A workaround is to use

if __name__ in {"__main__", "__mp_main__"}:

or simply no main guard at all as in the examples.

Besides that we are still looking for a solution to either support a regular main guard or at least to improve the error message.

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by falkoschindler
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants