How to update the Python and Git versions?

The current python version is pretty old, it's 3.8.x while the latest is 3.11, and I'd like to be using 3.11 instead. Same goes to Git, I'd like to have the latest release of it instead of whatever current version it is. How can I update them both?

You properly need to compile from the source then.

Source code for Python: Python Source Releases | Python.org
Source code for Git: GitHub - git/git: Git Source Code Mirror - This is a publish-only repository but pull requests can be turned into patches to the mailing list via GitGitGadget (https://gitgitgadget.github.io/). Please follow Documentation/SubmittingPatches procedure for any of your improvements.

Is there no other way? And if not, what do I do after compiling? And is there a guide on compiling them?

From Python readme file:

Build Instructions
------------------

On Unix, Linux, BSD, macOS, and Cygwin::

    ./configure
    make
    make test
    sudo make install

This will install Python as ``python3``.

You can pass many options to the configure script; run ``./configure --help``
to find out more.

Git installation guide: https://github.com/git/git/blob/master/INSTALL

In both cases make sure that 'build-essential' is installed.

Sorry but what's 'build-essential'?

It's utilitty tools for when compiling stuff and more.

sudo apt install build-essential

There is " Gzipped source tarball" and " XZ compressed source tarball" in the source code download options, which one should I download?

Pick one, they are just different method to compress files. :slight_smile:

It worked, thank you so much! One more question, is it possible to make python files open with python instead of text editor?

I'm no expert with python or its app. But you should right click on the python file and click properties. From there you can set which app to open that kind of files.

When clicking properties and going to the "Open with" section, it doesn't let me choose a custom binary but rather shows me a list of applications, none of which are Python. So when I double click python files, the text editor opens them instead of the Python application itself.

Hmmm... you could try with, note you have to fill out the gap

 cp /usr/share/applications/gedit.desktop ~/.local/share/applications/python-edit.desktop
nano ~/.local/share/applications/python-edit.desktop

then change the different lines to fit your needs.
exec is the important one. you need to give it the python command eg.

python %U