Category Archives: Python

4 database abstraction layers for Python

Some examples of Database abstraction layers for Python. Continue reading

Posted in Python | Tagged , , | Leave a comment

How to sort Python dictionary

Sorting a Python dictionary. Continue reading

Posted in Python | Tagged , , , , | 2 Comments

Unzip a Python list

Suppose that you have a Python list with tuples as the member. We can unzip the list by using zip() in conjunction with the * operator. Continue reading

Posted in Python | Tagged , , , , | 1 Comment

A simple way to time a small bits of Python code

A simple way to time a small bits of Python code is by using the time module. Continue reading

Posted in Python | Tagged , | Leave a comment

How to convert two Python lists into a dictionary

To convert two Python lists into a dictionary. First, pair the two list with the zip() function, as key-value pairs. The last step is to use the dict() constructor to build a dictionary directly from the key-value pairs. Continue reading

Posted in Python | Tagged , , , , | Leave a comment