From 9ea16a768cd4143d2a3508d7193f8d0d784e40be Mon Sep 17 00:00:00 2001 From: David Runge Date: Fri, 31 Jan 2014 11:48:32 +0100 Subject: First commit, still some TODOs --- random241arg.py | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) create mode 100755 random241arg.py (limited to 'random241arg.py') diff --git a/random241arg.py b/random241arg.py new file mode 100755 index 0000000..4bd00d8 --- /dev/null +++ b/random241arg.py @@ -0,0 +1,25 @@ +#!/usr/bin/python2 + +from sys import argv + + +def read_params(): + # Checks the given parameters + info = """Use the program as following: + random241.py [option] ... + Options: + -c number of cam to use (starts with first found camera 0 (default)) + -r remote address to send the output to (standard 192.168.0.7) + """ + default = {'-c': "1", '-r': "192.168.0.7"} + parameters = default.copy() + if len(argv) != 3: + for i in xrange(1, len(argv) - 1, 2): + if argv[i] in parameters: + parameters[argv[i]] = argv[i + 1] + else: + print info + return 0 + return parameters + else: + return default -- cgit v1.2.3-70-g09d2