Hi *
I'm trying to make a program that converts a vertical list to a horizontal one which works. But am trying to build in check for some correct user input an I get an Indentation error
File ".\dairymaster.py", line 19
pn_test = check_input('1', '2')
^
IndentationError: expected an indented block
If I run this piece of code seperate it works fine but combination with the rest I get the above error
import sys
action = "draft"
#print ('Please enter which pen:')
#pn = raw_input()
def check_input(a, b):
"""
check the input
"""
prompt = "Please enter which pen %s or %s: " % (a, b)
while True:
try:
pn = str(raw_input(prompt))
if pn == '1' or pn == '2':
return pn
except StringError:
pn_test = check_input('1', '2')
print(pn_test)
#print ('Please enter AM or PM:')
#moa = raw_input('Please enter AM or PM:')
def check_input(c, d):
"""
check the input
"""
prompt = "Please enter either %s or %s: " % (c, d)
while True:
try:
moa = str(raw_input(prompt))
if moa == 'am' or moa == 'pm':
return moa
except StringError:
moa_test = check_input('am', 'pm')
print(moa_test)
#print ('Please enter how many days from now, enter = 0:')
#dfn = raw_input()
def check_input(e, f):
"""
check the input
"""
prompt = "Please enter either %s or %s for today or tomorrow: " % (e, f)
while True:
try:
dfn = str(raw_input(prompt))
if dfn == '0' or dfn == '+1':
return dfn
except StringError:
dfn_test = check_input('0', '+1')
print(dfn_test)
print ('Please enter the filename:')
fname = raw_input()
handle = open(fname, "r")
list = handle.readlines()
combine = ''.join(list).replace("\n", " ")
if dfn == '0'
return dfn == ' '
oname = "copyme.txt"
fout = open(oname, "w")
fout.write(action + pn + moa + ' ' + dfn + ' ')
fout.write(combine)
fout.close()