def runccode(filename): osc = Osc(window_sec=10, intensity=1) arr = [] #a_file = open("my_file.txt", "r") a_file = open(filename, "r") for line in a_file: stripped_line = line.rstrip() k = float(stripped_line) arr.append(int(k)) print(arr[2]) @osc.signal def increasing_signal(state): while True: global count if (count == len(arr) - 1): print("entered quit") exit() state.draw(arr[count]) myModule.fib(1) count = count + 1 osc.start()
print("caught an open click") final_list.clear() final_list.append(2) c=tkinter.Button(top,text="Close graph",command=cbp) c.pack() o=tkinter.Button(top,text="open graph",command=obp) o.pack() top.mainloop() def sud(): import random from time import sleep from oscilloscope import Osc # adjust window_sec and intensity to improve visibility osc = Osc(fps=1) @osc.signal def increasing_signal(state): delta = 1 while True: state.draw(random.randint(-delta, delta)) delta += 5 sleep(0.01) flag=0 while(True): if(len(final_list)>0): if(final_list[-1]==1): osc.stop() flag=0 final_list.clear() if(flag==0 and len(final_list)>0):
"""https://i.imgur.com/Dlve8rJ.png""" import random from time import sleep from oscilloscope import Osc # turn on normalization osc = Osc(normalize=True) @osc.signal def increasing_signal(state): delta = 1 while True: state.draw(random.randint(-delta, delta)) delta += 5 sleep(0.01) osc.start()
"""https://i.imgur.com/BMeYoXG.png""" import random from time import sleep from oscilloscope import Osc osc = Osc() @osc.signal def simple_random_signal(state): while True: state.draw(random.random()) sleep(0.1) osc.start()
"""https://i.imgur.com/PPC7z4m.png""" import random from time import sleep from oscilloscope import Osc osc = Osc(nrows=2, ncols=3) @osc.signal def signal1(state): while True: state.draw(random.random()) sleep(0.1) @osc.signal def signal2(state): while True: state.draw(random.random(), row=1, col=2) sleep(0.1) osc.start()
@osc.signal def increasing_signal(state): print(pullData[0]) dataArray = pullData.rspilt("/n") for eachline in dataArray: if(len(eachline)>1): state.draw(float(eachline)) myModule.fib(1) osc.start() ''' import myModule from oscilloscope import Osc count = 0 osc = Osc(window_sec=10, intensity=1) arr = [] a_file = open("my_file.txt", "r") #a_file = open("yaxis.txt", "r") for line in a_file: stripped_line = line.rstrip() k = float(stripped_line) arr.append(int(k)) print(arr[2]) @osc.signal def increasing_signal(state): while True: global count if (count == len(arr) - 1):