diff --git a/fileCheck.py b/fileCheck.py new file mode 100644 index 0000000..3729db0 --- /dev/null +++ b/fileCheck.py @@ -0,0 +1,26 @@ +import linecache +def savePreferences(v): + userNamesData = open('dataData.txt', 'a') + userNamesData.write(''+v+' ') + userNamesData.close() +def newSave(): + userNamesData = open('dataData.txt', 'a') + userNamesData.write('\n') + userNamesData.close() +def readFunction(willCheck): + userNamesData = open('dataData.txt', 'r+') + if willCheck in open('dataData.txt').read(): + willCheck = True + else: + willCheck = False + return willCheck +def extraDetails(word): + details = linecache.getline('dataData.txt', word) + return details + + +def getLineNumber(phrase): + with open('dataData.txt') as f: + for i, line in enumerate(f, 1): + if phrase in line: +return i