I’m looking to import all the classes from one Python file to the other?
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
In the class you wish to import from, include a variable called
__all__, and fill it with the names of the classes/variables you want.In the class you wish to import them to, you may use the asterisk to gain access to all of the classes.
As suggested, be careful of name collisions when doing this.