How to Get the Latest version of WordPress using Python

Download the latest version of WordPress using Python

  • upload the wp-new file to the directory where you want to install WordPress
  • run the “python wp-new” command within the directory where you have the wp-new file.


#!/usr/bin/env python

import requests
import subprocess

WP_URL = ''

req_error = 'sorry we cant find the file'
downloading = 'Everything Looks good Lets Download WordPress'

# make sure we can reach the url
wpreq = requests.get(WP_URL)
if wpreq.status_code != 200:
elif wpreq.status_code == 200:
    print(downloading)['wget', WP_URL])['unzip', ''])['rm',''])'mv wordpress/*.* .', shell=True)'mv wordpress/* .', shell=True)['ls', '-l'])['rm', '-r', 'wordpress'])
    print("Awesome WordPress is ready")['rm','wp-new'])