PyRun_SimpleString no sys.argv[0]

iwl Ingo.Wolf at gmx.de
Wed Dec 6 10:23:50 EST 2006


Hello,

I'm just starting with Python - would like to embed it in my
windows-programm as an script-processor. For tests I use easygui some
easy-wrapper for the py-tck-stuff.

 PyRun_SimpleString("from easygui import *\n");
 PyRun_SimpleString("import sys\n");
 PyRun_SimpleString("msgbox()\n");

Traceback (most recent call last):
  File "<string>", line 1, in <module>
  File "easygui.py", line 148, in msgbox
    reply = buttonbox(message, title, choices)
  File "easygui.py", line 170, in buttonbox
    root = Tk()
  File "C:\Python\Python25\Lib\lib-tk\Tkinter.py", line 1631, in
__init__
    baseName = os.path.basename(sys.argv[0])
AttributeError: 'module' object has no attribute 'argv'

May bee makes some sence that the embedded Interpreter has no argv[0],
however tk seems not to bee ready for that.
I try to define some sys.argv[0] myself after I get out how to do that,
maybee someone other has an better idea until than.




More information about the Python-list mailing list