[Python-bugs-list] [ python-Bugs-699068 ] Error using Tkinter embeded in C++

SourceForge.net noreply@sourceforge.net
Sat, 15 Mar 2003 05:38:08 -0800


Bugs item #699068, was opened at 2003-03-07 00:15
You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=105470&aid=699068&group_id=5470

Category: Tkinter
Group: Python 2.2
Status: Open
Resolution: None
Priority: 5
Submitted By: John (johnnoone)
Assigned to: Nobody/Anonymous (nobody)
Summary: Error using Tkinter embeded in C++

Initial Comment:
Using Python 2.2.2 on MS Windows 2000 platform. 
Calling embedded Python from Visual C++ works fine 
until I add a call to Tkinter (version 8.3). Follow the 
example in section 5.3 at the following link:
http://www.python.org/doc/ext/extending-with-
embedding.html
Link call.cpp as is and add a line to multiply.py to 
create a Tkinter frame:
"fr = Tkinter.Tk()"   // added import for Tkinter too!
Yields the following error messages:

C:\Python22\c\vcpp\hello3>hello3 call multiply 2 3
Thy shall add 2 times 3
Traceback (most recent call last):
  File "C:\Python22\c\vcpp\hello3\call.py", line 7, in 
multiply
    fr = Tk()
  File "C:\Python22\lib\lib-tk\Tkinter.py", line 1491, in 
__init__
    baseName = os.path.basename(sys.argv[0])
AttributeError: 'module' object has no attribute 'argv'
Call failed

Is there a problem using Tkinter from C++? Python/Tk 
work fine standalone.





----------------------------------------------------------------------

>Comment By: Martin v. Löwis (loewis)
Date: 2003-03-15 14:38

Message:
Logged In: YES 
user_id=21627

Please look at the source of sysmodule.c. sys.argv is only
present if PySys_SetArgv is invoked.

----------------------------------------------------------------------

You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=105470&aid=699068&group_id=5470