import boto3 def put_hehe(name, year, dynamodb=None): if not dynamodb: dynamodb = boto3.resource('dynamodb') table = dynamodb.Table('hehe') response = table.put_item( Item={ 'name': name, 'year': year, } ) return response if __name__ == '__main__': movie_resp = put_hehe('cxy','8848') print("Put movie succeeded:")