Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- def zzz():
- x= None
- code= '''
- for x in (1, 3, 6, 9 ,12) :
- self.ui.lineEdit_xmah.setEnabled(True)
- '''
- con={}
- con["x"]= x
- exec(code, con)
- ==error :
- Traceback (most recent call last):
- File "/home/alireza/WorkspaceAptanaS/test-pyqt-project/s.py", line 67, in chBoxSer_status
- zzz()
- File "/home/alireza/WorkspaceAptanaS/test-pyqt-project/s.py", line 37, in zzz
- exec(code, con)
- File "<string>", line 3, in <module>
- NameError: name 'self' is not defined
- ===== OR
- def zzz():
- x= None
- code= '''
- for x in (1, 3, 6, 9 ,12) :
- self.ui.lineEdit_xmah.setEnabled(True)
- '''
- con={}
- con["x"]= x
- exec(code, con)
- ==error :
- Traceback (most recent call last):
- File "/home/alireza/WorkspaceAptanaS/test-pyqt-project/s.py", line 67, in chBoxSer_status
- zzz()
- File "/home/alireza/WorkspaceAptanaS/test-pyqt-project/s.py", line 37, in zzz
- exec(code, con)
- File "<string>", line 3, in <module>
- NameError: name 'self' is not defined
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement