Я написал об этом и не получил помощи, поэтому взял дело в свои руки.
Здесь нет сложного кода.
import linecache
#Simply just importing the linecache function to read our line of choosing
number = int(input("Enter a number from 1-10 for a random quote "))
#Asks the user for which number they would like to read(not necessary)
lines = linecache.getline("Quotes.txt", number)
#Create a new variable in order to grab the specific line, the variable
#integer can be replaced by any integer of your choosing.
print(lines)
#This will print the line of your choosing.
Если вы выполняете это в python, убедитесь, что оба файла (.py) и (.txt) находятся в одном месте, иначе python не сможет получить это, если вы не укажете местоположение файла. НАПРИМЕР.
linecache.getline("C:/Directory/Folder/Quotes.txt
Используется, когда файл находится в другой папке, чем используемый вами файл .py.
Надеюсь, это поможет!