add tests for using python invoke and python style variables

This commit is contained in:
Axel Kohlmeyer
2020-10-12 06:17:16 -04:00
parent 8c5da70823
commit 24cec51e85
3 changed files with 73 additions and 3 deletions

18
unittest/python/func.py Normal file
View File

@ -0,0 +1,18 @@
from __future__ import print_function
def square(val):
return val*val
def printnum():
print("2.25")
def printtxt():
print("sometext")
def getidxvar(lmpptr):
from lammps import lammps, LMP_VAR_EQUAL
lmp = lammps(ptr=lmpptr)
val = lmp.extract_variable("idx",None,LMP_VAR_EQUAL)
print(val)