TE
科技回声
首页24小时热榜最新最佳问答展示工作
GitHubTwitter
首页

科技回声

基于 Next.js 构建的科技新闻平台,提供全球科技新闻和讨论内容。

GitHubTwitter

首页

首页最新最佳问答展示工作

资源链接

HackerNews API原版 HackerNewsNext.js

© 2025 科技回声. 版权所有。

Ask HN: What's the most beautiful code written in Python you have ever seen?

19 点作者 pedrodelfino将近 8 年前

7 条评论

git-pull将近 8 年前
SQLAlchemy:<p><a href="https:&#x2F;&#x2F;github.com&#x2F;zzzeek&#x2F;sqlalchemy" rel="nofollow">https:&#x2F;&#x2F;github.com&#x2F;zzzeek&#x2F;sqlalchemy</a><p><a href="http:&#x2F;&#x2F;docs.sqlalchemy.org&#x2F;en&#x2F;latest&#x2F;" rel="nofollow">http:&#x2F;&#x2F;docs.sqlalchemy.org&#x2F;en&#x2F;latest&#x2F;</a><p><a href="https:&#x2F;&#x2F;www.youtube.com&#x2F;watch?v=vunIDi9Z-_8" rel="nofollow">https:&#x2F;&#x2F;www.youtube.com&#x2F;watch?v=vunIDi9Z-_8</a> (<i>Introduction to SQLAlchemy</i>, 2014, 2:52:50)<p><a href="http:&#x2F;&#x2F;www.aosabook.org&#x2F;en&#x2F;sqlalchemy.html" rel="nofollow">http:&#x2F;&#x2F;www.aosabook.org&#x2F;en&#x2F;sqlalchemy.html</a> (Overview in <i>The Architecture of Open Source Applications</i>)
sharmi将近 8 年前
This was back in 2005-2006. I was working with a guy who loves to code. His favorite way to spend the weekend was to figure out ways to make our services more robust and optimized. He had one major disadvantage.<p>His forgetfulness was legendary. He could barely remember what happened in the morning or what code he wrote. He made this his strength by writing the cleanest and well-structured code I have ever seen. So, not only him, but anyone, without any prior knowledge, can jump into the code at any point in time and immediately understand the flow and be productive. Obviously, it helps that the code was in Python, but being in python by itself does not a great code make.
navbaker将近 8 年前
I once programmed a complete chess board in four lines of code:<p>&gt;import chess<p>&gt;import chess.svg<p>&gt;board = chess.Board()<p>&gt;board<p>I&#x27;m pretty sure I&#x27;m a genius.
RUG3Y将近 8 年前
I&#x27;ve said this in other threads recently - The Flask source code is really awesome and reading helped me learn Python better.
tcbawo将近 8 年前
I&#x27;ve enjoyed reading a lot of Peter Norvig&#x27;s python code. There is his Lisp implemention (<a href="http:&#x2F;&#x2F;norvig.com&#x2F;lispy.html" rel="nofollow">http:&#x2F;&#x2F;norvig.com&#x2F;lispy.html</a>). He also created a spell checker that was an informative and interesting read.
svisser将近 8 年前
Earlier thread: <a href="https:&#x2F;&#x2F;news.ycombinator.com&#x2F;item?id=9896369" rel="nofollow">https:&#x2F;&#x2F;news.ycombinator.com&#x2F;item?id=9896369</a>
teapot01将近 8 年前
Go to python repl<p>&gt; import this