From 8ff43fe33aee9e593162c3fe84a1c4a48bab158d Mon Sep 17 00:00:00 2001 From: "E. Almqvist" Date: Mon, 3 Aug 2020 21:29:32 +0200 Subject: [PATCH] Initial commit --- .gitignore | 2 ++ lib/input.py | 10 ++++++++++ lib/vars.py | 17 +++++++++++++++++ 3 files changed, 29 insertions(+) create mode 100644 .gitignore create mode 100644 lib/input.py create mode 100644 lib/vars.py diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..0e0765f --- /dev/null +++ b/.gitignore @@ -0,0 +1,2 @@ +username.txt +lib/__pycache__/ diff --git a/lib/input.py b/lib/input.py new file mode 100644 index 0000000..d5690f7 --- /dev/null +++ b/lib/input.py @@ -0,0 +1,10 @@ +import sys + +def getValueOfKey(key): # get the value of an input key, example: -c {VALUE} + for i in sys.argv: + if( i == key ): + return sys.argv[sys.argv.index(key) + 1] + return -1 # if no value was found return -1 + +def inputHasKeys(keyList): + return all(key in sys.argv for key in keyList) diff --git a/lib/vars.py b/lib/vars.py new file mode 100644 index 0000000..5133eaa --- /dev/null +++ b/lib/vars.py @@ -0,0 +1,17 @@ +eng_alphabet = *"abcdefghijklmnopqrstuvwxyz", +swe_alphabet = *"abcdefghijklmnopqrstuvwxyzåäö", + +# Definitions +alphabet = dict() + +alphabet["ENG"] = eng_alphabet +alphabet["SWE"] = swe_alphabet + +# Functions +def listToString( l ): + returnStr = "" + + for char in l: + returnStr += char + + return returnStr