If you look into a page of a subprocess module you find a few red boxes warning you that shell=Trueis insecure. Malicious user may use shfeatures to execute unexpected code and so on.
shell=True
sh
You’re head down, working on a new project and one of your dependencies still doesn’t support Python 3 — argh!
Here’s a quick guide on how to solve that problem, step by step.
On my record collecting website, Recordbin, I am using a macro to build tables of user’s record collections. The macro has a few specific arguments that are required, but depending on the situation I might need to pass it other variables. I need some of the tables to have a…
Every time I write a test there is a decision whether to use mocks or not.
Unit test should be a pure function. It shouldn’t depend on anything and shouldn’t change anything. It’s just a validation of…
I am running a Flask site on my local machine and I want to display some data from an API. In this case, I want to use the Qualtrics API to display survey data that was collected the previous day. I should be able to use Jquery to send a GET request…
What are python generators and how do they work?
Generators are a python feature that became standard in Python 2.3. Along with the generator came the yield keyword. One simple way I think about Python generators is that they are a way to…
yield
I’m excited to show you all a whole new world of Generators in Python and hopefully inject a little bit of math into all your lives (cause…
A few weeks ago, I was looking for a personal project in order to improve my expertise along the “value chain” of computer science. I wanted to code a project encompassing different skills and programming languages, from end to end.
Often there is a need for Python developers to upload their work (code) in Python’s huge repository -PyPI. I had run into the same problem. But somehow, after some tweaking I was able to complete this simple but tricky task.