Python Forum

Full Version: Install Python Using ShellScript
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Hi,

I have a requirement like to install Python using shellscript...

I'm able to download it, but couldn't silent the steps after downloading


I'm using this code

#!/bin/bash

# Define the URL of the Python installer
url="https://www.python.org/ftp/python/3.9.9/python-3.9.9-amd64.exe"

# Define the destination path
destination="C:\temp\python-3.9.9-amd64.exe"

# Use curl to download the file
curl -o "$destination" "$url"

# Start the installation process silently
cmd.exe /c start /wait "$destination" /quiet InstallAllUsers=1 PrependPath=1

Can anyone help me with this code.

Thanks!
It sounds like you might be dealing with an encoding issue. Try specifying the encoding explicitly when opening the file:
with open("yourfile.txt", "r", encoding="utf-8") as file:
    content = file.read()
If that doesn't work, check the file's encoding using a tool like chardet to determine the correct encoding.