How to delete a line from a file by index?
<p>Pretty self explanatory. This is my text file:</p>

<pre><code>C:\Windows\Users\Public\Documents\
C:\Program Files\Text Editor\
</code></pre>

<p>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?</p>

<p><strong>EDIT :</strong></p>

<p>To the person asking code: </p>

<pre><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':
</code></pre>

<p>I simply want a way to delete a line by it's number in a file.</p>