How do you get an imported function to find a function in the main program? This runs fine if I put the generate_random function in with the main, but if it is in an imported function it can't find the printa function in the main. It comes up with the error "NameError: global name 'printa' is not defined". How do I define it?
#-------------------------------------------------------------------------------
# Name: main_module
#------------------------------------------------------------------------------
from submodule import *
num_values = ["zero","one","two","three","four","five","six","seven"]
def printa(valuea):
print (num_values[valuea])
generate_random()
#-------------------------------------------------------------------------------
# Name: submodule.py
printa(a)
#-------------------------------------------------------------------------------
from random import randint
def generate_random():
a = randint(0,4)