Best Practices for Python Main Functions
You’ll learn about four best practices you can use to make sure that your code can serve a dual purpose:
1. Put most code into a function or class.
2. Use __name__ to control execution of your code.
3. Create a function called main() to contain the code you want to run.
4. Call other functions from main().
Click here to learn more: https://realpython.com/courses/python-main-function/
Видео Best Practices for Python Main Functions канала Real Python
1. Put most code into a function or class.
2. Use __name__ to control execution of your code.
3. Create a function called main() to contain the code you want to run.
4. Call other functions from main().
Click here to learn more: https://realpython.com/courses/python-main-function/
Видео Best Practices for Python Main Functions канала Real Python
Показать
Комментарии отсутствуют
Информация о видео
Другие видео канала
Python Tutorial: if __name__ == '__main__'Everything you need to know about Classes in Python! (Object Oriented Programming Tutorial)5 Things You're Doing Wrong When Programming in PythonTransforming Code into Beautiful, Idiomatic Python11 Tips And Tricks To Write Better Python CodeOptional Arguments in Python With *args and **kwargsUncle Bob's SOLID principles made easy 🍀 - in Python!An Introduction to Software Design - With PythonWhy COMPOSITION is better than INHERITANCE - detailed Python examplePython HOW TO structure a Beginner OR Advanced Projects ?Python Functions | Python Tutorial for Absolute Beginners #1Python Object Oriented Programming (OOP) - For Beginners7 Python Code Smells: Olfactory Offenses To Avoid At All Costs10 Python Tips and Tricks For Writing Better CodeBeautiful Python RefactoringMastering Python - Everything You Need To Know To Become a Python MasterPython OOP Tutorial 1: Classes and InstancesPython Threading Tutorial: Run Code Concurrently Using the Threading ModuleString Conversion in Python: When to Use __repr__ vs __str__