Changeset 9796d0a for python/example.py


Ignore:
Timestamp:
09/25/17 19:20:08 (7 years ago)
Author:
Hal Finkel <hfinkel@…>
Branches:
master, pympi
Children:
56b997e
Parents:
b02d091
git-author:
Hal Finkel <hfinkel@…> (09/25/17 19:20:08)
git-committer:
Hal Finkel <hfinkel@…> (09/25/17 19:20:08)
Message:

Add support for float4 (and similar) to Python bindings

File:
1 edited

Legend:

Unmodified
Added
Removed
  • python/example.py

    rc13d973 r9796d0a  
    3939 
    4040import sys 
     41import numpy as np 
    4142import genericio as gio 
    4243 
     
    4445gio.gio_inspect(name) 
    4546 
    46 x = gio.gio_read(name, "x") 
    47 print x 
     47if gio.gio_has_variable(name, "x"): 
     48  x = gio.gio_read(name, "x") 
     49  y = gio.gio_read(name, "y") 
     50  z = gio.gio_read(name, "z") 
     51  print np.column_stack((x, y, z)) 
     52else: 
     53  pos = gio.gio_read(name, "pos") 
     54  print pos 
    4855 
Note: See TracChangeset for help on using the changeset viewer.