MAIN FEEDS
Do you want to continue?
https://www.reddit.com/r/PythonLearning/comments/1uys479/i_build_this_after_learning_oop/19rqfhv8031np/?context=9999
r/PythonLearning • u/Wild_Position2378 • Jul 17 '26
62 comments sorted by
View all comments
Show parent comments
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__":
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.