# Loading data with python

**URL:** https://discourse.paraview.org/t/loading-data-with-python/768
**Category:** ParaView Support
**Created:** [October 19, 2018, 2:17pm UTC](https://discourse.paraview.org/t/loading-data-with-python/768 "2018-10-19T14:17:17Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![cjd927](https://discourse.paraview.org/letter_avatar_proxy/v4/letter/c/d9b06d/32.png) [@cjd927](https://discourse.paraview.org/u/cjd927)
#### Post date: [October 19, 2018, 2:17pm UTC](https://discourse.paraview.org/t/loading-data-with-python/768/1 "2018-10-19T14:17:17Z")

</div>

Hi,

I’m using python scripts to automate the loading and slicing of data files. The data I am reading in is stored as point data. The problem I would like to solve is that I don’t always know the variable names that I am trying to load before I run my scripts. When I use the ParaView GUI, I can check the box next to point arrays to have it select all the variables when loading data. I can even go into the settings and check the “Load All Variables” box in the GUI and all of the point array variables will be prechecked when I load them. However when I use python to script this, I have to say something like the following:

dataFile = VisItTecplotBinaryReader(FileName=[fname])  
dataFile.PointArrayStatus = [‘Density’, ‘Pressure’, ‘etc’]

However, I have to already know that ‘Density’ and ‘Pressure’ are variables in my dataset so that I can load them in this fashion. Is there a way to load all of the variables in this fashion without specifying the unique variable names? Thanks for your help!

---

<div class="post-metadata">

### Author: ![banesullivan](https://discourse.paraview.org/user_avatar/discourse.paraview.org/banesullivan/32/11714_2.png) [@banesullivan](https://discourse.paraview.org/u/banesullivan)
#### Post date: [October 23, 2018, 6:11pm UTC](https://discourse.paraview.org/t/loading-data-with-python/768/2 "2018-10-23T18:11:42Z")

</div>

To access all of the available choices and their current status, you need to get the associated `Info` object which will have a list of the array name then the boolean status.

_Note: I do not have any sample VisItTecplot files to try this on but it works in this manner for other readers that have a checklist for data arrays._

```auto
>>> reader = VisItTecplotBinaryReader(FileName=[fname])
>>> # Which arrays are available?
>>> reader.GetProperty('PointArrayStatusInfo') # or reader.GetProperty('PointArrayInfo')
['Density', '0', 'Pressure', '0', 'foo', '0', 'goo', '0']

```

Then you can get that list and use it to activate all data arrays:

```auto
status = reader.GetProperty('PointArrayStatusInfo')
dataFile.PointArrayStatus = [status[i] for i in range(0, len(status), 2)]

```

Let me know if that does/doesn’t work: if it doesn’t, post an example file and I’ll make it work!

---

<div class="post-metadata">

### Author: ![cjd927](https://discourse.paraview.org/letter_avatar_proxy/v4/letter/c/d9b06d/32.png) [@cjd927](https://discourse.paraview.org/u/cjd927)
#### Post date: [October 29, 2018, 8:02pm UTC](https://discourse.paraview.org/t/loading-data-with-python/768/3 "2018-10-29T20:02:43Z")

</div>

Using this method with the reader.GetProperty(‘PointArrayInfo’) option worked perfectly! Thanks for the help.
