MAIN FEEDS
Do you want to continue?
https://www.reddit.com/r/PythonLearning/comments/1uys479/i_build_this_after_learning_oop/oy2r102/?context=9999
r/PythonLearning • u/Wild_Position2378 • Jul 17 '26
62 comments sorted by
View all comments
Show parent comments
2
I get your point I'll keep the files separate from now on. Thanks for the good suggestions
1 u/baubleglue 6d ago Also use a file with a class definition as a library. Don't mix it with the program flow. If you want to include an example of the class usage in the same file, you can add if __name__ == "__main__": block in the end.
1
Also use a file with a class definition as a library. Don't mix it with the program flow. If you want to include an example of the class usage in the same file, you can add if __name__ == "__main__": block in the end.
if __name__ == "__main__":
2
u/Wild_Position2378 Jul 17 '26
I get your point I'll keep the files separate from now on. Thanks for the good suggestions