I have a python code that takes measurements off of a HP LCR Meter and collects the data for us in various ways. I recently created a GUI for imputing initial conditions for employees not comfortable modifying variables in the code. Everything works except for 1 thing. WE use the latest python xy so python version 2.6.6 with pyqt and spyder on a windows 7 PC.
Normally we would open the code in spyder. But opening spyder takes a while and my supervisor liked the ability to just double click on the file which opens the GUI with a python console window to print errors and various information as you would see in spyder.
As can be seen in the screen shots provided, there is a initial machine setup mode for setting up the device to be scanned by the LCR Meter and there are two user inputs that the code prompts. On spyder it prints these prompts nicely in the console but in the python console opened without spyder it continuously prints QCoreApplication::exec: The event loop is already running
Weird thing is you can still just push enter twice as normal and the code will run like normal. But its going to be confusing to basically everyone but me.
Does anyone know why this would be happening?
Here are the pictures of the output
Here is the code that prompts the input.
lcr = visa.instrument('GPIB::17')
#clear the instrument
lcr.write('*RST;*CLS')
#enable operation complete notification
lcr.write('*OPC')
if parallel:
lcr.write('FUNC:IMP CPG') #Parallel capacitance, conductance model
else:
lcr.write('FUNC:IMP CSRS') #Series capacitance, resistance model
lcr.write('APER '+integration+','+averages)
lcr.write('OUTP:HPOW ON')
lcr.write('OUTP:DC:ISOL OFF')
lcr.write('VOLT '+vac)
lcr.write('TRIG:SOUR BUS')
if zero == True:
#set open correction parameters
lcr.write('DISP:PAGE CSET')
lcr.write('CORR:LENG 1')
lcr.write('CORR:METH SING')
lcr.write('CORR:LOAD CPG')
lcr.write('CORR:USE 10')
lcr.write('CORR:SPOT1:STATE ON')
lcr.write('CORR:SPOT2:STATE OFF')
lcr.write('CORR:SPOT3:STATE OFF')
lcr.write('CORR:SPOT1:FREQ '+frequency)
#perform open correction -> unprobe device\
raw_input('Unprobe DUT and press ENTER to continue...')
lcr.write('CORR:SPOT1:OPEN')
lcr.write('CORR:OPEN:STATE ON')
lcr.write('DISP:PAGE MEAS')
#poll lcr to determine measurment state
lcr.write('*OPC?')
done = lcr.read()
while done == 0:
lcr.write('*OPC?')
done = lcr.read()
time.sleep(0.5)
#reprobe device
raw_input('Probe DUT, then press ENTER')
lcr.write('FREQ '+frequency)
The Prompts are the two raw_input()
.