1.read()・・・readメソッドは開いたファイル全体を文字列として取得する。\nは含む
読み込んだファイルで文字数制限を付ける
例:read(5) とすると、読み込んだファイルから5文字読み込む
2.readline()・・・そのまま実行すると、ファイルを1行だけ読み込む。
3.readlines()・・・ファイル全体を行ごとに分割したリストとして取得できる。
Go to list of users who liked
More than 1 year has passed since last update.
1.read()・・・readメソッドは開いたファイル全体を文字列として取得する。\nは含む
読み込んだファイルで文字数制限を付ける
例:read(5) とすると、読み込んだファイルから5文字読み込む
2.readline()・・・そのまま実行すると、ファイルを1行だけ読み込む。
3.readlines()・・・ファイル全体を行ごとに分割したリストとして取得できる。
Register as a new user and use Qiita more conveniently
Go to list of users who liked