Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
time.sleep(0.1)
continue
if not in_queue.full():
in_queue.put_nowait(in_line)
read_thread = Thread(target=read_input)
read_thread.daemon = True # Set as daemon, so when all other threads die, this one gets killed too.
read_thread.start()
## Start Qt event loop unless running in interactive mode or using pyside.
if __name__ == '__main__':
import sys
if (sys.flags.interactive != 1) or not hasattr(QtCore, 'PYQT_VERSION'):
try:
QtGui.QApplication.instance().exec_()
except KeyboardInterrupt:
sys.exit(0)
def mkQApp():
global QAPP
inst = QtGui.QApplication.instance()
if inst is None:
QAPP = QtGui.QApplication([])
else:
QAPP = inst
return QAPP
raw_curve.setData(raw_data)
def savecounter():
ser.close()
import atexit
atexit.register(savecounter)
timer = QtCore.QTimer()
timer.timeout.connect(update)
timer.start(0)
## Start Qt event loop unless running in interactive mode or using pyside.
if __name__ == '__main__':
import sys
if (sys.flags.interactive != 1) or not hasattr(QtCore, 'PYQT_VERSION'):
QtGui.QApplication.instance().exec_()
inf1.setPos([2,2])
p1.addItem(inf1)
p1.addItem(inf2)
p1.addItem(inf3)
# Add a linear region with a label
lr = pg.LinearRegionItem(values=[70, 80])
p1.addItem(lr)
label = pg.InfLineLabel(lr.lines[1], "region 1", position=0.95, rotateAxis=(1,0), anchor=(1, 1))
## Start Qt event loop unless running in interactive mode or using pyside.
if __name__ == '__main__':
import sys
if (sys.flags.interactive != 1) or not hasattr(QtCore, 'PYQT_VERSION'):
QtGui.QApplication.instance().exec_()
def clicked():
print("curve clicked")
curve.sigClicked.connect(clicked)
lr = pg.LinearRegionItem([1, 30], bounds=[0,100], movable=True)
pw3.addItem(lr)
line = pg.InfiniteLine(angle=90, movable=True)
pw3.addItem(line)
line.setBounds([0,200])
## Start Qt event loop unless running in interactive mode or using pyside.
if __name__ == '__main__':
import sys
if (sys.flags.interactive != 1) or not hasattr(QtCore, 'PYQT_VERSION'):
QtGui.QApplication.instance().exec_()
r.set(key, bluefreq+bluewidth)
# Set timer for update
timer = QtCore.QTimer()
timer.timeout.connect(update)
timer.setInterval(10) # timeout in milliseconds
timer.start(int(round(stepsize*1000))) # in milliseconds
# Wait until there is enough data
begsample = -1
while begsample<0:
hdr_input = ft_input.getHeader()
begsample = int(hdr_input.nSamples - window)
# Start
QtGui.QApplication.instance().exec_()
a.showGrid(x=True, y=True)
for i in range(2, len(listing), 2):
print i
if i % 3 == 0:
win.nextRow()
p1 = win.addPlot(title=title[i/ 2][6:title[i/2].find(',')])
p1.plot(listing[i], listing[i + 1])
p1.showGrid(x=True, y=True)
p1.setXLink(a)
p1.setYLink(a)
if __name__ == '__main__':
import sys
if (sys.flags.interactive != 1) or not hasattr(QtCore, 'PYQT_VERSION'):
QtGui.QApplication.instance().exec_()
time_curve.setData(total_data)
# calculate the FFT
fft_data = data_sample * np.hanning(len(data_sample))
power_spectrum = 20 * np.log10(np.abs(np.fft.rfft(fft_data))/len(fft_data))
fft_curve.setData(power_spectrum)
fft_plot.enableAutoRange('xy', False)
timer = QtCore.QTimer()
timer.timeout.connect(update)
timer.start(0)
## Start Qt Event
if __name__ == '__main__':
import sys
if (sys.flags.interactive != 1) or not hasattr(QtCore, 'PYQT_VERSION'):
QtGui.QApplication.instance().exec_()
# stop Recording
stream.stop_stream()
stream.close()
audio.terminate()
index = 0
def update():
global p4, z, index
index -= 1
p4.setData(z=z[index%z.shape[0]])
timer = QtCore.QTimer()
timer.timeout.connect(update)
timer.start(30)
## Start Qt event loop unless running in interactive mode.
if __name__ == '__main__':
import sys
if (sys.flags.interactive != 1) or not hasattr(QtCore, 'PYQT_VERSION'):
QtGui.QApplication.instance().exec_()