[Idle-dev] How to open IDLE with embedded python from another application

暮如雪 snowyfox at 163.com
Wed Sep 24 08:19:34 CEST 2014


hi, All:


    I am using embedded python in an MFC application, I need the embedded python interpreter to do some calculation, and now, I want it to do more, I need to open the python editor, like what can be done from IDLE GUI, where you can open FileList.py under libs\idle\ sub folder in you python installation path, and execute the module to open a new editor window, but when I try to run that file in my embedded python, it just give some error message, as the following:


 Warning: configHandler.py - IdleConf.GetOption -
 problem retrieving configuration option 'name'
 from section 'Theme'.
 returning default value: ''


 Warning: configHandler.py - IdleConf.GetOption -
 problem retrieving configuration option 'width'
 from section 'EditorWindow'.
 returning default value: None


 Warning: configHandler.py - IdleConf.GetOption -
 problem retrieving configuration option 'height'
 from section 'EditorWindow'.
 returning default value: None


 Warning: configHandler.py - IdleConf.GetOption -
 problem retrieving configuration option 'font-bold'
 from section 'EditorWindow'.
 returning default value: None


 Warning: configHandler.py - IdleConf.GetOption -
 problem retrieving configuration option 'font'
 from section 'EditorWindow'.
 returning default value: None


 Warning: configHandler.py - IdleConf.GetOption -
 problem retrieving configuration option 'font-size'
 from section 'EditorWindow'.
 returning default value: None
Traceback (most recent call last):
  File "K:\Python335\Lib\idlelib\FileList.py", line 129, in <module>
    _test()
  File "K:\Python335\Lib\idlelib\FileList.py", line 124, in _test
    flist.new()
  File "K:\Python335\Lib\idlelib\FileList.py", line 49, in new
    return self.EditorWindow(self, filename)
  File "Lib/idlelib\EditorWindow.py", line 233, in __init__
    fontWeight))
  File "Lib/tkinter\__init__.py", line 1270, in configure
  File "Lib/tkinter\__init__.py", line 1261, in _configure
_tkinter.TclError: expected integer but got "None"


    I can create dialog with tkinter, and add control on the dialog, can anyone tell what's wrong, am I using it incorrectly?

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/idle-dev/attachments/20140924/d5894f3d/attachment.html>


More information about the IDLE-dev mailing list