Skip to content

Commit

Permalink
Merge pull request #39 from atlarge-research/fzovpec/11-04-24/argpars…
Browse files Browse the repository at this point in the history
…e-arguments-for-assignments

Default argparse arguments for chat client and unreliable chat client assignments
  • Loading branch information
fzovpec authored Apr 11, 2024
2 parents aa90168 + 57ce8c3 commit 661a88a
Show file tree
Hide file tree
Showing 2 changed files with 39 additions and 7 deletions.
24 changes: 20 additions & 4 deletions chat_client_check/client.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,21 @@
SERVER_HOST = '127.0.0.1'
SERVER_PORT = 5378
import argparse

print('Welcome to Chat Client. Enter you login:')
# Please put your code in this file
parser = argparse.ArgumentParser(description='Process test arguments')
parser.add_argument('--address', type=str, help='Server IP address', default='212.132.114.68')
parser.add_argument('--port', type=int, help='Server Port', default=5378)

# you can start your client by passing the arguments --address and --port which should be
# chat server server IP address and server port you want your client to connect to.
# The default values are our remote server with 212.132.114.68 for address and 5378 for port.
# Tests will start a local server and pass its address and port as arguments to the program
# in a form of python3 client.py --address="127.0.0.1" --port 5378

args = parser.parse_args()

SERVER_HOST = args.address
SERVER_PORT = args.port

# SERVER_HOST and SERVER_PORT contain address and port arguments

print('Welcome to Chat Client. Enter your login:')
# Please put your code in this file
22 changes: 19 additions & 3 deletions unreliable_chat_check/client.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,21 @@
SERVER_ADDRESS = "127.0.0.1"
SERVER_PORT = 5382
import argparse

parser = argparse.ArgumentParser(description='Process test arguments')
parser.add_argument('--address', type=str, help='Server IP address', default='212.132.114.68')
parser.add_argument('--port', type=int, help='Server Port', default=5382)

# you can start your client by passing the arguments --address and --port which should be
# chat server server IP address and server port you want your client to connect to.
# The default values are our remote server with 212.132.114.68 for address and 5382 for port.
# Tests will start a local server and pass its address and port as arguments to the program
# in a form of python3 client.py --address="127.0.0.1" --port 5382

args = parser.parse_args()

SERVER_HOST = args.address
SERVER_PORT = args.port

# SERVER_HOST and SERVER_PORT contain address and port arguments

print('Welcome to Chat Client. Enter your login:')
# Please put your code in this file
# Please put your code in this file

0 comments on commit 661a88a

Please sign in to comment.