Say I have a text document. I have a line.I want to delete the text on that line and replace it with another text. How do I do this? There is nothing for this on the docs, thanks in advance!
相关问题
- how to define constructor for Python's new Nam
- streaming md5sum of contents of a large remote tar
- How to get the background from multiple images by
- Evil ctypes hack in python
- Correctly parse PDF paragraphs with Python
Untested: reads the lines of the file using .readlines() and then replaces the line number index in that list. Finally, it joins the lines and writes it to the file.
To replace a line in QScintilla, you need to first select the line, like this:
Once the line is selected, you can replace it with:
If you want to replace a line with another line (which will be removed in the process):