I am creating a Python script that requests input from the command line. The user will be able to edit part of the file. I can ask for new information and overwrite it in a file, no problem. But I would prefer that the editing part is already inserted into the command line, so it does not need to be typed completely. Is it possible?
File:
1|This file 2|is not empty
Example:
>>>edit line 2 Fetching line 2 Edit the line then hit enter >>>is not empty
Which can be changed to
>>>is not full either Edited file
Afther for which the file was modified:
1|This file 2|is not full either
I hope it is clear what I am trying to accomplish.
This question was said to answer my question, it is to a certain extent. This happens when I run Linux with readline . However, I am not sure. I use Windows and do not use readline . I would like to use only the standard library.
An answer on Windows is also provided with this question. However, I get ImportError with win32console , perhaps because the question mentioned is not about Python3.4, but mine. Also, I was wondering if this is possible with a standard library , and not with an external library.
ikhebgeenaccount May 12 '15 at 2:31 pm 2015-05-12 14:31
source share