cue_count = cue_count+1
                    print(cue_count)
                    time_list.append(g_end+start)
                    file1 = open('/home/chris/Dropbox/K6_primo/cues/cue1.txt', 'a')
                    if cue_count ==1:
                        string1=("'%s', '%s'" % ((int(round(time_list[0],2)*1000)), name))
                        print("This is string 1 '%s'" % string1)
                        print(string1.replace(",", ''))
                        string2 =(string1.replace(",", ''))
                        print("this is string2 '%s'" % string2)
                        string3 =(string2.replace("'", ''))
                        print("this is string3 '%s'" % string3)
                        #for char in string.punctuation:
                            #string3=string3.replace(char, '')
                        #file1.write("'%s' \n" % string3)
                        lst = [string3]
                        # Open the file with a context manager
                        with open("/home/chris/Dropbox/K6_primo/cues/cue1.txt", "a+") as myfile:
                            # Convert all of the items in lst to strings (for str.join)
                            lst = map(str, lst)
                            # Join the items together with commas
                            line = ",".join(lst)
                            # Write to the file
                            myfile.write((line) + "\n")
                        print("cue1.txt first time file written")
                    if cue_count >1:
                        string1 = ("'%s', '%s'" % (((int(round(time_list[cue_count - 1],2)*1000)))-((int(round(time_list[cue_count - 2],2)*1000))), name))
                        print("This is string 1 '%s'" % string1)
                        print(string1.replace(",", ''))
                        string2 = (string1.replace(",", ''))
                        print("this is string2 '%s'" % string2)
                        string3 = (string2.replace("'", ''))
                        print("this is string3 '%s'" % string3)
                        #file1.write("'%s' \n" % string3)
                        lst = [string3]
                        # Open the file with a context manager
                        with open("/home/chris/Dropbox/K6_primo/cues/cue1.txt", "a+") as myfile:
                            # Convert all of the items in lst to strings (for str.join)
                            lst = map(str, lst)
                            # Join the items together with commas
                            line = ",".join(lst)
                            # Write to the file
                            myfile.write((line)+"\n")
                        print("cue1.txt second time file written")

Leave a Reply

Your email address will not be published.