Python on Seasoned & Agilehttps://cito.github.io/tags/python/Recent content in Python on Seasoned & AgileHugoenThu, 26 Jan 2023 12:55:07 +0000Using GraphQL or REST, that is the questionhttps://cito.github.io/blog/shakespeare-with-graphql/Fri, 17 Aug 2018 17:00:00 +0100https://cito.github.io/blog/shakespeare-with-graphql/<img class="center half" src="https://cito.github.io/img/shakespeare-with-graphql-0.jpg" alt="Hamlet"> <p>This blog has been dormant for too long &ndash; it&rsquo;s time to post another article. In order to live up to the blog title, this article will combine some old and seasoned stuff (PostgreSQL and Shakespeare&rsquo;s works) with the latest trends for agile developers (GraphQL, asyncio and type hints for Python).</p>Ending the Epic Battle for Overlay Iconshttps://cito.github.io/blog/overlay-icon-battle/Fri, 13 Jan 2017 19:31:27 +0100https://cito.github.io/blog/overlay-icon-battle/<p>An epic battle is going on deep inside in the registry of my Windows PC. The combatants: Dropbox, Google Drive, OneDrive and the allied forces of TortoiseGit, TortoiseHg and TortoiseSVN. The weapons: blank spaces.</p> <p>Let me explain: As so often, wars start when there are certain scarce or indivisible resources that are in demand by multiple contenders. In this case, the resources are so-called &ldquo;overlay icons&rdquo;. These are the tiny additions displayed in the lower left corner of the symbols for files and folders in the Windows explorer, like the small arrow that indicates a shortcut. Some third-party tools like TortoiseGit or Dropbox make also good use of them to show the state of the files in the registry or the cloud, like whether the file has been changed, is not yet synchronized and so on.</p> <img class="center" src="https://cito.github.io/img/overlay-icon-battle.png" alt="Overlay Icons">Never Iterate a Changing Dicthttps://cito.github.io/blog/never-iterate-a-changing-dict/Sat, 07 Jan 2017 19:52:45 +0100https://cito.github.io/blog/never-iterate-a-changing-dict/<p>Yesterday I noticed a bug in a Python program that only appeared when running it with the new Python 3.6.</p> <img class="center half" src="https://cito.github.io/img/never-iterate-a-changing-dict.jpg" alt="A slippery slope"> <p>It turned out that the program had been running a slippery slope all the time.</p>Python and the 36 Towershttps://cito.github.io/blog/python-36-towers/Tue, 27 Dec 2016 17:10:27 +0100https://cito.github.io/blog/python-36-towers/<p>This year my brother&rsquo;s family sent us a puzzle in their Christmas package, mentioning that they already solved it and we should give it a try over the Christmas holidays, too. The puzzle is called &ldquo;36 Cube&rdquo; and looks like this:</p> <img class="center half" src="https://cito.github.io/img/python-36-towers-1.jpg" alt="36 Cube"> <p>The &ldquo;36 Cube&rdquo; consists of a board with a 6x6 grid of tower stubs and 36 towers in 6 different heights and colors which need to be stacked on the stubs so that they all have the same height, forming a cube like in the picture. Also, no two towers of the same color may appear in the same row or column - similar to a Sudoku puzzle.</p> <p>The puzzle looked tricky already, but it turned out it was even trickier than I first thought.</p>The new f-strings in Python 3.6https://cito.github.io/blog/f-strings/Sat, 24 Dec 2016 09:00:00 +0100https://cito.github.io/blog/f-strings/<img class="center half" src="https://cito.github.io/img/f-strings-0.jpg" alt="Benchmark results"> <p>Hurray! It&rsquo;s Christmas time - and Python 3.6 has been released!</p> <p>One of the <a href="https://docs.python.org/3.6/whatsnew/3.6.html">many goodies</a> packed into the new release are <a href="https://docs.python.org/3.6/reference/lexical_analysis.html#f-strings">formatted string literals</a>, or simply called &ldquo;f-strings&rdquo;. In this blog post I&rsquo;ll explain why this is good news.</p>