请用python代码展示如何读取一个txt文件, 并且让每一行n个字就换一次行,输出结果与输入文件同名,格式为.txt
user
```python
with open('input.txt', 'r', encoding='utf-8') as file:
    content = file.read()

n = 10  # 每行字数
lines = []
for i in range(0, len(content), n):
    lines.append(content[i:i + n])

with open('input.txt', 'w', encoding='utf-8') as file:
    file.write('\n'.join(lines))
```
assistant