0
#! /bin/python3

#Imports
import sys
import datetime

#Basic usage

print()

print()

print('Hello User. Welcome to ProjGURU, an innovative but basic project made by Unfree\'s CEO, Gururam. The current date and time is {}. Let\'s get right into the project.'.format(datetime.datetime.now()))

print()

lay1 = input('Please choose which programme to download and load.\n1.Tor\n2.Opera\n3.Chrome')
print()

#lay1 splitted

if lay1 == '1':wget https://dl.google.com/linux/direct/google-chrome-stable_current_amd64.deb

how do i execute the wget command

rdas
  • 15,648
  • 5
  • 22
  • 36
  • 2
    use subprocess() or os.system() command. https://docs.python.org/2/library/subprocess.html – Shrey Feb 03 '20 at 12:49
  • Does this answer your question? [Calling an external command from Python](https://stackoverflow.com/questions/89228/calling-an-external-command-from-python) – Gino Mempin Feb 03 '20 at 12:50
  • 2
    Does this answer your question? [How do I download a file over HTTP using Python?](https://stackoverflow.com/q/22676/2745495) – Gino Mempin Feb 03 '20 at 12:51
  • Use [requests](https://requests.readthedocs.io/en/master/) – bruno desthuilliers Feb 03 '20 at 12:53
  • 1
    Does this answer your question? [How do I download a file over HTTP using Python?](https://stackoverflow.com/questions/22676/how-do-i-download-a-file-over-http-using-python) – Arusekk Feb 03 '20 at 13:58

1 Answers1

0

If your primary intention is to download that file, you can use the requests library, as Bruno pointed out in the comments. Install it via the command-line tool pip:

$ pip install requests

Then you can import the library and download your file as such:

import requests

# ... other code

if lay1 == '1':
    with open('google-chrome-stable_current_amd64.deb', 'wb') as f:
        r = requests.get('https://dl.google.com/linux/direct/google-chrome-stable_current_amd64.deb')
        f.write(r.content)
Sam Chats
  • 2,291
  • 1
  • 10
  • 29