At Wednesday 6/12/2006 12:23, iwl wrote:

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.

Looks a bit strange for me. If the GUI will be in Python, I think you could do things the other way, *extending* your main Python program with your own C code, not *embedding* Python inside your main C program.
I'm not sure if Tk can run without a mainloop.

Anyway, to answer your actual question:

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.

From the Python/C API Reference Manual, section "Embedding Python" (that I hope you have already read): Py_Initialize() does not set the ``script argument list'' (sys.argv). If this variable is needed by Python code that will be executed later, it must be set explicitly with a call to PySys_SetArgv(argc, argv) subsequent to the call to Py_Initialize().


--
Gabriel Genellina
Softlab SRL
__________________________________________________
Correo Yahoo!
Espacio para todos tus mensajes, antivirus y antispam ¡gratis! ¡Abrí tu cuenta ya! - http://correo.yahoo.com.ar
-- 
http://mail.python.org/mailman/listinfo/python-list

Reply via email to