with open("Stud.txt", "rt") as fin:
with open("out.txt", "wt") as fout:
for line in fin:
fout.write(line.replace('A', 'Orange'))
More Related Contents:
- Print string to text file
- write() versus writelines() and concatenated strings
- Convert a String representation of a Dictionary to a dictionary?
- How do I put a variable’s value inside a string?
- Python string interning
- How can I remove the ANSI escape sequences from a string in python
- Python strings and integer concatenation [duplicate]
- How to write to a CSV line by line?
- Convert regular Python string to raw string
- How to convert ‘binary string’ to normal string in Python3?
- Convert a list of characters into a string [duplicate]
- Print a string as hexadecimal bytes
- Python TypeError: not enough arguments for format string
- Efficient way to add spaces between characters in a string
- How do I check for an EXACT word in a string in python
- Rotating strings in Python
- Replace first occurrence only of a string?
- Convert string to list. Python [string.split() acting weird]
- Python testing whether a string is one of a certain set of values [duplicate]
- Remove final character from string
- How to find out if a Python object is a string?
- How do I create a multiline Python string with inline variables?
- What does ‘u’ mean in a list?
- Why doesn’t calling a string method (such as .replace) modify (mutate) the string? Why doesn’t it change unless I assign the result?
- Parsing apache log files
- How can I interleave or create unique permutations of two strings (without recursion)
- How to split a string within a list to create key-value pairs in Python
- What is internal representation of string in Python 3.x
- Extract string from between quotations
- Sort strings by the first N characters