title: Python & InfluxDB: get most recent measurement
body: <p>First, some context about my application:</p>
  
  <ul>
  <li>Databases were created on InfluxDB (in my VM)</li>
  <li>I am already writing in a measurement</li>
  <li>The script runs at a frequency of once per minute</li>
  </ul>
  
  <p>I need to write a Python script to read the database. I want to fetch only the most recent measurement value, not all values.</p>
  
  <p>Here is my code:</p>
  
  <pre class="lang-python prettyprint-override"><code>from influxdb import InfluxDBClient
  
  client = InfluxDBClient(database='test')
  client = InfluxDBClient()
  
  rs = cli.query("SELECT * from CoreTemperature")
  CoreTemperature = list(rs.get_points(measurement='CoreTemperature'))
  
  print(CoreTemperature)
  </code></pre>
  
  <p>I am stuck because of:</p>
  
  <ol>
  <li>The output of this code is: <code>**NameError: name 'cli' is not defined**</code></li>
  <li>Filtering by measurement and <code>select * from CoreTemperature</code> will read all points saved for the measurement, but I only want the most recent value.</li>
  </ol>