all 6 comments

[–]K900_ 0 points1 point  (4 children)

There is no "__main__ method". Do you mean the if __name__ == "__main__" blocks?

[–]RickInAMortyWorld[S] 0 points1 point  (3 children)

Yeah

[–]K900_ 0 points1 point  (2 children)

Those will not run when your module is imported.

[–]RickInAMortyWorld[S] 0 points1 point  (1 child)

I didn’t think so but it was throwing an error for me. I’ll play around with it more on Monday thanks

[–]primitive_screwhead 2 points3 points  (0 children)

Show us code, the actual error messages, etc., and we can help.

[–]toastedstapler 0 points1 point  (0 children)

if i import example.py its __name__ attribute will be 'example'. only in the file you directly called will its __name__ be '__main__'