返回列表 發帖
  1. import os
  2. import shutil as su
  3. try:
  4.     os.makedirs("a/b/c")
  5. except OSError:
  6.     print("路徑已存在!")
  7. else:
  8.     print("成功建立路徑!")
  9. f=open("a/b/c/test.txt","w")
  10. f.write("I am here!")
  11. f.close()
複製代碼

TOP

返回列表