I am new to Emacs. I am reading a book on Python. The book has many code examples. What I would like to do is to
convert this:
61. def getRandomWord(wordList):
62. # This function returns a random string from the passed list of strings.
63. wordIndex = random.randint(0, len(wordList) - 1)
64. return wordList[wordIndex]
in to this:
def getRandomWord(wordList):
# This function returns a random string from the passed list of strings.
wordIndex = random.randint(0, len(wordList) - 1)
return wordList[wordIndex]
removing one space + the number + one space that appears at the beginning of each line. I'm sure there are multiple ways to accomplish this. For example, a regex search, multiple cursors, or a command that removes the first 5 chars from each line of a text.
Question:
If you were going through a text with a lot of code examples that you wanted to copy/paste into Emacs, what method would you use to remove the line numbers?