Wxpython window Chinese garbled solution _python

Source: Internet
Author: User

The example of this article tells the Wxpython window Chinese garbled solution, shares for everybody reference. The specific methods are as follows:

File Save As Utf-8
The beginning of the file add #-*-Coding:utf-8-*-
Add u or u before having Chinese string, for example: U "my website: http://www.jb51.net"

Examples are as follows:

Copy Code code as follows:
#-*-Coding:utf-8-*-
Import WX
Class App (WX. APP):

def OnInit (self):
frame = wx. Frame (Parent=none, Title=u ' My site: http://www.jb51.net ')
Frame. Show ()
Return True

App = App ()
App. Mainloop ()

Unicode string:

Unicode is the standard way to write international text. If you want to write text in your native language such as Hindi or Arabic, you need an editor that supports Unicode. Similarly, Python allows you to process Unicode text-you just prefix the string with u or U. For example, U "This is a Unicode string.".

Also remember to use a Unicode string when you are working on a text file, especially if you know that the file contains text written in a non-English language.

I hope this article will help you with your Python programming.

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.