python, global name not defined

171 views Asked by At

I put some helper functions in a separate file helper.py:

def funct1(data1):
    # doing something
    return data1

def funct2(data2):
    temp = funct1(data2) 
    # doing something
    return data2

I import this helper.py in another file, but got an error "global name funct1 is not defined"

import helper as hp

hp.funct2(somedata)
0

There are 0 answers