Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8234333
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 7, 20262026-06-07T18:26:20+00:00 2026-06-07T18:26:20+00:00

here is my code python 2.7 & wxpython 2.8 http://pastie.org/4248326 these 3 textctrl, at

  • 0

here is my code

python 2.7 & wxpython 2.8

http://pastie.org/4248326

these 3 textctrl, at the chat_c(textctrl)

i want to make chat_c and text_c like a chatting room

input is chat_c output is text_c

that is why i use

def OnReturnDown(self,e):

    key = e.GetKeyCode()
    self.text_c.SetValue(key) #for check out but doesn't work
    if key == wx.WXK_RETURN:
        self.text_c.SetValue(self.chat_c.GetValue()) 

 #key bind
    self.chat_c.Bind(wx.EVT_KEY_DOWN, self.OnReturnDown)

this is error message

Traceback (most recent call last):
  File "C:\workspace\wx_python_test\main_chat_client.py", line 239, in OnReturnDown
    self.text_c.SetValue(key) #for check out but doesn't work
  File "C:\Python27\Lib\site-packages\wx-2.8-msw-unicode\wx\_controls.py", line 1754, in SetValue
    return _controls_.TextCtrl_SetValue(*args, **kwargs)
TypeError: String or Unicode type required

what is that? Unicode type required???

maybe change the style of textctrl?

how can fix this?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-07T18:26:21+00:00Added an answer on June 7, 2026 at 6:26 pm

    e.GetKeyCode() returns an int. You don’t pass an int to a text control. A text control only takes a string or a unicode string. So you’ll need to cast the int into a string or do something else. Here’s how to cast it:

    key = str( e.GetKeyCode() )
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Using bottlenose - ( http://pypi.python.org/pypi/bottlenose/0.3.4 ) Here's my code: import bottlenose,json AMAZON_SECRET_KEY=XXX AMAZON_ACCESS_KEY_ID =
Here is some sample Python code: import re some_regex = re.compile(r\s+1\s+) result = some_regex.search(
Here is the my python code using BeautifulSoup. The main issue is with the
Here is the working code in Python (using cURL): #!/usr/bin/python import pycurl c =
I'm just learning Python & Django. (Thanks to everyone who contributes here -- it's
I am on Ubuntu 10.04, Python 2.6.5 & having some trouble installing pyLucene. Here's
I'm writing a simple script in python to replay saved HTTP requests . Here
I am new at python. Here is my wiered python code Which works fine
The script is on jsfiddle here : CODE What it does at the moment
Ok the error is showing up somewhere in this here code if($error==false) { $query

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.