After doing research on this site and others, I create the topic. I have created a module like :
module.py
def function(var1, var2):
...
return(var3)
And the main code is :
main.py :
import module
var4 = module.function(a, b)
When i launch the main file in IDLE, I have the following error :
NameError: name 'function' is not defined
I have also tried : main.py :
from module import function
var4 = function(a, b)
And got a module has no attribute 'function'
Does someone have an idea of what's wrong ? When I tried to import constants from the same module I had this kind of error as well