Python3.6を使っています。
file_copy.py
with open("src.txt", "r") as sf, open("dst.txt", "w") as df:
# 一行ずつ読み込む
for line in sf:
df.write(line)
with構文のところは下記のように書き換え可能。
with open("src.txt", "r") as sf:
with open("dst.txt", "w") as df:
# 以下、省略
with構文を使うことにより、try...finallyで最後にclose()する必要がなくなる。