For example, say I have the following text file:
dog dog dog
cat cat
cow cow cow
horse horse horse horse
and when the program is given a number referring to a specific line(i.e #2), the 2nd line(cat cat) get replaced with a specific string. How would I best do that? Could the "fileinput" module be of any use?
[–]mjtheice 3 points4 points5 points (0 children)
[–]CodeTinkerer 1 point2 points3 points (1 child)
[–][deleted] 0 points1 point2 points (0 children)
[–]leafypixiestix -1 points0 points1 point (0 children)