Add more python variable tests

This commit is contained in:
Richard Berger
2021-03-24 12:43:47 -04:00
parent 8790ecc141
commit 9d3e37b102
2 changed files with 71 additions and 4 deletions

View File

@ -4,6 +4,11 @@ from __future__ import print_function
def square(val):
return val*val
def bool_to_val(txt):
if txt.upper() in ["TRUE", "YES"]:
return 1.0
return 0.0
def printnum():
print("2.25")
@ -11,8 +16,7 @@ def printtxt():
print("sometext")
def getidxvar(lmpptr):
from lammps import lammps, LMP_VAR_EQUAL
from lammps import lammps
lmp = lammps(ptr=lmpptr)
val = lmp.extract_variable("idx",None,LMP_VAR_EQUAL)
val = lmp.extract_variable("idx")
print(val)