Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit3206128

Browse files
committed
edit handling files tutorial
1 parent78e4687 commit3206128

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

‎python-standard-library/handling-files/listing_files.pyrenamed to‎python-standard-library/handling-files/handling-files.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
importos
2+
importshutil
23

34
# print the current directory
45
print("The current directory:",os.getcwd())
@@ -46,8 +47,10 @@
4647
# remove the folder
4748
os.rmdir("folder")
4849

49-
# remove nested folders
50+
# remove nestedemptyfolders
5051
os.removedirs("nested1/nested2/nested3")
52+
# remote non-empty folders
53+
shutil.rmtree("nested1")
5154

5255
open("text.txt","w").write("This is a text file")
5356

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp