open() in Python does not create a file if it doesn’t exist
You should use open with the w+ mode: file = open(‘myfile.dat’, ‘w+’)
You should use open with the w+ mode: file = open(‘myfile.dat’, ‘w+’)
Use: find . 2>/dev/null > files_and_folders This hides not just the Permission denied errors, of course, but all error messages. If you really want to keep other possible errors, such as too many hops on a symlink, but not the permission denied ones, then you’d probably have to take a flying guess that you don’t … Read more