cowiz20/server.py

28 lines
598 B
Python
Raw Normal View History

2020-04-05 16:00:48 +02:00
#!/usr/bin/env python3
2020-04-01 23:31:36 +02:00
2020-04-05 16:00:48 +02:00
import random
from app_instance import api
from routes import *
import wiz_game
2020-12-11 22:12:27 +01:00
import argparse
2020-04-01 23:31:36 +02:00
2020-04-13 22:19:16 +02:00
2020-04-05 16:00:48 +02:00
def main():
print("main started")
2020-04-01 23:31:36 +02:00
2020-12-11 22:12:27 +01:00
parser = argparse.ArgumentParser()
parser.add_argument('--port', metavar='port', default=8001, type=int, help='the port to bind to')
parser.add_argument('--bindaddr', metavar='addr', default='127.0.0.1', help='the address to bind to')
args = parser.parse_args()
2020-04-05 16:00:48 +02:00
random.seed()
2020-04-13 22:07:38 +02:00
wiz_game.the_game.start_game()
2020-04-01 23:31:36 +02:00
2020-12-11 22:12:27 +01:00
api.run(port=args.port, address=args.bindaddr)
2020-04-01 23:31:36 +02:00
exit(0)
if __name__ == '__main__':
main()