Ok, so I have code that looks like this:
input_name="PLACEHOLDER"
while input_name != "":
input_name=input('Part Name: ')
with open("/pathway/%s.txt" %input_name ,"r") as read_data, open("output.txt","w") as output:
if part_name != "":
f=input_data.read()
print(input_data)
output.write(part_name)
output.write(date)
output.write(y)
else:
read_data.close()
output.close()
I know it looks a little broken, but what I need to do is fix the loop, because I need to be able to take multiple inputs, and write each of those inputs(file names) to the same file at the end of the program. I probably need at least one more loop in here, I'm just looking for ideas or a kick in the right direction. I have other formatting code in there, this is just the bare bones, looking for an idea on what kind of loops I could run. Thanks to anyone who takes the time to look at this for me!
argparseinstead of your endlessinput