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

科技回声

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

GitHubTwitter

首页

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

资源链接

HackerNews API原版 HackerNewsNext.js

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

Obfuscating “Hello World” in Python

285 点作者 carljoseph超过 10 年前

10 条评论

manto超过 10 年前
When I first saw the final code, I thought it unfathomable that I could resolve it down to "Hello World!" at any point in my lifetime. The following 20min provided an education into logic, programming, and Python that rivals 200 page reference books with clear explanations and the ideal amount of build up for each step. Thanks Ben for the post!
rrosen326超过 10 年前
I thought this was a great post, some amazing code, and humbling since this is WAY beyond my current - and future - ability.<p>Even more impressive - it looks like the author is a freshman in college! <a href="https://www.linkedin.com/in/benkurtovic" rel="nofollow">https:&#x2F;&#x2F;www.linkedin.com&#x2F;in&#x2F;benkurtovic</a><p>Nice work, Ben!
评论 #8774073 未加载
hawkice超过 10 年前
This is perhaps the clearest example on the value of implementation-oriented code comments. When you need them, they are superheroic. But... don&#x27;t need them, please.
userbinator超过 10 年前
I barely know any Python and upon first glance I could easily get an idea of how it worked (without looking at the explanation): by computing the required strings out of funny-named variables with shifts and arithmetic. co_nlocals is obviously the only actual integer constant from which all the other values are coming from.<p>Only then did I read the explanation, and realised I wasn&#x27;t far-off (the only thing I got wrong was the string computation, which I thought would be a string concatenation.) I think it says something about the language when even <i>obfuscated</i> code in it is rather readable! (Then again, I do RE where most of the code I&#x27;m reading is disassembled machine instructions, so maybe my perspective on what constitutes obfuscation is a bit skewed...)
axotty超过 10 年前
&quot;There should be one-- and preferably only one --obvious way to do it.&quot;
评论 #8773252 未加载
dangayle超过 10 年前
I saw this yesterday and shared it with a friend who had introduced me to code golf. Simply fantastic, particularly the comments.
cogburnd02超过 10 年前
I didn&#x27;t realize there needed to be an IOPCC but now I do.
WillyNourson超过 10 年前
This is like brainf*ck to me.
评论 #8772952 未加载
curiously超过 10 年前
the level of obfuscation is impressive. i wonder if similar obfuscation for javascript exists? The one from google doesn&#x27;t seem to quite work right and end up breaking my script. The paid version from jscrambler seems to work but seems like a large waste of money to obfuscate one file.
gbersac超过 10 年前
This code is so ugly that I thought it was Lisp :p