Pythonpy

Dev tools

command line utility

SHOW HN2014

220points
42comments
#83of 2,272 in 2014
Top 4%of 2014 by points

How HN took it

DebatedReal support and real criticism

6 positive, 8 neutral or asking, 0 mixed, 6 critical, out of 20 comments about the project. Thread score -0.02.

Idea: 4 for, 3 againstExecution: 2 for, 3 against

The thread, comment by comment

Each row is a top-level comment and its replies, in HN's order. Select a cell to open that comment on HN.

positive neutral or mixed critical about another commenter or something else the maker

What HN said

What people liked

  • Useful for quick Python one-liners on pipes

    From 3 comments
    • Looks so useful, can't believe I never thought of hacking something to do that. Will experiment with it!
      d0m on HN
    • 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…
      S4M on HN
    • I usually use Python(or another lang's interpreter) as my calculator, so this will save me a few keystrokes in the future. I think I'll still use short scripts rather than the…
      Lambdanaut on HN

Objections

  • Does not work on Windows due to Unix-only calls

    From 2 comments
    • I attempted to install on Windows - it doesn't work due to the lack of os.geteuid(), which is called in the setup.py file to check for root. With a little bit of finagling I…
      cohomologo on HN
    • Yea, sorry about that. I had an initiative to make a windows version, wpy, a little after launch, but couldn't really get any windows developers interested in making it happen.…
      Russell91 on HN
  • Shell tools like wc, awk and grep already do this

    From 2 comments
    • You'll probably want to learn the regular unix way as well. Tools like this are nice, but you're already 99% there as it is for most things. ``` ls | wc -l ls | grep -c .py ```…
      mitchty on HN
    • Honest question. Why would I want to use this? I am already quite happy with awk,sed,grep, etc.
      mgr86 on HN
  • Example using shell mv was risky

    From 2 comments
    • ls | py -x '"mv %s %s.txt" % (x,x)' | sh has me worried, I can't find the escape code directly. Also you might wish to offer the following api ls | py -X '["mv","%s","%s.txt"]…
      Qantourisc on HN
    • Hmm, I just added this example yesterday, and it seems to be highly contested, so I'll exchange it for something less controversial. That being said, if you're concerned about…
      Russell91 on HN

Requests

  • Document Windows incompatibility

    From 1 comment
    • I attempted to install on Windows - it doesn't work due to the lack of os.geteuid(), which is called in the setup.py file to check for root. With a little bit of finagling I…
      cohomologo on HN
  • Support multi-statement one-liners

    From 1 comment
    • Would've been more useful with a language that doesn't limit one-liners (e.g. you can't have "for x in [1,2,3]: dothing1(x); dothing2(x)").
      Grue3 on HN

Questions

  • Why use this over awk, sed and grep

    From 1 comment
    • Honest question. Why would I want to use this? I am already quite happy with awk,sed,grep, etc.
      mgr86 on HN

Alternatives named

  • PyP from Sony Imageworks

    From 1 comment
    • Nice. Similar to PyP from Sony Imageworks: http://opensource.imageworks.com/?p=pyp The Pyed Piper Tutorial: http://www.youtube.com/watch?v=eWtVWF0JSJA
      ctrijueque on HN
  • piep

    From 1 comment
    • I wrote a similar tool a while back: http://gfxmonk.net/dist/doc/piep/ Mostly out of frustration for PyP not being lazy (on large inputs it reads the entire file up-front, or at…
      gfxmonk on HN
  • e (pypi)

    From 1 comment
    • A simpler version of py is e ⌘ https://pypi.python.org/pypi/e/1.4.5
      kseistrup on HN
  • Standard unix tools wc, awk, grep

    From 3 comments
    • 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.
      foob on HN
    • '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.…
      alco on HN
    • You'll probably want to learn the regular unix way as well. Tools like this are nice, but you're already 99% there as it is for most things. ``` ls | wc -l ls | grep -c .py ```…
      mitchty on HN
  • pru for Ruby

    From 1 comment

Category, keywords, summaries and labels on this page were made by AI (Thread Reader v2) and not checked by hand. Each point links to the comments it came from.

Add a badge to your READMEShown on HackerShow
[![Shown on HackerShow](https://hackershow.org/badge.svg)](https://hackershow.org/show/8158976)