mirror of
https://github.com/DJ2LS/FreeDATA
synced 2024-05-14 08:04:33 +00:00
added cli paramters
This commit is contained in:
parent
17294069c9
commit
d5bf540aea
1 changed files with 15 additions and 2 deletions
|
@ -8,9 +8,22 @@ Created on Fri Dec 11 21:53:35 2020
|
|||
|
||||
import socket
|
||||
import sys
|
||||
import argparse
|
||||
|
||||
HOST, PORT = "localhost", 3000
|
||||
data = " ".join(sys.argv[1:])
|
||||
|
||||
#--------------------------------------------GET PARAMETER INPUTS
|
||||
parser = argparse.ArgumentParser(description='Simons TEST TNC')
|
||||
parser.add_argument('--port', dest="socket_port", default=9000, help="Set the port, the socket is listening on.", type=int)
|
||||
parser.add_argument('--data', dest="data", default=False, help="data", type=str)
|
||||
|
||||
args = parser.parse_args()
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
HOST, PORT = "localhost", args.socket_port
|
||||
data = args.data
|
||||
|
||||
# Create a socket (SOCK_STREAM means a TCP socket)
|
||||
with socket.socket(socket.AF_INET, socket.SOCK_STREAM) as sock:
|
||||
|
|
Loading…
Reference in a new issue