Skip to content

Basic Usage

Write your first PyCN program

Let's get started with 「Hello, world!」program.

  • Create a 你好.pycn (which means hello.pycn) file.
pycn
# print("Hello, world!")
打印"你好,世界!"
  • Run with pycn CLI:
shell
pycn run 你好.pycn

Interact with Python virtualenvs

Worrying about abilities? PyCN is able to interact with virtualenvs created by pip, poetry and etc. Please notice that the run command is something different now.

shell
# poetry
PYTHONPATH=.venv/lib/python<VERSION>/site-packages pycn run ./包管理器测试.pycn

# pip
PYTHONPATH=venv/lib/python<VERSION>/site-packages pycn run ./包管理器测试.pycn

Examples

I've given some examples for you to know more about Pycn:

Document by Vincent-the-gamer | MIT Licensed