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.

Improving Your Python Productivity

173 pointsby ozkatzover 12 years ago

7 comments

kbdover 12 years ago
Not a very helpful article. Far from a general "improve your Python productivty", it's more like "here are some minor random Python features that I think are useful".<p>TLDR:<p>* Use dict and set comprehensions.<p>* Use collections.Counter.<p>* Use json.dumps or the pprint module for pretty printing.<p>* Create simple web services with Python's XML-RPC library.<p>* Use open source libraries...
评论 #4862107 未加载
评论 #4861998 未加载
评论 #4861858 未加载
busterover 12 years ago
Despite the negative comments here, it's always good to be reminded of some of nice built-in things. Reminds me how awesome pythons standard functionality really is.
评论 #4866130 未加载
评论 #4865363 未加载
eddywebover 12 years ago
As someone just said on reddt #4 reminds me of python -m SimpleHTTPServer. Very useful, even when you are not coding in Python!
评论 #4862630 未加载
gbogover 12 years ago
One single productivity python I'd like to share here is to use 'string foo'.partition(' ') instead of splitting. The reason is the edge cases are better handled with partition: you always get a 3-tuple, no matter what. No need to precheck that the split is here, or to postcheck the length of the splitted list.
评论 #4864781 未加载
edwinnathanielover 12 years ago
After reading a few comments here I'm surprised there's no "Effective Python" book already (given the age of Python itself).<p>In Java and .NET, that's what we try to do everyday: writing idiomatic Java/C# code (style, architecture, patterns, standard libs, etc).
评论 #4863933 未加载
fionabunnyover 12 years ago
I was hoping to find some mention of IDE, IDE plugin, or more process oriented stuff, rather than language features.
Zoophyover 12 years ago
Whitespace as syntax? Really?
评论 #4862189 未加载
评论 #4862455 未加载
评论 #4862593 未加载
评论 #4862073 未加载
评论 #4862486 未加载
评论 #4862154 未加载