Puas ua haujlwm zoo nrog python?

Cov txheej txheem:

Puas ua haujlwm zoo nrog python?
Puas ua haujlwm zoo nrog python?
Anonim

thiab nrog cov plugins koj tuaj yeem siv nws rau Python, PHP, Swift, Ruby, Java thiab ntau dua. Nws koom nrog nrov tshaj plaws code editors, suav nrog VS Code, Sublime Text, Atom thiab ntau dua. Prettier yog qhov nrov heev, zoo li thaum Lub Ob Hlis 2018 nws tau rub tawm ntau dua 3.5 lab lub sijhawm.

Kuv puas tuaj yeem siv Prettier nrog Python?

Prettier tsis ua haujlwm nrog Python Thiab tsis txhob hnov qab nruab thiab xaiv tus formatter tiag tiag uas koj xav tau (ib yam li hauv cov ntaub ntawv raug cai).

hom lus twg yog Prettier txhawb nqa?

Prettier yog qhov kev xav code formatter nrog kev txhawb nqa rau:

  • JavaScript (nrog rau kev sim nta)
  • JSX.
  • Angular.
  • Vue.
  • Flow.
  • TypeScript.
  • CSS, Tsawg, thiab SCSS.
  • HTML.

Koj ua li cas Python code Prettier?

  1. Clone this repository.
  2. Run yarn.
  3. Create a file hu ua test.py.
  4. Run yarn prettier test.py xyuas cov zis.
  5. Run yarn prettier -- --write test.py to rewrite file.
  6. Saib cov xov paj zoo nkauj -- --pab rau lwm txoj kev xaiv.

Dab tsi yog formatter zoo tshaj plaws rau Python?

Python nrov tshaj plaws formatters yog:

  • Black.
  • isort.
  • autopep8.
  • YAPF.

Pom zoo: