Live data from Hacker News

Show HN: I wrote a book about Python

pragprog.com

31–40 of 47 posts

Re: Show HN: I wrote a book about Python

#31
post #25
post #9

Earlier quoted context omitted.

Hey man just wanted to say congratulations on publishing this book. As I python developer myself do you think I can use this book to further advance my knowledge of python

Hey - thanks I appreciate it. I'd take a look at the table of contents and see if any of the topics look familiar/unfamiliar to you. The preface excerpt ( http://media.pragprog.com/titles/dmpython/preface.pdf ) also has a bit more detail about what's in each of the chapters. The book's content is probably most useful for someone newer to Python, but I still think there might be value in it depending your background

Yup I definitely agree with you and hey thanks for replying

Re: Show HN: I wrote a book about Python

#32
post #30

Seeing as your title managed to land under the same publishing umbrella as (one of my own favorite programming books as well) The Pragmatic Programmer, do you have insight as to whether your title will also be made available on the O'Reilly platform?

Hi - that's a good question about the O'Reilly platform. I can ask my editor and get back to you on that. What's the best way to reach you?

Re: Show HN: I wrote a book about Python

#33
post #32
post #30

Seeing as your title managed to land under the same publishing umbrella as (one of my own favorite programming books as well) The Pragmatic Programmer, do you have insight as to whether your title will also be made available on the O'Reilly platform?

Hi - that's a good question about the O'Reilly platform. I can ask my editor and get back to you on that. What's the best way to reach you?

Thanks for the reply! You can write to me at usrme(at)protonmail.ch

Re: Show HN: I wrote a book about Python

#34

Earlier quoted context omitted.

I'm having a hard time seeing failure to take over mobile as a serious problem, any more than I see it as a serious problem that I can't take people waterskiing with my bicycle. I would even argue that many of the things that make my bike a terrible watercraft also happen to make it great as a light terrestrial vehicle. It's just possible that not every thing needs to be everything.

Does the wonderful bicycle analogy have grounding in the experience of Python? Are there things about Python that make it great as a general programming languages, but not for mobile. Perhaps the ease with which people reach for libs that wrap C? I dunno.

For starters, being just-in-time compiled makes for a nice short feedback cycle when you're developing. That's great for scripting, data science, exploratory development, even Web development since it facilitates a nice hot code reloading experience. But it also completely disqualifies it from running on iOS, which enforces a (understandable, IMO) ban on JITing.

I'm not interested in arguing about the relative merits of dynamic typing in any sort of absolute sense, but I will say that there are a lot of use cases where I like it, and they happen to overlap nicely with Python's core use cases. But they're also a problem on mobile, where you're more resource-constrained, including having to worry about battery usage. All that pointer chasing does have a cost.

On the other hand, non-GC languages like C, Rust and Swift make sense on mobile, where you want consistently low UI latency and you're trying to keep memory usage down. But there are lots of back-end development scenarios where I'd rather not have to think much about memory.

Re: Show HN: I wrote a book about Python

#36
post #23
post #21

Earlier quoted context omitted.

'Nuitka' might be what you're looking for

Hey, I did try it - it was how I got it to work at all. Relatively simpler than the alternatives, IMHO, but still suffering from the large executable size due to dependency cascades I'm at peace, now, with having to prune and bound my imports to account for that. But it is a negative thing that I have to change my code from what it'd normally be to make it remotely passable... This is definitely a relatively smalln a…

Perhaps https://pypi.org/project/treeshaker/ can help with that?

Re: Show HN: I wrote a book about Python

#37
post #13

On "Calling Other Programs with subprocess": It pains me that the default way to run an external command ( subprocess.run ) doesn't raise an exception for non-zero exit code violating the Zen of Python: "Errors should never pass silently. Unless explicitly silenced." Would it make it too advanced to show subprocess.Popen example with stdin=PIPE for providing input instead of writing to disk? Or an example on how to f…

Nonzero exit as an error is only a convention, no? I've definitely used CLI programs in the past that used nonzero codes to report all sorts of non-error statuses.

Re: Show HN: I wrote a book about Python

#38
post #37
post #13

On "Calling Other Programs with subprocess": It pains me that the default way to run an external command ( subprocess.run ) doesn't raise an exception for non-zero exit code violating the Zen of Python: "Errors should never pass silently. Unless explicitly silenced." Would it make it too advanced to show subprocess.Popen example with stdin=PIPE for providing input instead of writing to disk? Or an example on how to f…

Nonzero exit as an error is only a convention, no? I've definitely used CLI programs in the past that used nonzero codes to report all sorts of non-error statuses.

It's more than convention though.

if you run those commands in bash with `set -e` then the script will exit early when a command exits non-zero.

I often run: `set -euo noglob -o pipefail` which is a way of preventing cascading catastrophes with bash scripts.

Re: Show HN: I wrote a book about Python

#39
post #23

Earlier quoted context omitted.

Hey, I did try it - it was how I got it to work at all. Relatively simpler than the alternatives, IMHO, but still suffering from the large executable size due to dependency cascades I'm at peace, now, with having to prune and bound my imports to account for that. But it is a negative thing that I have to change my code from what it'd normally be to make it remotely passable... This is definitely a relatively smalln a…

Perhaps https://pypi.org/project/treeshaker/ can help with that?

I was not aware of this, thanks a lot! Will definitely look into it

Re: Show HN: I wrote a book about Python

#40
post #18
post #4

Earlier quoted context omitted.

I think Python definitely has its drawbacks, and it's not fast. The other downsides listed in that article (whitespace, variable scoping, lambdas, mobile, etc.) may also be get in your way sometimes, but seems doubtful that they are language killers...I agree the argument presented in that article is weak. I'm biased, but I think Python as your daily driver language is a great choice.

Preamble: I like Python - it seems to fit my mental models well, and I'm productive writing in it. However, only just recently I tried to develop a more-than-trivial program to deploy as an executable for my Windows-using friends. This may sound naive, but I'd never thought about how hard it is, especially when mostly everything else in Python is well-tooled, well-documented, and works. If you check my post history y…

The age old solution to this problem is to package the script plus the interpreter plus the dependencies in a glorified self-extracting ZIP file.

E.g. [pp], [py2exe].

[pp]: https://metacpan.org/pod/pp

[py2exe]:https://github.com/py2exe/py2exe

Post reply on HN