Xeash
03-22-2009, 08:59 PM
Hi,
I have scripted python file, test.py with code:
Skeleton={
'Name':'Main',
'Pos':(0,0),
'child_0':{
'Name':"001",
'Pos':(0,100),
'child_0':{
'Name':"002",
'Pos':(0,100),
},
'child_1':{
'Name':"003",
'Pos':(200,100),
},
},
};
I have python 2.5.1 installed on my PC/win XP system....
And when I try to run code in outer interpreter:
def loadFile(dirToFile):
f=open(dirToFile,'r')
data=f.read()
f.close()
return data
a=loadFile('g:\\test\\test.py')
exec(a)
...code works perfectly. 'Skeleton' dictionary is placed in globals() and so on.
BUT! I don't understand why if I use the same code in Maya 2009 it returns the syntax error:
# Error: ('invalid syntax', ('<string>', 1, 11, 'Skeleton={\r\n'))
# Traceback (most recent call last):
# File "<maya console>", line 2, in <module>
# File "<string>", line 1
# Skeleton={
#
# ^
# SyntaxError: invalid syntax
Why is that? I don't know where I am supposed to find problem 'root' even. Any advice?
Thanks anyway for listening :)
I have scripted python file, test.py with code:
Skeleton={
'Name':'Main',
'Pos':(0,0),
'child_0':{
'Name':"001",
'Pos':(0,100),
'child_0':{
'Name':"002",
'Pos':(0,100),
},
'child_1':{
'Name':"003",
'Pos':(200,100),
},
},
};
I have python 2.5.1 installed on my PC/win XP system....
And when I try to run code in outer interpreter:
def loadFile(dirToFile):
f=open(dirToFile,'r')
data=f.read()
f.close()
return data
a=loadFile('g:\\test\\test.py')
exec(a)
...code works perfectly. 'Skeleton' dictionary is placed in globals() and so on.
BUT! I don't understand why if I use the same code in Maya 2009 it returns the syntax error:
# Error: ('invalid syntax', ('<string>', 1, 11, 'Skeleton={\r\n'))
# Traceback (most recent call last):
# File "<maya console>", line 2, in <module>
# File "<string>", line 1
# Skeleton={
#
# ^
# SyntaxError: invalid syntax
Why is that? I don't know where I am supposed to find problem 'root' even. Any advice?
Thanks anyway for listening :)
