Created
February 7, 2014 11:25
-
-
Save dbellettini/8861027 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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