Imports
Importing variables/functions without executing the code
Note: You cannot import c
into file2
since the if __name__ == __main__
block is only executed when you run the Python program DIRECTLY. So technically, when you do imports, c
is not even defined.
Importing Functions that Contain Global Variables
Global variable in the file where the functions lives is what the variable will be defined as
Last updated
Was this helpful?