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

Appearance settings

Lesson05#884

Open
AlexN-github wants to merge 7 commits into
GeekBrainsTutorial:masterGeekBrainsTutorial/Python_lessons_basic:masterfrom
AlexN-github:lesson05AlexN-github/Python_lessons_basic:lesson05Copy head branch name to clipboard
Open

Lesson05#884
AlexN-github wants to merge 7 commits into
GeekBrainsTutorial:masterGeekBrainsTutorial/Python_lessons_basic:masterfrom
AlexN-github:lesson05AlexN-github/Python_lessons_basic:lesson05Copy head branch name to clipboard

Conversation

@AlexN-github

Copy link
Copy Markdown

Сделал все.

FullNameDir = os.path.join(current_path, "dir_"+str(i))
os.mkdir(FullNameDir)
print("Директории dir_1..dir_2 созданы")
except FileExistsError:

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

так, а если ошибка вылетит на первой же итерации, получиться что вообще ни одной папки не создастся

if os.path.isdir(FullNameDir):
os.rmdir(FullNameDir)
print("Директории dir_1..dir_2 удалены")
except :

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

очень плохая практика, хотя бы Exception надо писать

# и импортированные в данный файл из easy.py

import os
def action1():

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

функциям всеже лучше давать имена которые дают понмание что именно она делает

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

Morty Proxy This is a proxified and sanitized view of the page, visit original site.