Sep-30-2019, 10:43 AM
(Sep-30-2019, 10:38 AM)wpo Wrote: In f1 I did not assing a value to "a" because I want the function to use the global variable defined in "main". But even including the required "glbal" statements in the right places does not make the "a" from "main" availble in "f1".
Not, when I copy the contents of the "import" module into the "main" function and remove the "import" statement, it functions!
As I said, the functions in testglobalsextimport.py could not possibly "know" about variables in other mnodules (unless you import them, but in this case you will create circular import).
If you can't explain it to a six year old, you don't understand it yourself, Albert Einstein
How to Ask Questions The Smart Way: link and another link
Create MCV example
Debug small programs
How to Ask Questions The Smart Way: link and another link
Create MCV example
Debug small programs