Article View: comp.sys.mac.system
Article #191Re: PSA/QUESTION: Porting Windows batch to Python for macOS/Linux users
From: Lawrence D’Oliveiro
Date: Sun, 22 Nov 2026 21:52
Date: Sun, 22 Nov 2026 21:52
21 lines
2671 bytes
2671 bytes
On Sun, 22 Nov 2026 17:45:34 -0400, Maria Sophia wrote: > On Sun, 22 Nov 2026 19:32:30 -0000 (UTC), Lawrence D’Oliveiro wrote: >> >> But I see that instead of writing cur = conn.cursor(), >> cur.execute(...), and cur.fetchall() in every query function, your >> suggestion allows us to create a cursor, run a cmd with bound >> values, and yield rows one at a time as a generator instead of >> loading everything into a list up front, where mapfn lets us >> optionally transform each row on the fly to pull a single column. > > You see why all languages are not the same. The concept of what is > “high-level” has progressed somewhat since the 1970s. > > This is about philosophy... I showed you an example where it was a bit more than just “philosophy”, did I not: Python offers constructs that let you do more with less code, than perhaps what you were used to. Less code to write means less effort and time required, less chance for bugs to get in, and less ongoing maintenance effort required into the future.
Technical Details
Message-ID:
<11dvo6a$1bds1$2@dont-email.me>Path:
mbox-mo1.pugleaf.net!srv.newsdeef.eu!news.hispagatos.org!eternal-september.org!feeder.eternal-september.org!nntp.eternal-september.org!.POSTED!not-for-mailReferences:
<11dsuk8$2dgm$1@nnrp.usenet.blueworldhosting.com> <11dtk8d$2f73$1@nnrp.usenet.blueworldhosting.com> <11dtkua$3j5$1@nnrp.usenet.blueworldhosting.com> <11du1ds$2d2n$1@nnrp.usenet.blueworldhosting.com> <11du4vq$o88b$1@dont-email.me> <11duejv$pj6$1@nnrp.usenet.blueworldhosting.com> <11dvg0e$18965$1@dont-email.me> <11dvnpt$2q1n$1@nnrp.usenet.blueworldhosting.com>Show Full Headers
Complete Article Headers
Path: mbox-mo1.pugleaf.net!srv.newsdeef.eu!news.hispagatos.org!eternal-september.org!feeder.eternal-september.org!nntp.eternal-september.org!.POSTED!not-for-mail From: Lawrence D’Oliveiro <ldo@nz.invalid> Newsgroups: comp.lang.python,alt.os.linux,comp.sys.mac.system,alt.comp.os.windows-11 Subject: Re: PSA/QUESTION: Porting Windows batch to Python for macOS/Linux users Date: Sun, 22 Nov 2026 21:52:10 -0000 (UTC) Organization: A noiseless patient Spider Lines: 21 Message-ID: <11dvo6a$1bds1$2@dont-email.me> References: <11dsuk8$2dgm$1@nnrp.usenet.blueworldhosting.com> <11dtk8d$2f73$1@nnrp.usenet.blueworldhosting.com> <11dtkua$3j5$1@nnrp.usenet.blueworldhosting.com> <11du1ds$2d2n$1@nnrp.usenet.blueworldhosting.com> <11du4vq$o88b$1@dont-email.me> <11duejv$pj6$1@nnrp.usenet.blueworldhosting.com> <11dvg0e$18965$1@dont-email.me> <11dvnpt$2q1n$1@nnrp.usenet.blueworldhosting.com> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Injection-Date: Sun, 22 Nov 2026 21:52:10 +0000 (UTC) Injection-Info: dont-email.me; logging-data="1423233"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1+U3zIDcvzsjP17NsbEDZqF"; posting-host="459210f3b638d87187d8a6c5f3a5794f" User-Agent: Pan/0.165 (Kostiantynivka) Cancel-Lock: sha1:Gelf5CkiqtMn8ZHcZqNfIKlGAfw= sha256:hd5ZzqJ61z8hPeeTqpI1bO59qYNBcJgA8Mzwi+B2Iag= sha1:9kH2XoZGGXQsvgR5sfOrP4sRzR8= sha256:a6+tRwXwZrSOxgKLd9ezopKYHeCrOQyHxvqJCGtPmDs=