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: What's the most beautiful code written in Python you have ever seen?

19 pointsby pedrodelfinoalmost 8 years ago

7 comments

git-pullalmost 8 years ago
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>)
sharmialmost 8 years ago
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.
navbakeralmost 8 years ago
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.
RUG3Yalmost 8 years ago
I&#x27;ve said this in other threads recently - The Flask source code is really awesome and reading helped me learn Python better.
tcbawoalmost 8 years ago
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.
svisseralmost 8 years ago
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>
teapot01almost 8 years ago
Go to python repl<p>&gt; import this