Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Day 19 file handling #446

Open
Eyobs-droid opened this issue Sep 22, 2023 · 0 comments
Open

Day 19 file handling #446

Eyobs-droid opened this issue Sep 22, 2023 · 0 comments

Comments

@Eyobs-droid
Copy link

In order not to throw an error when we try to delete a file that doesn't exist we can use an exception handling
Import os
Try:
os.remove('The file name.txt')
Except FilenotFoundError:
Print('The file doesn't exist')

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

No branches or pull requests

1 participant