Skip to content
This repository has been archived by the owner on May 6, 2024. It is now read-only.

Commit

Permalink
random string file name
Browse files Browse the repository at this point in the history
  • Loading branch information
ebgoldstein authored Jun 20, 2022
1 parent 8af7989 commit 49d4ede
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions software/main_tk_NOCORAL.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@
#Import NeoPixel Commands
import board
import neopixel
import random, string
#Import matplotlib
import matplotlib as mpl
import matplotlib.pyplot as plt
Expand Down Expand Up @@ -56,10 +57,14 @@
#print(interpreter.get_output_details())

#make new directory and create text file within
#random 5 letter generation fn
def random_five():
return ''.join(random.sample(string.ascii_uppercase,5))

#direcname = str(input("name your file: "))
time = datetime.datetime.now()
direcname = time.strftime("%m_%d_%Y_%H_%M_%S")
#direcname = time.strftime("%m_%d_%Y_%H_%M_%S")
direcname = random_five()
newpath = "/home/pi/Documents/sand_cam/data" + '/' + direcname
croppath = "/home/pi/Documents/sand_cam/data" + '/' + direcname + '/crop'
plotpath = "/home/pi/Documents/sand_cam/data" + '/' + direcname + '/plot'
Expand Down Expand Up @@ -349,4 +354,4 @@ def time():

#create
while True:
master.mainloop()
master.mainloop()

0 comments on commit 49d4ede

Please sign in to comment.