Kali Linux - How to upgrade python 2.7 to python 3.7

Note: Python 2.7 reached end-of-life in January 2020 and Python 3.7 followed in June 2023. On current Kali Linux, Python 3 is the default — python3 is available out of the box and python typically symlinks to it already. This article is kept for historical reference and for anyone on older installations. I have covered changing the default version of python in Debian, however for those looking to Google for a quick fix on Kali, I hope that this reaches you well. ...

November 26, 2019 · 2 min · Tom

Ubuntu 19.10 - How to upgrade python 2.7 to python 3.7

Note: This article covers Ubuntu 19.10 and Python 2.7, both of which are end-of-life. Ubuntu 19.10 reached EOL in July 2020; Python 2.7 reached EOL in January 2020. If you’re on a current Ubuntu LTS (22.04 or 24.04), Python 3 is the default — no changes needed. This article is kept for historical reference. Much to my surprise, I found that a fresh install of Ubuntu 19.10 was set to use python 2.7 as the default python instance. ...

November 24, 2019 · 2 min · Tom

Getting started with Python 3 - a beginner's cheat sheet

Python.Org I have been getting started with python 3 – I want to make this my primary scripting language. One way I like to assist myself whilst I learn the rope is to maintain a crib sheet filled with all the trivial things I would otherwise forget. Python 3 Cheat Sheet #Define Variables programming_languages: "Python", "VB", "C++", "C#" #Print Variables print(programming_languages) print('--------------------') #Basic for loop + variables for language in programming_languages: print(language) print('--------------------') #Basic Function def FuncExample(): i: 1 for language in programming_languages: #Concatinate Strings and Integers in print statements print("Language " + str(i) + ":" + language) #Increment Integer i += 1 FuncExample() print('--------------------') #Functions with Variables #1 - Strings def FuncVarExample1(fname, lname): #Print with CRLF print("First Name: " + fname + "\r\n" + "Last Name: " + lname) FuncVarExample1("Joe","Bloggs") print('--------------------') #Functions with Variables #2 - Integers + Returning Values def FuncVarExample2(x, y): #Basic integer maths return x+y #Concatenating Strings and Integers print("33 + 42: " + str(FuncVarExample2(33,42))) print('--------------------') You can also find more code snippets here: https://exitcode0.net/code-samples/

November 23, 2019 · 1 min · Tom

Changing the default python version in Debian

In a previous post, I explained how to upgrade from Python3.5 to Python3.7, however is is still the case in most fresh Debian installs that the default python version is 2.7. This post is going to show you the simple steps you need to take when changing the default python version in Debian. This guide is based on a Debian 9 installation, but work for multiple releases. Check you default version First we need to check our current default version of python. This is the version of python that you Debian OS will try to execute python scripts with unless otherwise specified. ...

June 17, 2019 · 2 min · Tom

Debian 9 - How to upgrade python 3.5 to python 3.7

Note: Debian 9 Stretch reached end-of-life in June 2022. The compile-from-source method shown here is still valid on any current Debian or Ubuntu system — just substitute the Python version you need. I recently spent 30 minutes figuring out how to upgrade to python 3.7 and subsequently pip version on a fresh install of Debian 9. I ran into a number of issues doing this so I though that I would put this quick post together to make this a little bit less complicated for anyone else trying to this. ...

February 19, 2019 · 3 min · Tom