4 ms·
Ask HN: What's the most beautiful code written in Python you have ever seen?
- navbaker 9y agoI once programmed a complete chess board in four lines of code: >import chess >import chess.svg >board = chess.Board() >board I'm pretty sure I'm a genius.
- tcbawo 9y agoI've enjoyed reading a lot of Peter Norvig's python code. There is his Lisp implemention (http://norvig.com/lispy.html http://norvig.com/lispy.html). He also created a spell checker that was an informative and interesting read.
- teapot01 9y agoGo to python repl > import this
- svisser 9y agoEarlier thread: https://news.ycombinator.com/item?id=9896369 https://news.ycombinator.com/item?id=9896369
- sharmi 9y agoThis 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. 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.
- RUG3Y 9y agoI've said this in other threads recently - The Flask source code is really awesome and reading helped me learn Python better.
- git-pull 9y agoSQLAlchemy: https://github.com/zzzeek/sqlalchemy https://github.com/zzzeek/sqlalchemy http://docs.sqlalchemy.org/en/latest/ http://docs.sqlalchemy.org/en/latest/ https://www.youtube.com/watch?v=vunIDi9Z-_8 https://www.youtube.com/watch?v=vunIDi9Z-_8 (Introduction to SQLAlchemy, 2014, 2:52:50) http://www.aosabook.org/en/sqlalchemy.html http://www.aosabook.org/en/sqlalchemy.html (Overview in The Architecture of Open Source Applications)