Skip to main content

Write python language in chinese

Project description

zhpy is python on Chinese, which good for Taiwan and China beginners to learn python in their native language.

zhpy is a lightweight python module and a source convertor, which provides a command line tool to translate python code. The python code written by traditional and simplified chinese would be translated to nature python code (english).

zhpy use pyparsing module to detect chinese keywords, class name, methods, arguments, v ariables and translate them back to python.

It’s possible for developers to port zhpy to python on korean or python on japenese.

Check examples here.

Install zhpy

You could use easy_install command to install zhpy:

$ easy_install zhpy

or check instructions for detail.

Usage

You could use ‘zhpy’ command instead of “python” in command line to execute source code mixed in Chinese and English.:

$ zhpy hello.py
hello, world!

You could assign a file name to export the zhpy source to the normal python source (english):

$ zhpy hello.py nhello.py

Then run the exported file as normal python source:

$ python nhello.py
hello, world!

Programming

You could mix original english keywords and Chinese keywords in your zhpy source.

Reserved keywords are listed here

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

zhpy-0.3.zip (16.7 kB view details)

Uploaded Source

Built Distribution

zhpy-0.3-py2.5.egg (10.5 kB view details)

Uploaded Source

File details

Details for the file zhpy-0.3.zip.

File metadata

  • Download URL: zhpy-0.3.zip
  • Upload date:
  • Size: 16.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No

File hashes

Hashes for zhpy-0.3.zip
Algorithm Hash digest
SHA256 fb60ddd14fe94b06870c1518761d3628f80a025c17b891212f5c0447e652fa9f
MD5 14f0c232690d70e9f2e5cec51eba11a0
BLAKE2b-256 46547850bca8fd7ad74bb425d4f862a1baaca88c4c59c4f8236e72009bdbf29f

See more details on using hashes here.

File details

Details for the file zhpy-0.3-py2.5.egg.

File metadata

  • Download URL: zhpy-0.3-py2.5.egg
  • Upload date:
  • Size: 10.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No

File hashes

Hashes for zhpy-0.3-py2.5.egg
Algorithm Hash digest
SHA256 d161ff66f68047acd03923e1410dc93bc98c428d89f40f1154584a893be92bb7
MD5 046a005aa5cc68d513b902ad113789e2
BLAKE2b-256 ac45a3021831f0245220339c7028b0ba7a4f71272dac0eed3aabcad31f47eb59

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page