Ok so I have a new problem, and I cannot figure out how to fix it. I think I have tried pretty much everythign I can think of so I'm here to ask another newbie question.
If I have 3 simple files:
--data.py-----------
que = 0;
--------------------
--func.py--------------------
from data import *;
def addq():
global que;
que = que + 1;
print que;
------------------------------
--main.py--
from data import *;
from func import *;
que = que + 1;
print que;
addq();
addq();
--------------------------
When i ran "python main.py" I figured the output would be:
1
2
3
But instead it was:
1
1
2
So they are not accessing the same variable que. How do I make them all affect the same variable? Anyone know? Any reply is greatly appreciated.
If I have 3 simple files:
--data.py-----------
que = 0;
--------------------
--func.py--------------------
from data import *;
def addq():
global que;
que = que + 1;
print que;
------------------------------
--main.py--
from data import *;
from func import *;
que = que + 1;
print que;
addq();
addq();
--------------------------
When i ran "python main.py" I figured the output would be:
1
2
3
But instead it was:
1
1
2
So they are not accessing the same variable que. How do I make them all affect the same variable? Anyone know? Any reply is greatly appreciated.