title: How to define a global array in python
body: <p>How to define a global array in python
  I want to define tm and prs as global array, and use them in two functions, how could I define them?</p>
  
  <pre><code>import numpy as np 
  import matplotlib.pyplot as plt
  
  tm = []  
  prs = []
  
  def drw_prs_tm(msg):
      tm = np.append(tm,t)
      prs = np.append(prs,s)
  
  def print_end(msg):
      plt.plot(tm,prs,'k-')
  </code></pre>