make python library tests python3 compatible

This commit is contained in:
Axel Kohlmeyer
2016-07-19 11:35:02 -04:00
parent 93497b4cd5
commit ec9c9a235a
2 changed files with 7 additions and 4 deletions

View File

@ -1,5 +1,7 @@
#!/usr/bin/env python -i
from __future__ import print_function
infile = 'in.simple'
me = 0
@ -19,8 +21,8 @@ lmp.scatter_atoms("x",1,3,x)
lmp.command("run 1");
f = lmp.extract_atom("f",3)
print "Force on 1 atom via extract_atom: ",f[0][0]
print ("Force on 1 atom via extract_atom: ",f[0][0])
fx = lmp.extract_variable("fx","all",1)
print "Force on 1 atom via extract_variable:",fx[0]
print ("Force on 1 atom via extract_variable:",fx[0])

View File

@ -6,6 +6,7 @@
# Syntax: simple.py in.lammps
# in.lammps = LAMMPS input script
from __future__ import print_function
import sys
infile = 'in.simple'
@ -27,8 +28,8 @@ lmp.scatter_atoms("x",1,3,x)
lmp.command("run 1");
f = lmp.extract_atom("f",3)
print "Force on 1 atom via extract_atom: ",f[0][0]
print ("Force on 1 atom via extract_atom: ",f[0][0])
fx = lmp.extract_variable("fx","all",1)
print "Force on 1 atom via extract_variable:",fx[0]
print ("Force on 1 atom via extract_variable:",fx[0])