Register forum user name Search FAQ

Gammon Forum

Notice: Any messages purporting to come from this site telling you that your password has expired, or that you need to verify your details, confirm your email, resolve issues, making threats, or asking for money, are spam. We do not email users with any such messages. If you have lost your password you can obtain a new one by using the password reset link.

Due to spam on this forum, all posts now need moderator approval.

 Entire forum ➜ MUSHclient ➜ Python ➜ OnPluginScreendraw error with python

OnPluginScreendraw error with python

It is now over 60 days since the last post. This thread is closed.     Refresh page


Posted by Ogomez92   (42 posts)  Bio
Date Tue 22 Dec 2009 01:24 PM (UTC)
Message
Hi.
Alright I'm trying to code a new screen reader implementation for mushClient in python, but every time the function OnPluginScreendraw is called I get a type mismatch error.
Even printing the line, printing hi, printing a number, every time its the same error.
I'll post the function here, its really short.
# world.AppendToNotepad("output", str(line)+"\r\n")
# if TTSReadNew:
# if (t==0) or (t==1):
# s.addText(str(line))
s.synthesize()
# s.synchronize()
As you can see, only using s.synthesize() which is uncommented I still get type mismatch and I sued synthesize before in other functions and it works fine.
If someone could tell me what I'm doing wrong here I'd really appreciate it.
Top

Posted by Nick Gammon   Australia  (23,165 posts)  Bio   Forum Administrator
Date Reply #1 on Tue 22 Dec 2009 06:26 PM (UTC)
Message
I seem to recall this problem is related to Python enforcing return codes. In other words, add:


return 0


at the end, or however you do it in Python to return a number to the calling function.

- Nick Gammon

www.gammon.com.au, www.mushclient.com
Top

Posted by Ogomez92   (42 posts)  Bio
Date Reply #2 on Wed 23 Dec 2009 10:47 PM (UTC)
Message
Hey thanks that worked perfectly. I shall soon be releasing the tts_eci plugin once I get rid of a few crash bugs.
Top

The dates and times for posts above are shown in Universal Co-ordinated Time (UTC).

To show them in your local time you can join the forum, and then set the 'time correction' field in your profile to the number of hours difference between your location and UTC time.


14,111 views.

It is now over 60 days since the last post. This thread is closed.     Refresh page

Go to topic:           Search the forum


[Go to top] top

Information and images on this site are licensed under the Creative Commons Attribution 3.0 Australia License unless stated otherwise.