Mind-Controlled-Shock-Collar/utils/gen_data.py
2024-06-19 22:32:41 -06:00

19 lines
1.1 KiB
Python

from time import sleep
import random
import os
def genData(filename):
os.system('rm '+filename)
i = 0
file = open(filename, "w")
file.write("index,strength,attention,meditation,delta,theta,low_alpha,high_alpha,low_beta,high_beta,low_gamma,high_gamma")
file.write("\n"+str(i)+","+str(random.randint(0, 200))+","+str(random.randint(0, 200))+","+str(random.randint(0, 200))+","+str(random.randint(0, 100000))+","+str(random.randint(0, 100000))+","+str(random.randint(0, 100000))+","+str(random.randint(0, 100000))+","+str(random.randint(0, 100000))+","+str(random.randint(0, 100000))+","+str(random.randint(0, 100000))+","+str(random.randint(0, 100000)))
file.flush()
while True:
sleep(.5)
file.write("\n"+str(i)+","+str(random.randint(0, 100))+","+str(random.randint(0, 100))+","+str(random.randint(0, 100))+","+str(random.randint(0, 100000))+","+str(random.randint(0, 100000))+","+str(random.randint(0, 100000))+","+str(random.randint(0, 100000))+","+str(random.randint(0, 100000))+","+str(random.randint(0, 100000))+","+str(random.randint(0, 100000))+","+str(random.randint(0, 100000)))
i += 1
file.flush()