<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
  <channel>
    <title>python on netcup hosting blog</title>
    <link>https://en.netcup.nllk.net/blog/categories/python/</link>
    <description>Recent content in python on netcup hosting blog</description>
    <generator>Hugo -- gohugo.io</generator>
    <language>en</language>
    <lastBuildDate>Mon, 31 Aug 2026 00:00:00 +0000</lastBuildDate><atom:link href="https://en.netcup.nllk.net/blog/categories/python/index.xml" rel="self" type="application/rss+xml" />
    <item>
      <title>How to concatenate two lists in Python</title>
      <link>https://en.netcup.nllk.net/blog/post/0058-python-concatenate-lists/</link>
      <pubDate>Mon, 31 Aug 2026 00:00:00 +0000</pubDate>
      
      <guid>https://en.netcup.nllk.net/blog/post/0058-python-concatenate-lists/</guid>
      
        <description>This article shows how to concatenate two lists in Python and why &#43; and &#43;= behave differently for anyone else holding the list.</description>
      
    </item>
    
    <item>
      <title>How to copy a file in Python</title>
      <link>https://en.netcup.nllk.net/blog/post/0060-python-copy-file/</link>
      <pubDate>Mon, 31 Aug 2026 00:00:00 +0000</pubDate>
      
      <guid>https://en.netcup.nllk.net/blog/post/0060-python-copy-file/</guid>
      
        <description>This article shows how to copy a file in Python, what each shutil function preserves, and the Path.copy method added in Python 3.14.</description>
      
    </item>
    
    <item>
      <title>Why a mutable default argument in Python is shared between calls</title>
      <link>https://en.netcup.nllk.net/blog/post/0059-python-mutable-default-argument/</link>
      <pubDate>Mon, 31 Aug 2026 00:00:00 +0000</pubDate>
      
      <guid>https://en.netcup.nllk.net/blog/post/0059-python-mutable-default-argument/</guid>
      
        <description>This article explains why a mutable default argument in Python is shared between calls, where the value actually lives, and when None is not enough.</description>
      
    </item>
    
    <item>
      <title>Does Python have a ternary conditional operator?</title>
      <link>https://en.netcup.nllk.net/blog/post/0040-python-ternary-operator/</link>
      <pubDate>Sat, 29 Aug 2026 00:00:00 +0000</pubDate>
      
      <guid>https://en.netcup.nllk.net/blog/post/0040-python-ternary-operator/</guid>
      
        <description>This article shows Python&#39;s ternary conditional expression, why the older and/or and tuple tricks are worse, and where the precedence catches you out.</description>
      
    </item>
    
    <item>
      <title>How slicing works in Python</title>
      <link>https://en.netcup.nllk.net/blog/post/0046-python-slicing/</link>
      <pubDate>Sat, 29 Aug 2026 00:00:00 +0000</pubDate>
      
      <guid>https://en.netcup.nllk.net/blog/post/0046-python-slicing/</guid>
      
        <description>This article explains Python&#39;s slice syntax, why slices never raise IndexError and why a slice copy is only shallow.</description>
      
    </item>
    
    <item>
      <title>How to access the index in a Python for loop</title>
      <link>https://en.netcup.nllk.net/blog/post/0048-python-loop-index/</link>
      <pubDate>Sat, 29 Aug 2026 00:00:00 +0000</pubDate>
      
      <guid>https://en.netcup.nllk.net/blog/post/0048-python-loop-index/</guid>
      
        <description>This article shows how to get the index in a Python for loop with enumerate, and what goes wrong when you modify the list while iterating.</description>
      
    </item>
    
    <item>
      <title>How to check if a list is empty in Python</title>
      <link>https://en.netcup.nllk.net/blog/post/0055-python-check-list-empty/</link>
      <pubDate>Sat, 29 Aug 2026 00:00:00 +0000</pubDate>
      
      <guid>https://en.netcup.nllk.net/blog/post/0055-python-check-list-empty/</guid>
      
        <description>This article shows how to check whether a list is empty in Python, what else the idiomatic check catches, and why it does not work on generators.</description>
      
    </item>
    
    <item>
      <title>How to create a directory and its missing parents in Python</title>
      <link>https://en.netcup.nllk.net/blog/post/0049-python-create-directory/</link>
      <pubDate>Sat, 29 Aug 2026 00:00:00 +0000</pubDate>
      
      <guid>https://en.netcup.nllk.net/blog/post/0049-python-create-directory/</guid>
      
        <description>This article shows how to create a directory and any missing parent directories in Python, and why checking whether it exists first is a race condition.</description>
      
    </item>
    
    <item>
      <title>How to find the index of an item in a Python list</title>
      <link>https://en.netcup.nllk.net/blog/post/0044-python-list-index/</link>
      <pubDate>Sat, 29 Aug 2026 00:00:00 +0000</pubDate>
      
      <guid>https://en.netcup.nllk.net/blog/post/0044-python-list-index/</guid>
      
        <description>This article shows how to find the index of an item in a Python list, how to handle a missing item, and when to stop using list.index() altogether.</description>
      
    </item>
    
    <item>
      <title>How to flatten a list of lists in Python</title>
      <link>https://en.netcup.nllk.net/blog/post/0045-python-flatten-list/</link>
      <pubDate>Sat, 29 Aug 2026 00:00:00 +0000</pubDate>
      
      <guid>https://en.netcup.nllk.net/blog/post/0045-python-flatten-list/</guid>
      
        <description>This article shows how to flatten a list of lists in Python, why sum(nested, []) is quadratic and how a recursive flatten crashes on strings.</description>
      
    </item>
    
    <item>
      <title>How to get the current date and time in Python</title>
      <link>https://en.netcup.nllk.net/blog/post/0042-python-current-time/</link>
      <pubDate>Sat, 29 Aug 2026 00:00:00 +0000</pubDate>
      
      <guid>https://en.netcup.nllk.net/blog/post/0042-python-current-time/</guid>
      
        <description>This article shows how to get the current date and time in Python, why datetime.now() alone is not enough and why utcnow() is now deprecated.</description>
      
    </item>
    
    <item>
      <title>How to iterate over rows in a Pandas DataFrame</title>
      <link>https://en.netcup.nllk.net/blog/post/0051-python-pandas-iterate-rows/</link>
      <pubDate>Sat, 29 Aug 2026 00:00:00 +0000</pubDate>
      
      <guid>https://en.netcup.nllk.net/blog/post/0051-python-pandas-iterate-rows/</guid>
      
        <description>This article shows how to iterate over rows in a Pandas DataFrame, how much it costs compared to vectorising, and why writing to the row does nothing.</description>
      
    </item>
    
    <item>
      <title>How to merge two dictionaries in Python</title>
      <link>https://en.netcup.nllk.net/blog/post/0039-python-merge-dicts/</link>
      <pubDate>Sat, 29 Aug 2026 00:00:00 +0000</pubDate>
      
      <guid>https://en.netcup.nllk.net/blog/post/0039-python-merge-dicts/</guid>
      
        <description>This article shows how to merge two dictionaries in Python in a single expression, and why the result is shallower than you might expect.</description>
      
    </item>
    
    <item>
      <title>How to pass a variable by reference in Python</title>
      <link>https://en.netcup.nllk.net/blog/post/0052-python-pass-by-reference/</link>
      <pubDate>Sat, 29 Aug 2026 00:00:00 +0000</pubDate>
      
      <guid>https://en.netcup.nllk.net/blog/post/0052-python-pass-by-reference/</guid>
      
        <description>This article explains how Python passes arguments, why the mutable-versus-immutable framing is misleading and what &#43;= really does.</description>
      
    </item>
    
    <item>
      <title>How to rename columns in a Pandas DataFrame</title>
      <link>https://en.netcup.nllk.net/blog/post/0054-python-pandas-rename-columns/</link>
      <pubDate>Sat, 29 Aug 2026 00:00:00 +0000</pubDate>
      
      <guid>https://en.netcup.nllk.net/blog/post/0054-python-pandas-rename-columns/</guid>
      
        <description>This article shows how to rename Pandas DataFrame columns, why rename() fails silently on a typo and how duplicate column names change what df[&#39;x&#39;] returns.</description>
      
    </item>
    
    <item>
      <title>How to run a program or system command from Python</title>
      <link>https://en.netcup.nllk.net/blog/post/0037-python-run-shell-command/</link>
      <pubDate>Sat, 29 Aug 2026 00:00:00 +0000</pubDate>
      
      <guid>https://en.netcup.nllk.net/blog/post/0037-python-run-shell-command/</guid>
      
        <description>This article shows how to call an external program from Python using subprocess.run, and what shell=True really costs you.</description>
      
    </item>
    
    <item>
      <title>How to sort a dictionary by value in Python</title>
      <link>https://en.netcup.nllk.net/blog/post/0053-python-sort-dict-by-value/</link>
      <pubDate>Sat, 29 Aug 2026 00:00:00 +0000</pubDate>
      
      <guid>https://en.netcup.nllk.net/blog/post/0053-python-sort-dict-by-value/</guid>
      
        <description>This article shows how to sort a dictionary by value in Python, how to break ties, and how to sort by one field descending and another ascending.</description>
      
    </item>
    
    <item>
      <title>How to split a list into equally-sized chunks in Python</title>
      <link>https://en.netcup.nllk.net/blog/post/0043-python-split-list-chunks/</link>
      <pubDate>Sat, 29 Aug 2026 00:00:00 +0000</pubDate>
      
      <guid>https://en.netcup.nllk.net/blog/post/0043-python-split-list-chunks/</guid>
      
        <description>This article shows how to split a list into chunks in Python using itertools.batched, and why the old zip_longest recipe gives a different result.</description>
      
    </item>
    
    <item>
      <title>How to upgrade all Python packages with pip</title>
      <link>https://en.netcup.nllk.net/blog/post/0047-python-upgrade-all-packages/</link>
      <pubDate>Sat, 29 Aug 2026 00:00:00 +0000</pubDate>
      
      <guid>https://en.netcup.nllk.net/blog/post/0047-python-upgrade-all-packages/</guid>
      
        <description>This article shows how to upgrade all installed packages with pip, why the popular one-liner is fragile and how upgrading one at a time can break your environment.</description>
      
    </item>
    
    <item>
      <title>How to use a global variable in a Python function</title>
      <link>https://en.netcup.nllk.net/blog/post/0056-python-global-variable/</link>
      <pubDate>Sat, 29 Aug 2026 00:00:00 +0000</pubDate>
      
      <guid>https://en.netcup.nllk.net/blog/post/0056-python-global-variable/</guid>
      
        <description>This article explains the global keyword in Python, why assigning to a name makes it local for the whole function, and when you do not need global at all.</description>
      
    </item>
    
    <item>
      <title>The difference between __str__ and __repr__ in Python</title>
      <link>https://en.netcup.nllk.net/blog/post/0057-python-str-vs-repr/</link>
      <pubDate>Sat, 29 Aug 2026 00:00:00 +0000</pubDate>
      
      <guid>https://en.netcup.nllk.net/blog/post/0057-python-str-vs-repr/</guid>
      
        <description>This article explains the difference between __str__ and __repr__ in Python, which one containers use, and why you should define __repr__ first.</description>
      
    </item>
    
    <item>
      <title>The difference between @staticmethod and @classmethod in Python</title>
      <link>https://en.netcup.nllk.net/blog/post/0050-python-staticmethod-classmethod/</link>
      <pubDate>Sat, 29 Aug 2026 00:00:00 +0000</pubDate>
      
      <guid>https://en.netcup.nllk.net/blog/post/0050-python-staticmethod-classmethod/</guid>
      
        <description>This article explains the difference between @staticmethod and @classmethod in Python, and why alternative constructors have to be classmethods.</description>
      
    </item>
    
    <item>
      <title>What if __name__ == &#34;__main__&#34;: does in Python</title>
      <link>https://en.netcup.nllk.net/blog/post/0038-python-name-main/</link>
      <pubDate>Sat, 29 Aug 2026 00:00:00 +0000</pubDate>
      
      <guid>https://en.netcup.nllk.net/blog/post/0038-python-name-main/</guid>
      
        <description>This article explains what if __name__ == &#34;__main__&#34;: does in Python, why you want it, and the trap of a module being loaded twice.</description>
      
    </item>
    
    <item>
      <title>What metaclasses are in Python</title>
      <link>https://en.netcup.nllk.net/blog/post/0041-python-metaclasses/</link>
      <pubDate>Sat, 29 Aug 2026 00:00:00 +0000</pubDate>
      
      <guid>https://en.netcup.nllk.net/blog/post/0041-python-metaclasses/</guid>
      
        <description>This article explains what a metaclass is in Python, when its hooks run, and why __init_subclass__ is usually the better answer.</description>
      
    </item>
    
    <item>
      <title>What the yield keyword does in Python</title>
      <link>https://en.netcup.nllk.net/blog/post/0036-python-yield-keyword/</link>
      <pubDate>Sat, 29 Aug 2026 00:00:00 +0000</pubDate>
      
      <guid>https://en.netcup.nllk.net/blog/post/0036-python-yield-keyword/</guid>
      
        <description>This article explains what the yield keyword does in Python, what a generator is and where the memory savings actually come from.</description>
      
    </item>
    
  </channel>
</rss>
