I have a 2 Python scripts that contain the following lines: test.py ------- from testmod import * a1 = 10 modfunc() testmod.py ----------- def modfunc(): print a1 When I run test.py, it returns the following error: File "testmod.py", line 2, in modfunc print a1 NameError: global name 'a1' is not defined My intent is to make a1 a global variable - so that I can access its value in all functions of imported modules. What should I do? Thanks in advance, Rohit
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4