title: Python ,SQLAlchemy, get id from database
body: <p>I want to make a Python (SQLAlchemy) program that takes the ID from a table according to a value.</p>
  
  <p>For example, I have a table like this :</p>
  
  <pre><code>-------------------------------
  |     ID       |     Name     |
  -------------------------------
  |     1        |     Paul     |
  -------------------------------
  |     2        |     Paul     |
  -------------------------------
  |     3        |     John     |
  -------------------------------
  </code></pre>
  
  <p>And I want to retrieve the IDs where the name is Paul.</p>
  
  <p>The code I was doing was something like this :</p>
  
  <pre><code>list = session.query(Table).filter_by(Name='Paul')
  list_id = []
  for tuple in list :
     list_id.append(tuple.id)
  for id in list_id :
     print(id)
  </code></pre>
  
  <p>Is there any much easier solution?</p>
  
  <p>Thanks!</p>