Tbpgr Blog

Employee Experience Engineer tbpgr(てぃーびー) のブログ

Python| Pythonでファイルの作成

概要

Pythonでファイルの作成

内容

ファイル出力のサンプルコードは以下。

サンプルコード

# -*- coding: utf-8 -*-
f = open("hoge.txt", "w")
f.write("hello python\nline2")