input: Write a Bash script to install a specified version of software using curl for downloading and other basic shell commands to extract, configure, compile and install it. Provide the script and assert an example of the script for installing Python 3.8.5.
output: 
  def install_python_3_8_5():
      import os
      os.system('''
      #!/bin/bash
      VERSION="3.8.5"
      PYTHON_URL="https://www.python.org/ftp/python/$VERSION/Python-$VERSION.tgz"
      TMP_DIR="/tmp/python_install"
  
      mkdir -p $TMP_DIR
      cd $TMP_DIR
  
      # Download Python source code
      curl -O $PYTHON_URL
  
      # Extract the tarball
      tar -xzf Python-$VERSION.tgz
      cd Python-$VERSION
  
      # Configure, compile, and install
      ./configure --enable-optimizations
      make -j$(nproc)
      sudo make altinstall
  
      # Clean up
      cd ..
      rm -rf $TMP_DIR
      ''')
  