
- Python Basic Tutorial
- Python - Home
- Python - Overview
- Python - Environment Setup
- Python - Basic Syntax
- Python - Comments
- Python - Variables
- Python - Data Types
- Python - Operators
- Python - Decision Making
- Python - Loops
- Python - Numbers
- Python - Strings
- Python - Lists
- Python - Tuples
- Python - Dictionary
- Python - Date & Time
- Python - Functions
- Python - Modules
- Python - Files I/O
- Python - Exceptions
What is the common header format of Python files?
This is how Python developers commonly organize their modules/python file −
The first line of each file shoud be #!/usr/bin/env python. This makes it possible to run the file as a script invoking the interpreter implicitly.
Next should be the docstring with a description.
All code, including import statements, should follow the docstring. Import built-in modules first, followed by third-party modules, followed by any changes to the path and your own modules.
- Related Articles
- What is Authentication Header (AH) format?
- Standard header files in C
- C++ Standard Library Header Files
- Why does C++ have header files and .cpp files?
- Explain the custom header files in C language
- Header files “stdio.h” and “stdlib.h” in C
- Add new header files in Arduino IDE
- How to share common data among multiple Python files?
- What is the TCP Segment Header?
- What is the maximum size of HTTP header values?
- Print “Hello World” in C/C++ without using header files
- What are the common uses of Python decorators?
- What is header() function in PHP?
- What is the common name of CaCO3?
- What is the common name of methanal?

Advertisements