Skip to main content

Write python language in chinese

Project description

zhpy is an toy convertor to translate chinese (Traditional and Simplified) python code to nature python code (english).

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

zhpy refactored the origin code from HYRY.

Check examples here.

Install zhpy

You could use easy_install command to install zhpy:

$ easy_install zhpy

Usage

You could use zhpy instead of python in command line:

$ 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.2.zip (7.5 kB view details)

Uploaded Source

Built Distribution

zhpy-0.2-py2.5.egg (10.4 kB view details)

Uploaded Source

File details

Details for the file zhpy-0.2.zip.

File metadata

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

File hashes

Hashes for zhpy-0.2.zip
Algorithm Hash digest
SHA256 f7847b1cee66b7f811396398c8efdd122381cf002b3ffac6a8813fe70fc893e8
MD5 f1b6da5fea5bb64292e4e0423fe1e376
BLAKE2b-256 b8db5f0f6353276d856e77dbee465c43a0d264c5aaf9127a547faaa2790fa86f

See more details on using hashes here.

File details

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

File metadata

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

File hashes

Hashes for zhpy-0.2-py2.5.egg
Algorithm Hash digest
SHA256 d45842b3cdba33548618d53f7f8f681e22d0a85ca4a1e8d6234fe3da59c86617
MD5 a0e66e80449bc6c150f6ba2faef3f52d
BLAKE2b-256 cdba8bd88a5a09c95252d2b661ec0971772ffba50af81f163d6748881f53c2de

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