Pretty self explanatory. This is my text file:
C:\Windows\Users\Public\Documents\
C:\Program Files\Text Editor\
So, I have code which prompts the user to input the number of the line he wants to delete. But how do I delete the line which corresponds to the number?
EDIT :
To the person asking code:
# Viewing presets
if pathInput.lower() == 'view':
# Prints the lines in a numbered, vertical list.
numLines = 1
numbered = ''
for i in lines:
i = str(numLines) + '. ' + i
numbered += i
print (i)
numLines += 1
viewSelection = input('\n^ Avaiable Paths ^\nInput the preset\'s number you want to perform an action on.\n')
for i in numbered:
if viewSelection in i:
viewAction = input('\nInput action for this preset.\nOptions: "Delete"')
if viewAction.lower() == 'delete':
I simply want a way to delete a line by it's number in a file.