• If you're here for vtubers, I highly recommend you go to The Virtual Asylum instead.
    They'll love you there

Image Folder Stuff and Things

Halo

varishangout.com
Regular
Names a bit misleading since you'd need them sorted before hand, but a guy on the rocket chat had all his images labeled in a format like this, and he wanted them sorted into folders
1619561511161.png

so I wrote a quick python script to create folders for each doujin (I'm guessing from the names?)
probably a better way to do it but this worked so ye.
Posting this cause there isn't much else here at the moment :tohru-smug:
Python:
import os
import shutil

folderToCheck = "E:/Test Folder"
folderToCreateIn = "E:/"

directory = os.listdir(folderToCheck)

for file in directory:
    fileName = file.split("-",4)
    folderName = fileName[4].split(".")
    folderName[0]
    path = os.path.join(folderToCreateIn,folderName[0])
    print(path)
    if(os.path.isdir(path) != True):
        os.mkdir(path)
    shutil.move(os.path.join(folderToCheck,file),path)

if you wonder why it says "Hello, Goodbye" its cause of the VN

uh... well yeah not sure what else to say here, call it shit and give a way to fix it i guess?

made a small change after Valenthyne pointed out the "else" wasn't needed.
1619573482948.png
 
Last edited:
Top