TE
TechEcho
Home24h TopNewestBestAskShowJobs
GitHubTwitter
Home

TechEcho

A tech news platform built with Next.js, providing global tech news and discussions.

GitHubTwitter

Home

HomeNewestBestAskShowJobs

Resources

HackerNews APIOriginal HackerNewsNext.js

© 2025 TechEcho. All rights reserved.

Ask HN: Python Script Best Practices?

20 pointsby shlipover 2 years ago
I recently stumbled on this article about Shell Script Best Practices (https:&#x2F;&#x2F;sharats.me&#x2F;posts&#x2F;shell-script-best-practices&#x2F;) here on HN and appreciated the format (concise, curated, well explained, based on experience).<p>I was wondering if someone knows of a similar ressource for python ?

3 comments

j0hnylover 2 years ago
<a href="https:&#x2F;&#x2F;peps.python.org&#x2F;pep-0008&#x2F;" rel="nofollow">https:&#x2F;&#x2F;peps.python.org&#x2F;pep-0008&#x2F;</a>
评论 #33458588 未加载
wodenokotoover 2 years ago
Read pep8, as others suggest, but don’t use a linter.<p>&gt; However, know when to be inconsistent – sometimes style guide recommendations just aren’t applicable. When in doubt, use your best judgment. Look at other examples and decide what looks best.<p>-pep8
评论 #33465038 未加载
4oo4over 2 years ago
Use a linter, personally pylint has helped me learn to write more &quot;Pythonic&quot; code. If you&#x27;re using vscode, you can easily integrate it or any other python linter.<p><a href="https:&#x2F;&#x2F;learn.microsoft.com&#x2F;en-us&#x2F;visualstudio&#x2F;python&#x2F;linting-python-code?view=vs-2022" rel="nofollow">https:&#x2F;&#x2F;learn.microsoft.com&#x2F;en-us&#x2F;visualstudio&#x2F;python&#x2F;lintin...</a><p>If you also want a linter for bash, check out shellcheck: <a href="https:&#x2F;&#x2F;github.com&#x2F;koalaman&#x2F;shellcheck" rel="nofollow">https:&#x2F;&#x2F;github.com&#x2F;koalaman&#x2F;shellcheck</a>