Im trying to create a program which only reads/prints a certain line in python. So far i have got this:
import random
import time
a = open("settings.txt", "r")
b = open("settings.txt", "a")
adding = input("Enter Name: ")
with open("settings.txt", "a") as f:
f.write("\n{}".format(adding))
data = [line.rstrip() for line in a.readlines()]
print(", ".join(data))
time.sleep(10)
In my settings.txt:
Blah 1
Blah 2
Blah 3
How do I only get the program to print (for example) Blah 1 and nothing else from that txt file?