Skip to content

Instantly share code, notes, and snippets.

View dancaps's full-sized avatar

Daniel Caperton dancaps

View GitHub Profile
@dancaps
dancaps / add_account_v3.py
Created January 22, 2018 22:45
Why is this not working?
import requests
cc_api_url = 'https://api.cloudcheckr.com/api/account.json/add_account_v3'
headers = {'Content-Type': 'application/json'}
params = {'account_name': 'test_account', 'access_key': 'my_admin_api_key'}
r = requests.post(cc_api_url, headers=headers, params=params)
def get_args():
"""Get command line args from the user.
"""
parser = argparse.ArgumentParser(
description='Standard Arguments for talking to vCenter')
# because -h is reserved for 'help' we use -s for service
parser.add_argument('-s', '--host',
required=True,
action='store',
def max_rot(n):
n = list(str(n))
answer = [int(''.join(n))]
for i in range(len(n)):
n.append(n.pop(int(i)))
answer.append(int(''.join(n)))
return max(answer)