10 ms·
Intermediate Python
- p1esk 11y agoAnother "Intermediate Python" book: http://www.amazon.com/dp/149055095X http://www.amazon.com/dp/149055095X
- yasoob 11y agoThat is totally different from my book :) I haven't read it so I can not tell how much different it is from mine. Perhaps you can tell if you have read it?
- iheartmemcache 11y agoI was right about to buy it, completely blind, based on the similar title, because a good deed deserves a good deed: I support anyone who gives their book away for free online and offers a hard-copy (Learn You a Haskell, I'm looking at you) for purchase. Let me know if you have an Amazon affiliate link, tipjar, or need help with any projects. Edit: whoa, at least 5 redditors had the same "do you have a paypal?" sentiment. I suggest you have a header on visit and start collecting opt-in emails. That way, people like me will be emailed the second you get all setup. Edit 2: Also, this definitely is a good "resume" for consulting work. I'd put an "Available for Hire/Retainer" notice at the header of every page, in case someone has an overflow of work, and/or a corporate manager wants a flexible contractor asset available as an insurance policy for behind-schedule projects. Don't charge less than 150/hr in 20 hour blocks per month for retainer work (use it or lose it), and 175ish/hr for active work.
- c4obi 11y agohttps://leanpub.com/intermediatepython https://leanpub.com/intermediatepython author here.. Did you get to take a look at the book? It is actually free of charge on Leanpub
- yasoob 11y agoYou guys can donate me if you want to by buying the donation version of Intermediate Python from [@gumroad](https://gumroad.com/l/intermediate_python https://gumroad.com/l/intermediate_python) :) It is only for $10 but if you want to pay less then kindly let me know (pm) and I can give you a custom link. Cheers!
- p1esk 11y agoI think your book goes for breadth of topics while his primarily focuses on solid understanding of iterators, generators, and decorators. p.s. I only looked at the "Enumeration" page in your book, and I don't think it belongs in an "intermediate" level Python book. The use of optional arguments makes little sense to me (not something I wanted to know about Python after I learned the basics). I'm sure other chapters have more relevant content though, and I appreciate your effort.
- heyalexej 11y agoI consider myself somewhere in the spectrum between beginner and intermediate and I use enumeration quite often. I picked it up early on in a tutorial by Andrew Montalenti (founder of http://www.parsely.com http://www.parsely.com and quite active in the Python community) and use it ever since instead of wrapping it into another loop like beginner tutorials teach you. For example if I need to read in a file with 5 million lines but for debugging or performance optimization reasons want to break the loop after 1K lines.
- p1esk 11y agoAll beginner tutorials I used introduced "enumerate" early on. Indexing is probably the first thing you're wondering about when you start coding in Python after coding in C.
- ynak 11y agoIs this another book, too? https://leanpub.com/intermediatepython https://leanpub.com/intermediatepython very confusing
- c4obi 11y agoAuthor here! This is totally unrelated to the posted book.
- heyalexej 11y agoFrom related Reddit thread[0]: Note: This is not related with that paid "intermediate Python" book in any way. I became aware of it today. I had been using this name internally for a couple of months. If the author of paid "Intermediate Python" has any issue with this I would be more than happy to change the name of my book because he definitely beated me to the finish line. :) [0] http://redd.it/3hbb46 http://redd.it/3hbb46
- segmondy 11y agoI think you should change it to reduce confusion. "Intermediate Python Programming" should be good enough.
- mtinkerhess 11y agoOn the other hand, the name "Intermediate Python" is so generic that whoever wrote the book shouldn't be surprised there are other documents using the same name.
- c4obi 11y agoA little correction here; intermediate python on leanpub is absolutely free.
- yasoob 11y agoHey! I am sorry. I realized that just now after reading your comment. :)
- yasoob 11y agoHi guys! I am the author of this book. Thanks heyalexej for posting this here. If there is anything I can help you guys with then kindly let me know. :)
- mhurron 11y agoThank you for making the PDF available.
- yasoob 11y agoYou are welcome kind stranger! :)
- camperman 11y agoWhere can I download it please? Edit: Never mind - I hadn't noticed you've added targets to the Makefile :) Thanks.
- cJ0th 11y agoYes, thank you indeed. I found it very helpful and easy to digest.
- pknerd 11y agoLink pls?
- yasoob 11y ago[Here is the link](http://readthedocs.org/projects/intermediatepythongithubio/downloads/pdf/latest/ http://readthedocs.org/projects/intermediatepythongithubio/d...). :) Cheers!
- bwy 11y agoJust read the entire thing, good stuff! Interesting to see what's considered intermediate vs. basic and advanced. Feedback: maybe add a feedback section to the site? Haha. Dissect is spelled with 2 S's, and there's a broken link at the end of the virtualenv section. Thanks for your work! Learned a few things for sure.
- TheGRS 11y agoThis looks great just from glancing over the table of contents. I picked up Python nearly a year ago and I am a pretty novice programmer at best. Over time I've learned stuff like decorators, lambas, args/kwargs and other stuff that you generally don't find in the "Intro to Python" books, but its all been through stumbling into the right place. Thanks for sharing, I may have something to read this week :)
- vchynarov 11y agoIt's interesting how a search for "metaclasses" in the given link doesn't yield any results.
- yasoob 11y agoThat is advanced level stuff :) If you want to add it to this book then kindly go ahead. This book is open source.
- FilterSweep 11y agoIt's certainly an arduous task to determine what is intermediate and what isn't! And I think you did an excellent job, from looking at the table of contents (I'll have to take a closer look and have booked marked it for later). Unlike some the above posters, I learned metaclasses relatively early, but there are definitely some things in this book which I haven't seen before. Thank you.
- mhurron 11y agoPerhaps the author thought metaclasses are Advanced Python.
- rectangletangle 11y agoI'd tend to agree. I've been writing Python for years, and I still haven't had a legitimate use for them. Not to say that there's no use for them, they're handy when implementing an ORM. However, it's not often that you'd need to do something like that.
- pfranz 11y agoThat's a pretty advanced topic. Like a lot of advanced (and some intermediate) topics, you read a bunch of varying documentation and play around with it yourself before you get a good grasp. For me, one of the more useful things were these slides that talk more about the when and why instead of the how: http://www.vrplumber.com/programming/metaclasses.pdf http://www.vrplumber.com/programming/metaclasses.pdf
- opmac 11y agoReally good stuff here, and well put together.
- yasoob 11y agoI have put a link to a mailing list. If you want to tip me then kindly signup over there and I would let you know once I have a tip receiving system in place. I already run a reputed [Python Weekly Newsletter](http://newsletter.pythontips.com/ http://newsletter.pythontips.com/) so you are in a good company (meaning I won't spam you). Mailing list: http://eepurl.com/bwjcej http://eepurl.com/bwjcej
- rectangletangle 11y agofrom contextlib import contextmanager I love this feature, I never forget to close a connection. It can also be useful for monkey patching, or thread local variable based optimizations.
- jqm 11y agoI like it. Really good. The only point, I might not consider lists being mutable nor global values vs values returned from a function intermediate topics. Those are beginner topics I think.. one would have a hard time using the language almost at all without understanding them. I would say the part about decorators and kwargs args is more intermediate level. Anyone who gets to that probably already understands global variables and the fact certain data structures are mutable. But not abuse your work. The book is nice. I learned a couple of things.
- yasoob 11y agoHey! There is no problem with correcting me. If you think that I missed something or if there is something that can be improved and you think that you can make it much better then submit a pull request if you can. :) I would be more than happy to accept it. Here is the GitHub repo: https://github.com/IntermediatePython/intermediatePython https://github.com/IntermediatePython/intermediatePython
- bpicolo 11y agoArguable. I doubt most intermediate programmers know much about tuple/string immutability
- objectified 11y agoReally good stuff in here, thanks for this. Are there any plans to follow this up with something along the lines of "Advanced Python"?
- yasoob 11y agoI don't have any plans right now but I might think about it.
- SEJeff 11y agoJust go read David Beazely's site for that. Seriously http://www.dabeaz.com/blog.html http://www.dabeaz.com/blog.html A few good ones for reference: http://www.dabeaz.com/generators/ http://www.dabeaz.com/generators/ https://www.youtube.com/watch?v=fwzPF2JLoeU https://www.youtube.com/watch?v=fwzPF2JLoeU
- yasoob 11y agoI love his work and I honestly recommend it to you guys! :)
- 3pt14159 11y agoMap and filter are looked down upon by some Python devs because they prefer list comprehensions. If you don't need the laziness (in Python 3 only), you probably shouldn't use them because some don't consider them idiomatic. See this for more information: http://stackoverflow.com/a/6407222/384700 http://stackoverflow.com/a/6407222/384700
- ggchappell 11y ago> If you don't need the laziness (in Python 3 only), you probably shouldn't use them .... And if you do need the laziness, then you can use generator comprehensions.
- hoov 11y agoYeah, map and filter not really idiomatic; you're almost always better served by a list/generator comprehension. Even Guido has regrets about map/filter/reduce: http://legacy.python.org/doc/essays/ppt/regrets/PythonRegrets.ppt http://legacy.python.org/doc/essays/ppt/regrets/PythonRegret....
- 699 11y agoThat's a bummer, actually. "filter(thing, None)" is far prettier than "[thing for thing in things if thing is not None]" :(
- 0x29A- 11y agoIs there anything like this site for Java?
- Scarbutt 11y agoEffective Java by Joshua Bloch
- leni536 11y agoI just skimmed through decorators. I don't use python too much and decorators always seemed a little bit black magic for me. Thanks for proving this wrong.
- snurk 11y agoShit, what I need is "How to publish a package to PyPi in 3 easy steps." I go around and round with the Python Packaging Authority's documentation.
- damon_c 11y agoI learned from this: http://peterdowns.com/posts/first-time-with-pypi.html http://peterdowns.com/posts/first-time-with-pypi.html Not bad.
- snurk 11y agothanks! that looks super easy. last time i tried, i rage-quit.
- Wilduck 11y agoIt has been much more difficult in the past, as recently as 2013, there were a number of different tools competing to be the standard method of packaging python. It's pretty smooth sailing at this point. I actually gave a lightning talk on this topic a couple months ago. Here are my slides, in case they're useful: https://docs.google.com/presentation/d/13Cd-LIcw38d-zwZ5pGiWmAtmaxXeamyDe3oe13Le3dw/edit?usp=sharing https://docs.google.com/presentation/d/13Cd-LIcw38d-zwZ5pGiW...
- kevin_thibedeau 11y agoIt's not bad unless you want to upload detached signatures. Then it's a frantic search to find the right incantation to make it work.
- peter_l_downs 11y agoThanks! If you have any suggestions / feedback I'd be happy to hear it – I've been planning on updating the post sometime soon to show how to upload wheels and in general just clean up the language and approach.
- sateesh 11y agoI see that that the book has a section on usage of For-Else construct. Personally I found this construct to be confusing, and avoid its usage as one can achieve the same by setting a flag (say). Is this construct much used ?
- jeremiecoullon 11y agoThanks for this! It's really good to have intermediate stuff all in one place, rather than tutorials on a specific topic
- omegote 11y agoNice, I've shared it in my social networks. As for a supposed "Advanced Python" edition, it would be great to compile at least a list of topics that could be interesting. Some have been already mentioned in this thread, like: - Metaclasses - Packaging (for pypi) I'd add: - Must-have libraries - Testing
- tdfx 11y agoThere is "Expert Python Programming" (https://www.packtpub.com/application-development/expert-python-programming https://www.packtpub.com/application-development/expert-pyth...). Some of the material is dated, but I'm sure it would be a good place to start as far as gathering topics for further study.
- Poiesis 11y agoAsyncio, for sure.
- alexchamberlain 11y agoWhilst I don't buy into the TDD fad, Testing should not be an advanced topic.
- crdoconnor 11y agoWhat don't you buy about TDD?
- ersii 11y agoTest Driven Development (TDD) may or may not be a fad. Regardless, one can always have testing in ones development work. That doesn't mean you're driven by the tests. Edit: On second thought, I read your comment sloppily. I agree, testing in itself isn't an advanced topic and I'd recommend a section on some testing :-)
- olenhad 11y agoGreat job @yasoob! What's even more amazing, even thought not directly relevant, is that the author is still in high school.
- nstart 11y agoBrilliant. Every language should have a book like this. I'm already learning a lot of little details about features I've had some passing experience on. Only request I have (which I generally have for stuff like this), is for real life use cases. Example would be args and *kwargs being used in decorators. Where do you use it? What's a real life example of it being used? How does that compare to the in built decorator functionality of Python? Answering this type of question helps people understand the technique and theory in equal measures as opposed to more theory than technique. Thanks again for this :).
- n0us 11y agoI use decorators like that in Django where I want to reuse the same code to check something on the request object but the functions I am decorating expect keyword arguments
- nstart 11y agoI've been thinking of something like this for models especially. Where I have made my own models and worked with Flask, but now need to integrate the Django framework. Just a vague idea though. Haven't formed a clear picture of how I'll do it at all
- armandg 11y agoI usually search in code in github for IRL-examples. Sometimes it works just as good.
- satai 11y agoFor Java I can recommend Effective Java, that does similar stuff - expects you the basics and shows you idioms and "the right way". Now I search for a similar book for Haskell
- SEJeff 11y agoAnd if anyone wants to add / enhance this here you go: https://github.com/IntermediatePython/intermediatePython https://github.com/IntermediatePython/intermediatePython
- potatosareok 11y agoAnother useful brief overview - http://python.net/~goodger/projects/pycon/2007/idiomatic/handout.html http://python.net/~goodger/projects/pycon/2007/idiomatic/han...
- teekert 11y agoI love it, as a biologist I did a Python course some months ago, already I'm much more productive than I was in my Origin/Excel time. this books really clarifies many of those strange things (like kwargs etc). This is going straight into my favorites and I know I'll be using it often. Thanx!!!
- yasoob 11y agoI love to read such comments. They help to fuel me. :) Let me know how you use this book! And kindly share it with your peers. Best of luck!
- whocanfly 11y agoThis is great! You can make an ipython notebook version of this too.
- yasoob 11y agoYou guys can donate me if you want to by buying the donation version of Intermediate Python from [@gumroad](https://gumroad.com/l/intermediate_python https://gumroad.com/l/intermediate_python) :) It is only for $10 but if you want to pay less then kindly let me know (pm) and I can give you a custom link. Cheers!