In this blog post we will explore Django testing and dynamically accessing attributes during unit…
Read MoreCategory: python
Do I need to indent my Python code? What about JavaScript?
JavaScript python quick-tipYes! Indentation, or leading white space at the beginning of a line is required in…
Read MoreDifference among list, tuple and set in Python and when to use each one
python quick-tipPython has three similar data structures that can hold an unordered collection of elements: list,…
Read MoreDebugging Python applications (plus free cheat sheet)
pythonMy primary debugging tool is to add print statements to my programs</confession_time>. Print statements are…
Read MoreAdd a filename in the command line when running a Python script
command line how-to python quick-tipOR: Run a Python script with arguments You can add arguments to the command line…
Read MoreDisplay nested dictionary content sorted by key in Python
how-to pythonGiven a nested dictionary like this: dog_breeds = { 'Labrador Retriever': {'life_span': 14, 'male_weight': '36…
Read MoreProfiling: check how long it takes to run a Python script
command line how-to python quick-tipFrom Python’s official documentation: “A profile is a set of statistics that describes how often and for…
Read MoreMap a string in Python with enumerate
python quick-tipProblem: create a map of the letters and indices in a string. My first approach was…
Read More