title: Python : AttributeError: 'Serial' object has no attribute 'is_open' for real time data
body: <p>hello i have a problem with my current code. i want to plot a real time signal for my ecg from my udoo. buat when i connect the serial it getting like this :</p>
  
  <pre><code>Traceback (most recent call last):
    File "plot_serial.py", line 10, in &lt;module&gt;
      if userial.is_open:
  AttributeError: 'Serial' object has no attribute 'is_open'
  </code></pre>
  
  <p>here's my code :</p>
  
  <pre><code>import serial
  import time
  import matplotlib.pyplot as plt
  import numpy as np
  
  ubaudrate = 9600
  uport = '/dev/ttyMCC'  # set the correct port before run it
  userial = serial.Serial(uport, ubaudrate, timeout=1)
  userial.timeout = 10 
  if userial.is_open:
      while True:
          size = userial.inWaiting()
          if size:
              data = userial.read(size)
              plt.figure
              plt.plot(size, data, 'b', alpha=0.75)
              plt.legend(('Sinyal Jantung'), loc='best')
              plt.grid(True)
              plt.show()
  
              #print data
          else:
              print ('no data')
          time.sleep(1)
  else:
      print ('serial not open')
  # z1serial.close()  # close z1serial if z1serial is open.
  </code></pre>
  
  <p>thanks for your help before, since i'm newbie in python programming</p>