I have info.py file in directory A
info.py has this code:
main.py has this code:
but if I instanciate the Person class in the same directory A or copy the country.py to the main.py directory it will work fine
How can I make the import of country work as I'm calling Person class in main.py that is in another directory?
the code here is just for explanation purpose only.
Your answers is highly appreciated in advance!
info.py has this code:
import country # country is imported from the same directory A class Person: def get_city(self): return country.state()Then i have a main.py that is not in directory A
main.py has this code:
from A.info import Person person_instance = Person() print(person_instance.get_city())Then I will get module country not found error,
but if I instanciate the Person class in the same directory A or copy the country.py to the main.py directory it will work fine
How can I make the import of country work as I'm calling Person class in main.py that is in another directory?
the code here is just for explanation purpose only.
Your answers is highly appreciated in advance!