Pip freeze vs. pip list

A comparison of outputs reveals differences: Pip’s documentation states but what is “requirements format,” and why does pip list generate a more comprehensive list than pip freeze? Answer 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 do not specify ==1.4.2, the latest version available would be installed. You can read more in “Virtualenv

What do ellipsis […] mean in a list?

I was playing around in python. I used the following code in IDLE: The output was: What is this […]? Interestingly I could now use this as a list of list of list up to infinity i.e. I could write the above as long as I wanted and it would still work. EDIT: How is it represented in memory? What’s its use? Examples of some cases where it is useful would be helpful. Any link to official documentation would be really useful. Answer It means that you created an infinite list nested inside itself, which can not be printed. p

selecting attribute values from lxml

I want to use an xpath expression to get the value of an attribute. I expected the following to work but this gives an error : Am I wrong to expect this to work? Answer find and findall only implement a subset of XPath. Their presence is meant to provide compatibility with other ElementTree implementations (like ElementTree and cElementTree). The xpath method, in contrast, provides full access to XPath 1.0: However, you could instead use get: or attrib: