What does “\r” do in the following script?

The ‘\r’ character is the carriage return, and the carriage return-newline pair is both needed for newline in a network virtual terminal session. From the old telnet specification (RFC 854) (page 11): The sequence “CR LF”, as defined, will cause the NVT to be positioned at the left margin of the next print line (as would, for example, the … Read more

Getting TypeError: __init__() missing 1 required positional argument: ‘on_delete’ when trying to add parent table after child table with entries

You can change the property categorie of the class Article like this: and the error should disappear. Eventually you might need another option for on_delete, check the documentation for more details: EDIT: As you stated in your comment, that you don’t have any special requirements for on_delete, you could use the option DO_NOTHING:

Does Python have an ordered set?

There is an ordered set (possible new link) recipe for this which is referred to from the Python 2 Documentation. This runs on Py2.6 or later and 3.0 or later without any modifications. The interface is almost exactly the same as a normal set, except that initialisation should be done with a list. This is a MutableSet, so the … Read more

How to download a file over HTTP?

Use urllib.request.urlopen(): This is the most basic way to use the library, minus any error handling. You can also do more complex stuff such as changing headers. On Python 2, the method is in urllib2: