-
Notifications
You must be signed in to change notification settings - Fork 23
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #39 from atlarge-research/fzovpec/11-04-24/argpars…
…e-arguments-for-assignments Default argparse arguments for chat client and unreliable chat client assignments
- Loading branch information
Showing
2 changed files
with
39 additions
and
7 deletions.
There are no files selected for viewing
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
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 |
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
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 |