Skip to content

Instantly share code, notes, and snippets.

@carlosfunk
carlosfunk / install_python.ps1
Last active Sep 21, 2021
Powershell scripts for setting up a Python environment under Windows
View install_python.ps1
# To run this file you will need to open Powershell as administrator and first run:
# Set-ExecutionPolicy Unrestricted
# Then source this script by running:
# . .\install_python.ps1
$save_dir=Resolve-Path ~/Downloads
$project_dir = "C:\Projects"
$virtualenv_dir = $project_dir + "\virtualenvs"
$client = New-Object System.Net.WebClient
@carlosfunk
carlosfunk / invoke_lambda.py
Created Apr 24, 2020
Function to invoke a lamdba from python
View invoke_lambda.py
import boto3
client = boto3.client('lambda')
def invoke_lambda(stage: str, region: str, name: str) -> List[Dict[str, Any]]:
response = client.invoke(FunctionName=f"{stage}-{region}-{name}", InvocationType="RequestResponse")
string_response = response["Payload"].read().decode("utf-8")
return json.loads(string_response)