Skip to content

Conversation

@inf0rcer
Copy link

Выполнил задания easy и normal урок 5

try:
os.mkdir(dir_loc)
print(' -- папка успешно создана')
except:

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

не надо так делать, если не знаете какая ошибка может возникнуть пишите Exception

# Напишите скрипт, отображающий папки текущей директории.
path = os.getcwd()
def view_directories(path):
for _ in os.listdir(path):

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

listdir показывает все файлы, не только папки

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants