Live data from Hacker News

Pythonpy – Command-line Kung Fu with Python

github.com

31–40 of 40 posts

Re: Pythonpy – Command-line Kung Fu with Python

#31

Note that : - sony did a project like this : power at prompt ( https://code.google.com/p/pyp/ ). - an alternative exists to both : pyped ( https://pypi.python.org/pypi/Pyped/1.4 ) I like it better because it packs many utilities, but that's a matter of taste. - other projects like that existed prior this one doing the same thing. The author choose to reinvent the wheel instead of contributing. I tend to dislike this…

[deleted]

Re: Pythonpy – Command-line Kung Fu with Python

#32

Note that : - sony did a project like this : power at prompt ( https://code.google.com/p/pyp/ ). - an alternative exists to both : pyped ( https://pypi.python.org/pypi/Pyped/1.4 ) I like it better because it packs many utilities, but that's a matter of taste. - other projects like that existed prior this one doing the same thing. The author choose to reinvent the wheel instead of contributing. I tend to dislike this…

And there it is a previous discussion about this on HN (https://news.ycombinator.com/item?id=8158976) with some useful comments.

Re: Pythonpy – Command-line Kung Fu with Python

#33
post #11

I had used a very similar one for a while https://github.com/ksamuel/Pyped and found it quite useful. In that other utility they mention "'py' has been renamed to 'pyp' to avoid conflict with the new tool in the Python stdlib named 'py'" I wonder if such a problem would arise for your project.

Yes, the name is controversial. But it's also highly functional. I do recommend that you try out pythonpy even though you have already tried one of the other similar tools. I think you'll find it to be simpler, without losing much in terms of functionality. Also, the others haven't implemented ipython style tab completion from the command line.

You're not really addressing the one concern voiced in the post you are replying to. As much as you might find the above information interesting, I'm sure tucif wasn't looking for a sales pitch.

Re: Pythonpy – Command-line Kung Fu with Python

#34
I've reinvented the wheel myself and made "pype" (link below).

I've been using python on the command line for quite a while, but I found that I tend to use it when I'm doing something a little more advanced than what can easily be done with standard Linux tools - and command line python would often fail me, because I couldn't easily do conditions or loops, because of the requirement for whitespace indenting. So pype contains a simple parser that'll convert bracket indented code to regular whitespace indented code, besides supporting all the stuff you want on the command line.

https://github.com/ircflagship2/pype

Re: Pythonpy – Command-line Kung Fu with Python

#35
post #24

This is kind of awesome. "Sys admin" type usage definitely drives adoption/popularity/usage of a language (e.g., see perl; and people like doing sysadmin stuff with ruby). I would love, love to have something close to pythonpy in the python core. The absence of being able to cleanly fit into standard UNIX pipe / 'filter' type workflows is a real downer for python for me and for others trying to do "sys admin" workflo…

My thoughts as well. Sure I know there is an apparent wealth of command line utilities that can do everything you want and more. But not everyone knows those.

Take me for instance: I know a couple of programming laguages pretty well and know how to do most of the typical awk/sed/grep/... functionality in them by hart. I don't do a lot of command line work though, and never came around to learning it properly, so when I do and have to do something like 'move all files if some condition is true'/'do x for files containing y' and so on it's always the same struggle - couple of options:

- start googling around till solution found using awk/sed/... crawl through sometimes awkward syntax and require multiple dummy runs or on copies od data (not nice if it's in the TB ranges) to make sure I don't screw something up

- once and for all learn the ins and outs of awk/sed/...; not sure if the amount of time I'd have to spend on it is worth it

- start an IDE, write some C++ or C#, enter debugger and fix things on the go until correct. The process is usually way faster than the above one since I know syntax and needed methods by hart

- write Python/MsBuild script

- use something like pythonpy

Usually any of these except the first two seem a better idea in my case. So next time I'm definitely going to try the last one out.

Re: Pythonpy – Command-line Kung Fu with Python

#36

Note that : - sony did a project like this : power at prompt ( https://code.google.com/p/pyp/ ). - an alternative exists to both : pyped ( https://pypi.python.org/pypi/Pyped/1.4 ) I like it better because it packs many utilities, but that's a matter of taste. - other projects like that existed prior this one doing the same thing. The author choose to reinvent the wheel instead of contributing. I tend to dislike this…

Another one: https://github.com/edk0/spy

Re: Pythonpy – Command-line Kung Fu with Python

#38
post #20
post #15

Earlier quoted context omitted.

why sad face? I have written thousands of lines of python and and never once wanted to go to 3.

You could certainly make an argument that people who are just starting to learn Python should learn Python 3 instead of 2 no? And that being the case, it'd be nice if they could just use what they are used to instead of having to learn all the changes on top of the language itself

You could make that statement, but without giving a reason its less reason and more religion. Either way, I'd counter that for someone starting out, python 2 vs 3 is irrelevant - learning core features, pythonic style, exception handling and testing should be the focus. In fact, even more so if they ultimately intend to use python 3 because they're going to have to refactor or completely rewrite the huge number of third party libraries which haven't been ported yet.

FWIW, I've been working as an enterprise dev in finance tech for a decade and have yet to see or hear of anyone using python 3 in that setting. My current firm is a global industry leader with arguably the most advanced and costly system of its kind ever conceived - it runs on 32 bit Python 2.6.

In general, if you want to have gainful employment you're best served by not being attached to any one language because most of enterprise runs everything a few versions back as they've learned the cutting edge is not a cliche - it's literal.

Re: Pythonpy – Command-line Kung Fu with Python

#39

Note that : - sony did a project like this : power at prompt ( https://code.google.com/p/pyp/ ). - an alternative exists to both : pyped ( https://pypi.python.org/pypi/Pyped/1.4 ) I like it better because it packs many utilities, but that's a matter of taste. - other projects like that existed prior this one doing the same thing. The author choose to reinvent the wheel instead of contributing. I tend to dislike this…

[deleted]

Re: Pythonpy – Command-line Kung Fu with Python

#40
post #20

Earlier quoted context omitted.

You could certainly make an argument that people who are just starting to learn Python should learn Python 3 instead of 2 no? And that being the case, it'd be nice if they could just use what they are used to instead of having to learn all the changes on top of the language itself

You could make that statement, but without giving a reason its less reason and more religion. Either way, I'd counter that for someone starting out, python 2 vs 3 is irrelevant - learning core features, pythonic style, exception handling and testing should be the focus. In fact, even more so if they ultimately intend to use python 3 because they're going to have to refactor or completely rewrite the huge number of th…

I think you misunderstand me; I was only trying to answer your question, "why sad face?"

I didn't give a reason because I wasn't trying to say Python 3 is better than Python 2. I was only stating that one could make the argument that a beginner would be better off learning Python 3 instead of Python 2, being that it's generally accepted that neither are necessarily bad. And from that it seems reasonable to assume some people have learned Python 3 but not Python 2. And finally, being that there are people who have learned Python 3 but not 2, someone might post a "sad face" because they want to use what they are comfortable with instead of being forced to learn something new.

I don't disagree with any of your points. But I don't think it should be hard to imagine there might be some people out there with different backgrounds or goals who would be better suited to learning Python 3 or at least for who the choice would not lean too heavily one way or the other.

Obviously not everyone is planning to work in your industry or even learning Python for the sake of using it for a (future) job.

Hope that makes sense and answers your question.

Post reply on HN