(I'm not subscribed so this won't thread right, but oh well) This doesn't preserve the same semantics as the original, in that it always reads the entire file, but it is awfully short: def getline(filename, lineno): return (lineno < 1 and ('',) or ([ln for (i,ln) in enumerate(open(filename)) if i==lineno-1] or ('',)))[0] -- BTR YOU HEAR ME, BEN WOLFSON?!? YOUR SUPERCILIOUS CONTEMPT POWERS CANNOT WITHSTAND THE POWER OF MY BOORISH *DIMWIT* *RAY*!!!! -- revjack
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4