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

科技回声

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

GitHubTwitter

首页

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

资源链接

HackerNews API原版 HackerNewsNext.js

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

Hidden features of Python

132 点作者 niyazpk超过 13 年前

3 条评论

ubasu超过 13 年前
Older discussion:<p><a href="http://news.ycombinator.com/item?id=1512930" rel="nofollow">http://news.ycombinator.com/item?id=1512930</a>
phzbOx超过 13 年前
I already knew mostly everything in it (Time to switch to a new language!) but here's two that I didn't know:<p>1.<p><pre><code> from __future__ import braces </code></pre> Use {} to delimit scope!<p>2.<p><pre><code> try: import readline except ImportError: print "Unable to load readline module." else: import rlcompleter readline.parse_and_bind("tab: complete") </code></pre> Used to use [tab]-completion in terminal. One could correctly argue that using iPython would be smarter.. but sometime you are working remotely and don't want to get out of the terminal and install, etc.
评论 #3453257 未加载
评论 #3455168 未加载
zalew超过 13 年前
most of these features are so <i>hidden</i>, you learn them the first few nights with python