I have the following pattern:
databasename = "mydatabase"
import databasefunctions
and in databasefunctions I have the following method.
def checkStatusOfDatabase(database=databasename):
I however get an error saying: NameError: name 'databasename' is not defined on the line defining checkStatusOfDatabase.
I could of course just move the definition of databasename inside the databasefunctions module, but that would not be suitable in my design. How else can I achieve that the databasename defined in the main module is utilized as the default in any imported modules.