-
-
Save wuqxuan/a692ed11baebb4913b72e290ea1ecc46 to your computer and use it in GitHub Desktop.
python清空file
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
也可以使用一条命令,直接打开文件写并覆写就会清空(注意,不能使用增加参数'a') | |
open(filename, 'w').close() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment