title: Programmatically list all variables of a NetCDF file using netCDF4 and Python
body: <p>How do I programmatically list all variables of a <a href="https://en.wikipedia.org/wiki/NetCDF" rel="nofollow noreferrer">NetCDF</a> file that I have read in using netCDF4 and Python?</p>
  <pre><code>import netCDF4
  dset = netCDF4.Dataset('test.nc')
  </code></pre>