Jan-03-2018, 09:52 AM
Hi,
So I have three files :
1.) File_INIT.py
The main file that will initialize (mostly) everything.
This file contains definitions for functions function_sub_A up to function_sub_B and so on...
2.) File_A.py
contains function FUNCTION_A
3.) File_B.py
contains function FUNCTION_B
This is roughly what File_INIT.py will look like :
I tried using global thetime within FUNCTION_B but that doesn't make any difference. I also tried that in File_INIT.py at the beginning but that also doesn't help. Any idea what I can do to get thetime to be detected in FUNCTION_B ?
So I have three files :
1.) File_INIT.py
The main file that will initialize (mostly) everything.
This file contains definitions for functions function_sub_A up to function_sub_B and so on...
2.) File_A.py
contains function FUNCTION_A
3.) File_B.py
contains function FUNCTION_B
This is roughly what File_INIT.py will look like :
#initialize variables and imports #... from File_A import FUNCTION_A from File_B import FUNCTION_B #... def function_sub_A(): #do something def function_sub_B(): #do something else def thetime(): #do something else #and so on FUNCTION_A() FUNCTION_B() #do somethingMy problem is now that I am using thetime inside FUNCTION_B but it tells me that global name 'thetime' is not defined.
I tried using global thetime within FUNCTION_B but that doesn't make any difference. I also tried that in File_INIT.py at the beginning but that also doesn't help. Any idea what I can do to get thetime to be detected in FUNCTION_B ?