Hi! I am still working at the network code… well, here is the stuff
Edit: Well, I have tried several things, but I am stuck again… Why does the following happen?
bigfoot29@Gamer:~/pandachat$ ppython test.py
test.py:14: SyntaxWarning: name 'USERS' is assigned to before global declaration
def choking(self):
enumerate is already present in __builtin__
Warning: DirectNotify: category 'Interval' already exists
outside choking: {'local1': 'mypass1'}
initialized
inside working: {'local1': 'mypass1'}
After Choking: {'local1': 'mypass2'}
Here is the according Code:
from direct.gui.DirectGui import *
USERS = {
'local1' : 'mypass1'
}
class Server(DirectObject):
def __init__(self):
print 'initialized'
def working(self):
print 'inside working: ',USERS
def choking(self):
USERS = {'local1' : 'mypass2'}
global USERS
print 'outside choking: ',USERS
serverHandler = Server()
serverHandler.working()
serverHandler.choking()
print 'After Choking: ',USERS
I have defined USERS at the very start, but Python doesn’t seem to mind Where is my problem?
Regards, Bigfoot29