You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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')
The text was updated successfully, but these errors were encountered:
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')
The text was updated successfully, but these errors were encountered: