Skip to content

Instantly share code, notes, and snippets.

@AnmolTomer
Created October 8, 2019 18:50
Show Gist options
  • Save AnmolTomer/01a2bc88fd4c618a7f59ac7837d8fbbf to your computer and use it in GitHub Desktop.
Save AnmolTomer/01a2bc88fd4c618a7f59ac7837d8fbbf to your computer and use it in GitHub Desktop.
import os
path = "/home/cosmic/Desktop/Sem-3/Events/Technocrats/Rover/vid_2/video_wise_frames/Done/img_folder_1_annotated/"
files = os.listdir(path)
for file in files:
if('.jpg' in file[-4:]):
filename = file[:-4]
txtFile = filename + '.txt'
if not (txtFile in files):
# print()
f = open(path+txtFile, 'w')
f.write("")
f.close()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment