I've been wondering, if using multiple subfiles in a project to make the code look clean, why I have to import each module e.g. logging or time in each subfile explicitly. is there no way to make the subfile.py aware of the imports of main.py. See an example below where I want to use import time globally
main.py
import logging
import time
from subfile import myfunc
myfunc("Test")
subfile.py
import logging
def myfunc(var):
logging.info("entered myfunc")
time.sleep(2)
logging.info("Variable: {}".format(var))