[Python-ideas] unix filter, one liners, awk

2020-11-05 Thread Hans Ginzel
Is there a reason, why not to make python useful for practical one liners to replace perl and awk? There is page Powerful Python One-Liners, https://wiki.python.org/moin/Powerful%20Python%20One-Liners. But almost none of them handles files, behaves like unix filter or is ugly – must import modules

[Python-ideas] Re: unix filter, one liners, awk

2020-11-05 Thread Guido van Rossum
IIRC I created the fileinput module to help with this, but I don't know how much use it finds. On Thu, Nov 5, 2020 at 10:05 AM Hans Ginzel wrote: > Is there a reason, why not to make python useful for practical one liners > to replace perl and awk? > There is page Powerful Python One-Liners, > h

[Python-ideas] Re: unix filter, one liners, awk

2020-11-05 Thread Paul Sokolovsky
Hello, On Thu, 5 Nov 2020 18:46:53 +0100 Hans Ginzel wrote: > Is there a reason, why not to make python useful for practical one > liners to replace perl and awk? > There is page Powerful Python One-Liners, > https://wiki.python.org/moin/Powerful%20Python%20One-Liners. > But almost none of them

[Python-ideas] Re: unix filter, one liners, awk

2020-11-05 Thread Alex Hall
Try https://github.com/ksamuel/Pyped On Thu, Nov 5, 2020 at 8:03 PM Hans Ginzel wrote: > Is there a reason, why not to make python useful for practical one liners > to replace perl and awk? > There is page Powerful Python One-Liners, > https://wiki.python.org/moin/Powerful%20Python%20One-Liners.

[Python-ideas] Re: unix filter, one liners, awk

2020-11-05 Thread Steven D'Aprano
On Thu, Nov 05, 2020 at 09:41:45PM +0300, Paul Sokolovsky wrote: > Hello, > > On Thu, 5 Nov 2020 18:46:53 +0100 > Hans Ginzel wrote: > > > Is there a reason, why not to make python useful for practical one > > liners to replace perl and awk? > > There is page Powerful Python One-Liners, > > http

[Python-ideas] Re: propose index heap

2020-11-05 Thread Dennis Sweeney
I've thought about this before too. But if I remember correctly, most real-world path-finding algorithms can use a heap without an index to achieve basically the same results: with this approach, the heap can now store more than one copy of a node, but it doesn't need to put all of the nodes in

[Python-ideas] Re: unix filter, one liners, awk

2020-11-05 Thread Stephen J. Turnbull
Alex Hall writes: > Try https://github.com/ksamuel/Pyped Or perhaps https://xon.sh, and have Python be the native syntax of the shell. (Unfortunately if I read correctly xonsh is based on Python 3.5, so no walrus operator and no f-strings yet.) On Thu, Nov 5, 2020 at 8:03 PM Hans Ginzel wrote

[Python-ideas] Re: unix filter, one liners, awk

2020-11-05 Thread Mike Müller
Am 06.11.20 um 08:15 schrieb Stephen J. Turnbull: > Alex Hall writes: > > > Try https://github.com/ksamuel/Pyped > > Or perhaps https://xon.sh, and have Python be the native syntax of the > shell. (Unfortunately if I read correctly xonsh is based on Python > 3.5, so no walrus operator and no f-