Python Formatter Tool

前端 未结 6 2059
借酒劲吻你
借酒劲吻你 2021-01-31 03:36

I was wondering if there exists a sort of Python beautifier like the gnu-indent command line tool for C code. Of course indentation is not the point in Python since it is progra

相关标签:
6条回答
  • 2021-01-31 04:19

    autopep8 attempts to automate making your code conform to pep8 coding standards

    https://pypi.python.org/pypi/autopep8

    0 讨论(0)
  • 2021-01-31 04:25

    Have you looked at pindent?

    0 讨论(0)
  • 2021-01-31 04:35

    I am the one who asks the question. In fact, the tool the closest to my needs seems to be PythonTidy (it's a Python program of course : Python is best served by himself ;) ).

    0 讨论(0)
  • 2021-01-31 04:36

    PyLint has some formatting checks.

    0 讨论(0)
  • 2021-01-31 04:40

    You can also try yapf:

    A formatter for Python files

    https://github.com/google/yapf/

    0 讨论(0)
  • 2021-01-31 04:43

    black is another recent option.

    It provides deliberate and fast code formatting and is used by many projects such as pytest, SQLAlchemy and Pillow to name a few.

    0 讨论(0)
提交回复
热议问题