file1
from file3 import helper_func # a function
from file3 import fixed_var # a constant (type string)
def new_func(id):
url = fixed_var + f'_and_{id}'
output = helper_func(url)
return output
file2 attempt1
from file1 import new_func
new_func('words')
TypeError: unsupported operand type(s) for +: 'NoneType' and 'str'
file2 attempt2
from file3 import helper_func # a function
from file3 import fixed_var # a constant
from file1 import new_func
new_func('words')
TypeError: unsupported operand type(s) for +: 'NoneType' and 'str'
The error is thrown both times for the line url = f'{fixed_var}_{id}'
. fixed_var
is None
in both attempt1 and attempt2. Presumably, even if i were to get past this line, the next line would throw an error along the lines of cannot find function helper_func
.
How can I import new_func
from file1 into file2 and use?
Thanks.