Class super separated files - Python Help - Discussions on Python.org
Class super separated files Python Help Pejamide (Pejamide) March 24, 2021, 9:18am 1 One class file with ‘ class Parent ’ and ‘class Child(Parent)’ on the child root folder works fine, but two separated class files (the one with ‘ class Parent ’ on the child folder and the other on the different child folder ‘class Child(Parent)’ do not work. How to solve it, while the main program is on the root folder.
Is it clean enough? Maroloccio (Marco Ippolito) March 24, 2021, 9:34am 2 One class file with ‘ class Parent ’ and ‘class Child(Parent)’ on the child root folder works fine, but two separated class files (the one with ‘ class Parent ’ on the child folder and the other on the different child folder ‘class Child(Parent)’ do not work. How to solve it, while the main program is on the root folder. Is it clean enough?
The classes need to be able to “find” each other through imports. Quote: Python code in one module gains access to the code in another module by the process of importing it. Source: Look at the sample file layouts there.