commit 8ff43fe33aee9e593162c3fe84a1c4a48bab158d Author: E. Almqvist Date: Mon Aug 3 21:29:32 2020 +0200 Initial commit 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