Useful Python 2.7 script snippets

Python curl command script: (install pip tutorial and requests tutorial)

import requests
def sendRequest():
url = 'yourEndPoint'
payload = {"action": "update",
"category": "Android"}
headers = {'Content-type': 'application/json'}
r = requests.post(url, json=payload, headers=headers)
print r

Python open browser:

import webbrowser
def open_Google_Play_Console():
webbrowser.open('https://google.com')

Python open file location:

import os
import sys
def open_BuildServerApps():
bashCommand = 'open /fileLocation/builds/android'
p= os.popen(bashCommand)
s=p.readline()
p.close()
Like what you read? Give Andres a round of applause.

From a quick cheer to a standing ovation, clap to show how much you enjoyed this story.