Skip to content
Permalink
Browse files
Create fileCheck.py
Functions created by Daniel Jones
  • Loading branch information
jonesd37 committed Nov 24, 2017
1 parent 2ea2baa commit e262b33e96181f084e16b4c6fed0a8dd12556f48
Showing 1 changed file with 26 additions and 0 deletions.
@@ -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

0 comments on commit e262b33

Please sign in to comment.