title: How to control Newport controller model 8742 with python?
body: <p>I have the Newport New Focus Picomotor Controller/Driver, Model 8742, and it comes with software to control the motors. I want to be able to command the controller with python. There is a similar question here already but for some reason that code is not working for me. So far I have</p>
  
  <pre><code>import serial as s
  from time import sleep
  
  try:
      s.Serial.close()
  except:
      pass
      ser= s.Serial('COMX',baudrate=921600,timeout=1.0,parity=s.PARITY_NONE,stopbits=s.STOPBITS_ONE,bytesize=s.EIGHTBITS)
      command = '1PAU0.00\r\n'
      bcommand = bytes(command,'UTF-8')
      a = ser.write(bcommand)
      sleep(0.1)
      print(ser.read(10))
      ser.close() 
  </code></pre>
  
  <p>Part of the problem is that I'm not sure what port number I put in the code where 'COMX' is inserted. This is my first time using python for serial communication, so any help is appreciated. Thank you.</p>