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

SourceForge.net noreply at sourceforge.net
Fri Nov 12 03:18:00 CET 2004


Bugs item #699068, was opened at 2003-03-06 20:15
Message generated for change (Comment added) made by facundobatista
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: Facundo Batista (facundobatista)
Date: 2004-11-11 23:18

Message:
Logged In: YES 
user_id=752496

Please, could you verify if this problem persists in Python 2.3.4
or 2.4?

If yes, in which version? Can you provide a test case?

If the problem is solved, from which version?

Note that if you fail to answer in one month, I'll close this bug
as "Won't fix".

Thank you! 

.    Facundo

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

Comment By: Martin v. Löwis (loewis)
Date: 2003-03-15 10: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


More information about the Python-bugs-list mailing list