Skip to content

Instantly share code, notes, and snippets.

@karayok
Created January 17, 2018 09:05
Show Gist options
  • Save karayok/330b5850760fcd0ffda1f2542e56eb41 to your computer and use it in GitHub Desktop.
Save karayok/330b5850760fcd0ffda1f2542e56eb41 to your computer and use it in GitHub Desktop.
delete \n / 改行を削除
import fileinput
w = open('write.txt','a')
with fileinput.input(files=('read.txt')) as f:
for line in f:
w.write(line.replace('\n', ''))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment