Sep-06-2020, 05:41 PM
Hey everyone,
I’m new to python for, but I have done a lot of php programming.
One feature I liked in php was include. I know Python has import, but that seems to only have a scope to each file it’s in. Is there anyway I can import modules, that will be active in all the other files I open.
For example,
Main.py
I’m new to python for, but I have done a lot of php programming.
One feature I liked in php was include. I know Python has import, but that seems to only have a scope to each file it’s in. Is there anyway I can import modules, that will be active in all the other files I open.
For example,
Main.py
Import a Import b print(x)File a.py
x = ‘hello world’File b.py
print (x)Output:
hello world hello world