LoginSignup
0

More than 3 years have passed since last update.

courseraの字幕を読みやすくする.py

Last updated at Posted at 2019-11-20

courseraの字幕をターミナルで読むのに読みやすくしたくて作りました。やったことは「。」を「。」と改行を2つにreplaceしました。

convert.py

import sys

args = sys.argv
f = open(args[1])
data = f.read()
f.close()
print(data.replace('。', '。' + '\n\n'))
実行方法
python convert.py subtitle.txt

[before]
ああああああああああああああああああああああああああああああああああああああああああああ。いいいいいいいいいいいいいいいいいいいいいいいいいいい。うううううううううううううううううううううううううううううううううううううううううう。えええええええええええええええええええええええええ。おおおおおおおおおおおおおおおおおおおおおおおおおお。

[after]
ああああああああああああああああああああああああああああああああああああああああああああ。

いいいいいいいいいいいいいいいいいいいいいいいいいいい。

うううううううううううううううううううううううううううううううううううううううううう。

えええええええええええええええええええええええええ。

おおおおおおおおおおおおおおおおおおおおおおおおおお。

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0