- Pythonのお勉強 Part64
804 :デフォルトの名無しさん (ワッチョイ 9f01-7Des)[sage]:2021/04/18(日) 21:05:13.59 ID:qHYw4Dd30 - >>803
closeしないのはお行儀的に良くないので普通ではない open -> write -> closeをone shotでやりたければpathlibのwrite_text
| - Pythonのお勉強 Part64
813 :デフォルトの名無しさん (ワッチョイ 9f01-7Des)[sage]:2021/04/18(日) 22:39:44.96 ID:qHYw4Dd30 - pathlibでPath.home()とかexpanduser()とか使えるよ
Path(‘~/path/to/file’).expanduser()
|
|