Python on terriblecode https://terriblecode.com/tags/python/ Recent content in Python on terriblecode Hugo -- gohugo.io en-US Tue, 04 Apr 2017 19:48:47 -0500 Dockerizing Python Test Environments https://terriblecode.com/blog/dockerizing-python-test-environments/ Tue, 04 Apr 2017 19:48:47 -0500 https://terriblecode.com/blog/dockerizing-python-test-environments/ Context It’s every maintainer’s nightmare to see these types of failures on PR’s. Nothing in the code base had changed and tests were passing locally, but almost every build we pushed through was failing. I spent so long trying to figure out why they were failing on Travis CI but not on my local machine, but could not find any reason why it was actually happening. Then, I did what any developer would do in a similar situation: I spun up a virtual machine close to what Travis CI would be like and tried to recreate the steps through there. Asynchronous HTTP Requests in Python https://terriblecode.com/blog/asynchronous-http-requests-in-python/ Sat, 25 Feb 2017 14:18:57 -0600 https://terriblecode.com/blog/asynchronous-http-requests-in-python/ Overview Asynchronous programming is a new concept for most Python developers (or maybe it’s just me) so utilizing the new asynchronous libraries that are coming out can be difficult at least from a conceptual point of view. The library I’ll be highlighting today is aiohttp. If you’re familiar with the popular Python library requests you can consider aiohttp as the asynchronous version of requests. Usage is very similar to requests but the potential performance benefits are, in some cases, absolutely insane. Why ptpython is the only REPL you will ever need https://terriblecode.com/blog/why-ptpython-is-the-only-repl-you-will-ever-need/ Tue, 13 Dec 2016 22:15:12 -0600 https://terriblecode.com/blog/why-ptpython-is-the-only-repl-you-will-ever-need/ Some backstory For a few months when I first started developing with python I was using ipython for all of my REPL needs for python. At the time nothing really competed with ipython. However I had a few gripes: Multiline editing and history was non-existent (If you defined a function, good luck re-editing it) Auto-completion didn’t function like most text editors do, with completion showing a pop-up of all available options Pulling code in the REPL into a text editor was spotty at best So imagine my surprise when I found a little python REPL named ptpython courtesy of reddit’s own /r/python