Skip to content

Instantly share code, notes, and snippets.

@andrewm4894
Created September 4, 2019 19:09
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save andrewm4894/7403c9fb50b489b6f6d58f7640421ce4 to your computer and use it in GitHub Desktop.
Save andrewm4894/7403c9fb50b489b6f6d58f7640421ce4 to your computer and use it in GitHub Desktop.
import json
from my_utils.os_utils import subprocess_execute
from my_dev.dev import hello_world
import pandas as pd
def run(event=dict(), context=dict()):
''' Function to be called by serverless lambda
'''
# make a dummy df to ensure pandas available to the lambda function
df = pd.DataFrame(data=['this is a dataframe'],columns=['message'])
print(df.head())
# call something from my_dev package
hello_world()
# print out results of ls
print(subprocess_execute('ls -la'))
# run shell command to print out results of pip freeze
print(subprocess_execute('pip freeze'))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment