- Trending Categories
- Data Structure
- Operating System
- C Programming
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
How many Python classes should I put in one file?
Python code is organized in files called "modules" and groups of related modules called “packages".
A module is a distinct unit that may have one or more closely-related classes. Modules need to be imported before they are read, used, maintained and extended if needed. So a module is a unit or reuse.
The rule is this: a module is the unit of reuse. Everything in Python libraries and other Python applications is either a module or a package of modules.
There is no limit on how many classes one can put in a file or a module. It all depends on how big or small the project is and how long or short the classes are. It is a matter of convenience and efficient and productive organization.
- How can I make one Python file run another?
- Where should I put <script> tags in HTML markup?
- How do I put a jQuery code in an external .js file?
- One-to-Many or Many-to-One Relationship in DBMS
- How to put two public classes in a Java package.
- When should a Put Option be exercised?
- Program to find out how many boxes can be put into the godown in Python
- How can I source a Python file from another Python file?
- How do I copy a file in python?
- How many types of anonymous inner classes are defined in Java?
- PHP string cast vs strval function, which one should I use?
- File Handling through C++ Classes
- One-to-Many Relationship Model