put at the very least the text in a variable. preferably you do something like
```python
bashrc=['if [ -f ~/.bashrc ];','then',' '*4+'. ~/.bashrc','fi']
fp.write("\n".join(bashrc+['']))
```