I'm working on a program where for the sake of keeping it organized, I have a main script, call it main.py, then each of my sub scripts in their various files, call them extra1.py and extra2.py
My main script looks like this...
#!/usr/bin/env python
import extra1
import extra2
If I want to access something from extra1 I can do so by pre-appending "extra1.". This is great, but what if I want to access something in main.py from extra1.py? For example, say in main.py, I have some global variables, how would I access those in extra1.py or extra2.py?
And is it possible for extra1.py to access anything from extra2.py? I've been treating this a lot like PHP's include(), but I'm starting to see that was an incorrect assumption.