<div dir="ltr">Thank you Phill.<div><br></div><div>This fixed my issue.</div><div><br></div><div>Thanks a lot for the help.</div></div><div class="gmail_extra"><br><br><div class="gmail_quote">On 30 April 2014 17:31, Phil Thompson <span dir="ltr"><<a href="mailto:phil@riverbankcomputing.com" target="_blank">phil@riverbankcomputing.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div class="">On 30/04/2014 4:09 pm, Christoff Kok wrote:<br>
</div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div class="">
Hi,<br>
<br>
I apologize if I am using the mailing system wrong, please correct me<br>
if I do. 1st time user of such a channel.<br>
<br>
I trying to learn SIP and came across an issue when trying to<br>
implement the example code given in the documentation.<br>
//////////////////////////////<u></u>///<br>
%Module word<br>
<br>
%TypeHeaderCode<br>
#include "word.h"<br>
#include <string.h><br>
%End<br>
<br>
public:<br>
Word(const char *w);<br>
char *reverse() const;<br>
};<br>
//////////////////////////////<u></u>///<br>
<br>
After successfully running the deploying it in python, I tried to<br>
create a Word variable: e.g.<br>
<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
from word import Word<br>
w = Word("cheese snacks")<br>
</blockquote></blockquote></blockquote></div>
# PYTHON THROWS AN ERROR HERE:<div class=""><br>
<br>
Traceback (most recent call last):<br>
File "<stdin>", line 1, in <module><br>
TypeError: Word(): arguments did not match any overloaded call:<br>
overload 1: too many arguments<br>
overload 2: argument 1 has unexpected type 'str'<br></div>
# HELP(WORD) INFORMS ME THAT WORD IS EXPECTING A SIP.WRAPPER OBJECT,<br>
NOT A STRING AS I EXPECTED<br>
</blockquote>
<br>
No. What it's saying is that the super-class of Word is sip.wrapper.<div class=""><br>
<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
help(Word)<br>
</blockquote></blockquote></blockquote>
Help on class Word in module word:<br>
<br>
class Word(sip.wrapper)<br>
...<br>
<br>
This was not expected, I expected it to just work as the example<br>
given. Any help? I am working on Windows 7 in python 3.3.4<br>
I tried including MappedType char * but received the error: "Invalid<br>
type for %MappedType"<br>
</blockquote>
<br></div>
You need to consider the encoding, see...<br>
<br>
<a href="http://pyqt.sourceforge.net/Docs/sip4/annotations.html#argument-annotation-Encoding" target="_blank">http://pyqt.sourceforge.net/<u></u>Docs/sip4/annotations.html#<u></u>argument-annotation-Encoding</a><br>
<br>
Phil<br>
______________________________<u></u>_________________<br>
PyQt mailing list <a href="mailto:PyQt@riverbankcomputing.com" target="_blank">PyQt@riverbankcomputing.com</a><br>
<a href="http://www.riverbankcomputing.com/mailman/listinfo/pyqt" target="_blank">http://www.riverbankcomputing.<u></u>com/mailman/listinfo/pyqt</a></blockquote></div><br><br clear="all"><div><br></div>-- <br><span style="color:rgb(51,51,51);font-family:verdana,geneva,lucida,'lucida grande',arial,helvetica,sans-serif;font-size:14.44444465637207px;background-color:rgb(255,255,255)">Christoff Kok</span><br style="color:rgb(51,51,51);font-family:verdana,geneva,lucida,'lucida grande',arial,helvetica,sans-serif;font-size:14.44444465637207px;background-color:rgb(255,255,255)">
<span style="color:rgb(51,51,51);font-family:verdana,geneva,lucida,'lucida grande',arial,helvetica,sans-serif;font-size:14.44444465637207px;background-color:rgb(255,255,255)">Software Engineer</span><br style="color:rgb(51,51,51);font-family:verdana,geneva,lucida,'lucida grande',arial,helvetica,sans-serif;font-size:14.44444465637207px;background-color:rgb(255,255,255)">
<span style="color:rgb(51,51,51);font-family:verdana,geneva,lucida,'lucida grande',arial,helvetica,sans-serif;font-size:14.44444465637207px;background-color:rgb(255,255,255)">Ex Mente</span><br style="color:rgb(51,51,51);font-family:verdana,geneva,lucida,'lucida grande',arial,helvetica,sans-serif;font-size:14.44444465637207px;background-color:rgb(255,255,255)">
<br style="color:rgb(51,51,51);font-family:verdana,geneva,lucida,'lucida grande',arial,helvetica,sans-serif;font-size:14.44444465637207px;background-color:rgb(255,255,255)"><a href="http://www.ex-mente.co.za/" style="color:rgb(0,0,0);text-decoration:none;outline:none;font-family:verdana,geneva,lucida,'lucida grande',arial,helvetica,sans-serif;font-size:14.44444465637207px;background-color:rgb(255,255,255)" target="_blank">http://www.ex-mente.co.za</a><br style="color:rgb(51,51,51);font-family:verdana,geneva,lucida,'lucida grande',arial,helvetica,sans-serif;font-size:14.44444465637207px;background-color:rgb(255,255,255)">
<a href="mailto:christoff.kok@ex-mente.co.za" style="color:rgb(0,0,0);text-decoration:none;outline:none;font-family:verdana,geneva,lucida,'lucida grande',arial,helvetica,sans-serif;font-size:14.44444465637207px;background-color:rgb(255,255,255)" target="_blank">christoff.kok@ex-mente.co.za</a><span style="color:rgb(51,51,51);font-family:verdana,geneva,lucida,'lucida grande',arial,helvetica,sans-serif;font-size:14.44444465637207px;background-color:rgb(255,255,255)"> </span><br style="color:rgb(51,51,51);font-family:verdana,geneva,lucida,'lucida grande',arial,helvetica,sans-serif;font-size:14.44444465637207px;background-color:rgb(255,255,255)">
<span style="color:rgb(51,51,51);font-family:verdana,geneva,lucida,'lucida grande',arial,helvetica,sans-serif;font-size:14.44444465637207px;background-color:rgb(255,255,255)">PO Box 10214 </span><br style="color:rgb(51,51,51);font-family:verdana,geneva,lucida,'lucida grande',arial,helvetica,sans-serif;font-size:14.44444465637207px;background-color:rgb(255,255,255)">
<span style="color:rgb(51,51,51);font-family:verdana,geneva,lucida,'lucida grande',arial,helvetica,sans-serif;font-size:14.44444465637207px;background-color:rgb(255,255,255)">Centurion </span><br style="color:rgb(51,51,51);font-family:verdana,geneva,lucida,'lucida grande',arial,helvetica,sans-serif;font-size:14.44444465637207px;background-color:rgb(255,255,255)">
<span style="color:rgb(51,51,51);font-family:verdana,geneva,lucida,'lucida grande',arial,helvetica,sans-serif;font-size:14.44444465637207px;background-color:rgb(255,255,255)">0046 </span><br style="color:rgb(51,51,51);font-family:verdana,geneva,lucida,'lucida grande',arial,helvetica,sans-serif;font-size:14.44444465637207px;background-color:rgb(255,255,255)">
<span style="color:rgb(51,51,51);font-family:verdana,geneva,lucida,'lucida grande',arial,helvetica,sans-serif;font-size:14.44444465637207px;background-color:rgb(255,255,255)">South Africa </span><br style="color:rgb(51,51,51);font-family:verdana,geneva,lucida,'lucida grande',arial,helvetica,sans-serif;font-size:14.44444465637207px;background-color:rgb(255,255,255)">
<span style="color:rgb(51,51,51);font-family:verdana,geneva,lucida,'lucida grande',arial,helvetica,sans-serif;font-size:14.44444465637207px;background-color:rgb(255,255,255)">tel: +27 12 743 6993 </span><br style="color:rgb(51,51,51);font-family:verdana,geneva,lucida,'lucida grande',arial,helvetica,sans-serif;font-size:14.44444465637207px;background-color:rgb(255,255,255)">
<span style="color:rgb(51,51,51);font-family:verdana,geneva,lucida,'lucida grande',arial,helvetica,sans-serif;font-size:14.44444465637207px;background-color:rgb(255,255,255)">tel: +27 12 654 8198</span><br style="color:rgb(51,51,51);font-family:verdana,geneva,lucida,'lucida grande',arial,helvetica,sans-serif;font-size:14.44444465637207px;background-color:rgb(255,255,255)">
<span style="color:rgb(51,51,51);font-family:verdana,geneva,lucida,'lucida grande',arial,helvetica,sans-serif;font-size:14.44444465637207px;background-color:rgb(255,255,255)">fax: +27 85 150 1341</span>
</div>