Feb-25-2020, 07:19 PM
hi, I am writing python code that reads values from a csv file, I have the reading down but when the program reaches the end of the csv I need it to start from the top. So it will continuously read the data over and over until I tell it to stop.
here is my current reader code
I appreciate any help
here is my current reader code
csvname=input("Enter the csv file path : \n") with open(csvname, 'rt') as f: reader= csv.DictReader(f) while True: while mainFlag==True: start_time = time.monotonic() for row in reader : interger= int(row['setpos']) print(interger) pos= position_setpoint(interger) my_drive.axis0.controller.move_to_pos(pos) actual_time = time.monotonic() t0 = actual_time - start_time time.sleep(adjSpeed)I tried using f.seek(0) but it just gave me errors
I appreciate any help