Last active
February 14, 2020 07:41
-
-
Save aashish-chaubey/1a6fa8252ed933aa1861363ed5ee3952 to your computer and use it in GitHub Desktop.
Checking if the file binary is a RIFF type or any other type
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
start_text = "RIFF" | |
import os | |
for i, filename in enumerate(os.listdir('./')): | |
with open(filename, 'rb') as imageFile: | |
if imageFile.read().startswith(b'RIFF'): | |
print(f"{i+1}: {filename} - found!") | |
else: | |
continue |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment