-
Notifications
You must be signed in to change notification settings - Fork 0
/
inputList.py
32 lines (29 loc) · 901 Bytes
/
inputList.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
def takeInput():
'Function take input values in list.'
Items = []
print('Give your input in line by line and exit with (done):')
while True:
status = input()
if status == 'done':
break
else:
Items.append(status)
return Items
def findInput(location):
'Function to take file location and convert input as list.'
with open(location) as line:
programList =line.read().split('\n')
return programList
def initialize():
'Function to initialize input methods.'
print('Do you want manual input?')
myInput = input('Type yes or no:')
try:
if myInput == 'yes':
myList=takeInput()
elif myInput == 'no':
myFile = input('Give the file location:')
myList=findInput(myFile)
return myList
except:
print('ERROR: Please Check your Inputs..')