Converting dictionary to JSON

json.dumps() converts a dictionary to str object, not a json(dict) object! So you have to load your str into a dict to use it by using json.loads() method See json.dumps() as a save method and json.loads() as a retrieve method. This is the code sample which might help you understand it more:

Cannot find module cv2 when using OpenCV

I have installed OpenCV on the Occidentalis operating system (a variant of Raspbian) on a Raspberry Pi, using jayrambhia’s script found here. It installed version 2.4.5. When I try import cv2 in a Python program, I get the following message: The file cv2.so is stored in /usr/local/lib/python2.7/site-packages/… There are also folders in /usr/local/lib called python3.2 … Read more

Pip freeze vs. pip list

When you are using a virtualenv, you can specify a requirements.txt file to install all the dependencies. A typical usage: The packages need to be in a specific format for pip to understand, which is That is the “requirements format”. Here, django==1.4.2 implies install django version 1.4.2 (even though the latest is 1.6.x). If you … Read more