Monday, 13 March 2017

lambda testing

please check github

create EC2 for package preparation
sudo apt-get update
sudo apt-get install python-pip python-dev build-essential
pip install --upgrade pip
pip install virtualenv
virtualenv env
source env/bin/activate
pip install -r requirements.txt
cd $VIRTUAL_ENV/lib/python2.7/site-packages
zip -r9 ~/ *
cd $VIRTUAL_ENV/lib64/python2.7/site-packages
zip -r9 ~/ *
zip -g ~/


import numpy as np
def myfunction(event=None, context=None):
                'My name is Wasit', 'Rule the world!!',
                'get data, process and turn on the switch',
                'get data and predict your future', 'keep coding',
        return np.random.randint(0, len(mylist))

if __name__ == "__main__":
        print myfunction()