Reputation: 13
self.file_opt=options={}
options['defaultextension']='.txt'
options['filetypes']=[('text files','.txt')]
options=['initialdir']=['home/var/www/']
options=['initialfile']='sampl1.py'
options['parent']=root
options['title']='This is a title'
In the above code i get error on following..
options=['initialdir']=['home/var/www/']
options=['initialfile']='sampl1.py'
syntax error- Can't assign to literal
Don't know why it is happening.. Any help?
Upvotes: 0
Views: 283
Reputation: 369394
You can't assigned to a literal (['x']
is a list literal):
>>> ['x'] = [1]
File "<stdin>", line 1
SyntaxError: can't assign to literal
Remove =
in the following lines:
options=['initialdir']=['home/var/www/']
options=['initialfile']='sampl1.py'
# ^
Upvotes: 1