473,399 Members | 4,192 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,399 software developers and data experts.

Python in Chinese

Back in May, there was quite an extensive discussion of whether or not
Python should support Unicode identifiers (with the final result being
that this would be supported in Python 3). In my periodic googling
for pyparsing users, I stumbled upon Zhpy, a preprocessor that renders
on the fly Chinese Python keywords and indentifiers written using
traditional Chinese characters into ASCII counterparts, and then
executes the resulting script. I was very intrigued at the idea, and
I thought back to Martin v. Löwis's PEP. The Zhpy approach will work
with current versions of Python (going back to 2.3, since pyparsing
requires that version).

You can view examples at the pyparsing "Who's Using Pyparsing" wiki
page - http://pyparsing.wikispaces.com/WhosUsingPyparsing#Zhpy.

Given the breadth of response to Martin v. Löwis's post, I'm curious
as to what the reaction might be to something like Zhpy.

-- Paul

Aug 13 '07 #1
1 2422
Paul McGuire schrieb:
Back in May, there was quite an extensive discussion of whether or not
Python should support Unicode identifiers (with the final result being
that this would be supported in Python 3). In my periodic googling
for pyparsing users, I stumbled upon Zhpy, a preprocessor that renders
on the fly Chinese Python keywords and indentifiers written using
traditional Chinese characters into ASCII counterparts, and then
executes the resulting script.
Interesting!

Notice what they do to the identifiers - when translating to "English",
the just number them. I wonder what this will do to backtraces,
cross-module imports, and such...

With Python 3, they can restrict themselves to just translating
keywords, and leave all identifiers in place.

Regards,
Martin
Aug 13 '07 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: Achim Domma | last post by:
Hi, I need to convert Big5 or GB encoded chinese strings to unicode. It would be also nice to be able to detect the encoding of the original string. Search with groups.google.com I found some...
57
by: John Howard | last post by:
I've sent several messages over the last year asking about python - Who teaches python? Is python losing steam? etc. I have noticed, eg, the declinng number of books at my local borders. The last...
1
by: Posadas, Dennis | last post by:
Hi, I've done some google searching w/c referred me to a couple of articles on unicode, but I'm looking for something really simple - not for a web application. See my sample code below. Any...
1
by: Anthony Liu | last post by:
The following 4 lines of code parses an XML document very well if the XML document contains only English words. But when I insert one Chinese character into the XML document, then Python starts...
12
by: xiong.xu.cn | last post by:
Hi there, I'm new to python and I'm from the java world. Though I love to learn python, I'm not very comfortable with the python documentation. Because when i read jdk doc, i can see the class...
7
by: kernel1983 | last post by:
I'm try to build a bundle on OS X, so I write a simple python script for a test: #!/usr/bin/env python import EasyDialogs EasyDialogs.Message("Hello,Mac!") This runs OK,but when I try to...
34
by: Victor Kryukov | last post by:
Hello list, our team is going to rewrite our existing web-site, which has a lot of dynamic content and was quickly prototyped some time ago. Today, as we get better idea of what we need, we're...
12
by: Steve Howell | last post by:
The never-ending debate about PEP 3131 got me thinking about natural languages with respect to Python, and I have a bunch of mostly simple observations (some factual, some anecdotal). I present...
13
by: Liang Chen | last post by:
Hope you all had a nice weekend. I have a question that I hope someone can help me out. I want to run a Python program that uses Tkinter for the user interface (GUI). The program allows me to type...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.