Q: External args as variables in SCPI I was wondering if there was a way to pull values through an interface such as cmd and pass them as arguments/variables to a SCPI (standard commands for programmable instruments) script. 
What I'm trying to do is to get a Python script interact with the user through the cmd and pull user-input voltages and currents into a SCPI script which will communicate with a programmable power supply. 

A: Example for communicating with a power supply using serial port with PySerial:
import serial
port = serial.Serial(0)  # open the first serial port
# do port configurations here...
voltage = input("Please enter voltage") 
port.write(":VOLT " + voltage + "\r\n") # writing the voltage
# Reading current:
port.write(":CURR?\r\n")      # query for the current
time.sleep(0.5) # wait for response (according your device speed)

# reads until \r\n:
current = bytearray()
while True:
    c = port.read(1)
    if c:
        current += c
        if current[-2:] == ['\n','\r']:
            break
    else:
        break

print("The current is: " + current.decode("ascii"))

Change the details and configuration according to your setup and interface.
Change the SCPI syntax and EOL (here it's '\r\n') according to your device programming manual.
