Live data from Hacker News

Show HN: Pythonpy – the swiss army knife of the command line

github.com

11–20 of 45 posts

Re: Show HN: Pythonpy – the swiss army knife of the command line

#11
post #7

You should put up a donation link. If more people do that and it becomes common practice to donate to useful open source tools / projects then imagine what more awesome stuff could be created. Many people desire to build tools but don't have the financial support to do so.

This is what gittip is for.

And Kickstarter/Indiegogo/Crowdfunding has shown genuine interest to help fund useful tools and libraries lately which is great.

Re: Show HN: Pythonpy – the swiss army knife of the command line

#13
post #7

You should put up a donation link. If more people do that and it becomes common practice to donate to useful open source tools / projects then imagine what more awesome stuff could be created. Many people desire to build tools but don't have the financial support to do so.

Can't disagree more. That completely misunderstands the motivating philosophy behind effort expenditure given to FLOSS.

It isn't about motivating people to do things; that creates abandonware. It is about solving a problem that needs solving.

Re: Show HN: Pythonpy – the swiss army knife of the command line

#15
post #7

You should put up a donation link. If more people do that and it becomes common practice to donate to useful open source tools / projects then imagine what more awesome stuff could be created. Many people desire to build tools but don't have the financial support to do so.

Can't disagree more. That completely misunderstands the motivating philosophy behind effort expenditure given to FLOSS. It isn't about motivating people to do things; that creates abandonware. It is about solving a problem that needs solving.

I'm confused by this. How does contributing money to people developing software for the commons lead to abandonware? And is abandonware a problem if it is free/open-source? Should I avoid publishing my hobby projects that I'm not planning to support?

Re: Show HN: Pythonpy – the swiss army knife of the command line

#17
I like it! Now I can count the number of files I have in a directory:

    ls |py -l 'sum(1 for x in l)'
And also I can count the number of files whose names matche a certain extension:

    ls |grep .py |py -l 'sum(1 for x in l)'
I am not saying it was not possible before, but I don't know how to do it in bash.

Looking forward to use that for some basic stats on file. The following should sum up the first column of a csv.

    cat data.csv| py -x 'x[0]' |py -l 'sum(x for x in l)'

Re: Show HN: Pythonpy – the swiss army knife of the command line

#18
post #17

I like it! Now I can count the number of files I have in a directory: ls |py -l 'sum(1 for x in l)' And also I can count the number of files whose names matche a certain extension: ls |grep .py |py -l 'sum(1 for x in l)' I am not saying it was not possible before, but I don't know how to do it in bash. Looking forward to use that for some basic stats on file. The following should sum up the first column of a csv. cat…

Add alias numfiles="echo $(ls -1 | wc -l)" to your ~/.bashrc

Re: Show HN: Pythonpy – the swiss army knife of the command line

#19
post #17

I like it! Now I can count the number of files I have in a directory: ls |py -l 'sum(1 for x in l)' And also I can count the number of files whose names matche a certain extension: ls |grep .py |py -l 'sum(1 for x in l)' I am not saying it was not possible before, but I don't know how to do it in bash. Looking forward to use that for some basic stats on file. The following should sum up the first column of a csv. cat…

For reference, you can do this using the wc core utility. The -l option makes it count the number of lines so 'wc -l' will do the same thing as your sum expression.

Re: Show HN: Pythonpy – the swiss army knife of the command line

#20
post #17

I like it! Now I can count the number of files I have in a directory: ls |py -l 'sum(1 for x in l)' And also I can count the number of files whose names matche a certain extension: ls |grep .py |py -l 'sum(1 for x in l)' I am not saying it was not possible before, but I don't know how to do it in bash. Looking forward to use that for some basic stats on file. The following should sum up the first column of a csv. cat…

'wc -l' counts the number of lines. It also supports '-c' and '-b'.

To work with input split into columns, use awk. By default, it assumes the columns are separated with spaces. This can be customized with the '-F' option.

So your last example can be rewritten as

    awk -F, '{s+=$1} END{print s}' data.csv
Post reply on HN