You're importing the general_functions
module, but at that point, main.py
doesn't know about its contents (or better said, doesn't load its contents into the main
module). You could do:
from general_functions import make, bake
or the (in my opinion, better practice):
import general_functions
...
class baking(object):
def __init__(self, ...):
muffin = 'chocolate muffin'
general_functions.make(muffin)
general_functions.bake(200)
You can check this great thread: How does Python importing exactly work? about how import
works in Python, and this other one: Local import statements in Python about import scopes.