I have a main.py file and a file called classes.py
main.py contains the application and what happens, while class.py contains some classes.
main.py has the following code
main.py
import classes
def addItem(text):
print text
myClass = classes.ExampleClass()
And then we have classes.py
classes.py
class ExampleClass (object):
def __init__(self):
addItem('bob')
Surprisingly, itβs not the actual code that I use, because I removed everything that may prevent you from seeing what I want to do. I want to be able to call the method defined in main.py from a class in .py classes. How to do it?
Thank you in advance
source
share