Browse Source

Upload files to ''

Started work on rename segment
testing
ludwig 2 years ago
parent
commit
fd828a5821
  1. 25
      main.py

25
main.py

@ -1,9 +1,9 @@
import os
import os, glob
def main():
exts = ('.jpg', '.webm', '.png', '.mp4', '.gif', '.pdf', '.odt')
exts = ('.jpg', '.webm', '.png', '.mp4', '.gif')
print("The Source directory is " + os.getcwd())
newdir = str(input("Please enter a directory:"))
@ -18,6 +18,10 @@ def main():
print("Directory found " + os.getcwd())
# file_list=glob.glob('*.png') #checks to see if files are in directory, asks user if they look familiar
frecognize(directory, exts)
frename(exts, directory)
#frecognize(directory, exts)
def frecognize(directory, exts):
@ -31,13 +35,22 @@ def frecognize(directory, exts):
#i += 1
def frename(directory):
str(oldname)
def frename(exts, directory):
filename=[]
source = directory + filename
newname = str(input("Please enter the new filename: "))
index = 0
for filename in os.listdir(directory):
if glob.glob('*.png') == 1:
pngname = newname + "_" + str(index + 1) + ".png"
os.rename(filename, pngname)
elif glob.glob('*jpg') == 1:
os.rename(folder, newname + "_" + str(index + 1) + ".jpg")
for file in os.listdir(directory)
main()
# todo add gui
# todo make frecognize do what the fuck I want it to (print x amount of files)
# todo make frecognize do what I want it to (print x amount of files)

Loading…
Cancel
Save