<div dir="ltr">Hi Tim:<div><br></div><div>I just fixed the issue by applying your advise. But (...and here comes a big BUT !!!), why do I have to do this when calling tkinter inside a COM server, meanwhile this is not necessarily when outside a COM?  If my COM Server were using tkinter directly I could rely on this trick.  However, my originally problem came up by trying to use pyplot from Matplotlib.  I found that pyplot.figure()  launches a tk instance.  Therefore, in order to use this library (and any other that uses tkinter) within COMs, I must modify the source codes.  It doesn't seem this to be a feasible solution.  Is there any other solution?</div><div><br></div><div>Best regards,</div><div class="gmail_extra"><br><div class="gmail_quote">2015-05-18 12:26 GMT-05:00 Tim Roberts <span dir="ltr"><<a href="mailto:timr@probo.com" target="_blank">timr@probo.com</a>></span>:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"><span class="">Diego Vélez Torres wrote:<br>
> Hi:<br>
><br>
> I'm having issues with tkinter, COM servers and Python 3.4.   I can't<br>
> call tkinter inside a COM server.   I tried many examples of tkinter,<br>
> but every time I try to init a tkniter instance (  tk = tkinter.Tk()<br>
>  )  inside a running COM server, the same following error arises:<br>
><br>
</span><span class="">>  tk = Tk()<br>
>   File "C:\Python34\Lib\tkinter\__init__.py", line 1851, in __init__<br>
</span>>     <a href="http://self.tk" target="_blank">self.tk</a> <<a href="http://self.tk" target="_blank">http://self.tk</a>> = _tkinter.create(screenName, baseName,<br>
<span class="">> className, interactive, wantobjects, useTk, sync, use)<br>
> TypeError: must be str, not bytes<br>
<br>
</span>Interesting.  The signature in the source code requires screenName,<br>
baseName, className, and use to be strings, but only screenName and use<br>
are optional.  className is not actually used -- the source overrides<br>
it.  As an experiment, can you change your code to this:<br>
    tk = Tk( baseName='xxx' )<br>
and see what happens?<br>
<span class=""><font color="#888888"><br>
--<br>
Tim Roberts, <a href="mailto:timr@probo.com">timr@probo.com</a><br>
Providenza & Boekelheide, Inc.<br>
<br>
_______________________________________________<br>
python-win32 mailing list<br>
<a href="mailto:python-win32@python.org">python-win32@python.org</a><br>
<a href="https://mail.python.org/mailman/listinfo/python-win32" target="_blank">https://mail.python.org/mailman/listinfo/python-win32</a><br>
</font></span></blockquote></div><br><br clear="all"><div><br></div>-- <br><div class="gmail_signature">Diego Vélez Torres<br><a href="mailto:divelez69@gmail.com" target="_blank">divelez69@gmail.com</a><br>Teléfono: 098 28 57 58<br>Cuenca, Ecuador<br></div>
</div></div>