Skip to content

Instantly share code, notes, and snippets.

View colleenDunlap's full-sized avatar
🎯
Passion Projects, Web Dev Skills Improving, Getting that Degree

colleenDunlap

🎯
Passion Projects, Web Dev Skills Improving, Getting that Degree
View GitHub Profile
@colleenDunlap
colleenDunlap / movePics.py
Created November 15, 2019 20:24
Simple Python Script for allocating 20% of files in a folder to Testing Set, and the remainder to a Training Set
import os
directory = os.fsencode(r"C:\Users\Colleen Dunlap\Desktop\_flowers\tulip")
numPics = 0
for file in os.listdir(directory):
filename = os.fsdecode(file)
print(r"C:/Users/Colleen Dunlap/Desktop/_flowers/tulip/" + filename)
if filename.endswith(".jpg"):
numPics +=1
if numPics % 4 == 0: #put in testing