| | |
Chinese Strings in Python
![]() |
•
•
Join Date: May 2008
Posts: 2
Reputation:
Solved Threads: 0
Hello, All:
My first post... I've looked high and low for the ability to write a Chinese language text string in a program.
For example:
myString = "你好"
So that if you say:
print myString
on the console you will see:
你好
But I have yet to be successful. First off, can Python do this, and second, what is the *easiest* way to make it happen? I'm certain I'm not the only one who would like to use Unicode in their source programs, or be able to process Unicode strings, but every article I've seen does it differently. Is there another language that will do this easily?
Surely, this is not difficult, is it?
My first post... I've looked high and low for the ability to write a Chinese language text string in a program.
For example:
myString = "你好"
So that if you say:
print myString
on the console you will see:
你好
But I have yet to be successful. First off, can Python do this, and second, what is the *easiest* way to make it happen? I'm certain I'm not the only one who would like to use Unicode in their source programs, or be able to process Unicode strings, but every article I've seen does it differently. Is there another language that will do this easily?
Surely, this is not difficult, is it?
•
•
Join Date: May 2008
Posts: 2
Reputation:
Solved Threads: 0
•
•
•
•
Hello, All:
My first post... I've looked high and low for the ability to write a Chinese language text string in a program.
For example:
myString = "你好"
So that if you say:
print myString
on the console you will see:
你好
But I have yet to be successful. First off, can Python do this, and second, what is the *easiest* way to make it happen? I'm certain I'm not the only one who would like to use Unicode in their source programs, or be able to process Unicode strings, but every article I've seen does it differently. Is there another language that will do this easily?
Surely, this is not difficult, is it?
While this was very difficult in Python 2.5, it is trivial in Python 3.0.
Using the print() function in Python 3.0 seems to print any combination of Chinese text that I throw at it.
![]() |
Other Threads in the Python Forum
- Previous Thread: Convert python to c#
- Next Thread: Simulating a mouseclick?
| Thread Tools | Search this Thread |
abrupt accessdenied anti apache application approximation argv array beginner book builtin calculator change converter countpasswordentry curved dan08 dictionaries dictionary dynamic edit enter examples file float format function gui heads homework import inches input java keyboard lapse launcher library line lines linux list lists loop microphone mouse movingimageswithpygame mysqlquery newb number numbers numeric output parameters parsing path phonebook plugin port prime programming projects py2exe pygame pyopengl python random recursion redirect remote reverse scrolledtext session simple software sprite statictext string strings syntax table terminal text textarea thread threading time tlapse trick tuple tutorial twoup ubuntu unicode unit urllib urllib2 variable wordgame wxpython





