Skip to content

Instantly share code, notes, and snippets.

@dbellettini
Created February 7, 2014 11:25
Show Gist options
  • Save dbellettini/8861027 to your computer and use it in GitHub Desktop.
Save dbellettini/8861027 to your computer and use it in GitHub Desktop.
def decorated_function(*args, **kwargs):
return f(*args, **kwargs)
parser = argparse.ArgumentParser()
parser.add_argument("-ip", "--ip", help="IP to run the server on",
parser.add_argument("-p", "--port", help="Port to run the server on",
args = parser.parse_args()
if args.port: args.port = int(args.port)
if args.ip and args.port:
app.run(host=args.ip, port=args.port, debug=True)
elif args.ip:
app.run(host=args.ip, port=5000, debug=True)
elif args.port:
app.run(host='127.0.0.1', port=args.port, debug=True)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment