/ziyou-python-write-ups

Student write-ups for Ziyou Python courses

Primary LanguagePythonBSD 3-Clause "New" or "Revised" LicenseBSD-3-Clause

簡明 Python 學習講義:習題解答集

Code style: black

國立**大學吳維漢教授一著「簡明 Python 學習講義」的習題解答集、暨 MCL 工讀生合著紀念集。

Build Documents

Make sure you already have a XeLaTeX complier (to write documents), and a proper Python interpreter (to write codes).

Then, clone the project first (with submodules):

git clone --recurse-submodules https://github.com/OpenMCL/ziyou-python-write-ups

Enter the project, and run the following command to build the document:

xelatex docs/main.tex
xelatex docs/main.tex

or simply run make docs if you have make.

This would output a pdf file called main.pdf at the project root folder.

Setup Coding Environments

We suggest using Python 3.8 or higher versions.

Install Dependencies

With Poetry (Recommended)

To install all requirements, run the following command:

poetry install --with dev

With Pip

If you do not have poetry, you can also install all requirements with the following command:

pip install numpy matplotlib black flake8 flake8-black flake8-bugbear

Offline Code Linting

After the above installation, you can run flake8 to check code format:

flake8 src

or simply run make lint if you have make.

Contribution

We would love to accept your patches to this project. There are some guidelines you need to follow:

Coding Style

  • Please follow PEP8. We recommend you check your patch with Flake8.
  • In addition, please format your code with Black.

We recommend you use VS Code to write code with ease. You can put the following settings to ${workspaceFolder}/.vscode/settings.json:

{
  "[python]": {
    "editor.formatOnSave": true,
    "editor.codeActionsOnSave": {
      "source.organizeImports": true
    }
  },
  "python.formatting.provider": "black",
  "python.linting.enabled": true,
  "python.linting.flake8Enabled": true
}

Peer Review

All submissions require review. We use GitHub (or GitLab) pull requests and review systems to meet these requirements. See help here for more information on using GitHub pull requests.

License