Can I use Shell or Python realize calling a C programe and give all the parameter it requires? -


i have met problem , have no knowledge whether can realized in shell bash or python.

i need run c programe several times, programe "atompot" tem image simulation. if run programe

./atompot 

its output this:

atompot version dated 8-oct-2012 ejk copyright (c) 1998-2010 earl j. kirkland program provided as-is absolutely no warranty under gnu general public license  calculate projected atomic potentials (to use in multislice) using fftw  name of file input crystal data : 

then need give input crtstal data file like:

stra.dat 

then can get:

name of file binary output of atomic potential : 

then give name:

straa.tif    

then get:

real space dimensions in pixels nx, ny : 

your answer :

512 512 

then output like:

 replicate unit cell ncellx,ncelly,ncellz : 

answer:

  8 8 8 

ask:

  want add thermal displacements atomic coord.? (y/n) : 

answer:

  n 

the proceduess this. can use shell or python realize calling c programe , give parameter requires make programe run automatically?

for example can change unit cell form 8 8 8 100 100 100. , keep other parameter same. seems can done in sheel script how realize c programe gives instruction of input.

thank you!

if program reads stdin, put in file:

stra.dat straa.tif 512 512 8 8 8 n 

and run:

./atompot < filename 

if want more complex (ie parse output or implement branching), subprocess.popen in python.


Comments

Popular posts from this blog

SPSS keyboard combination alters encoding -

Add new record to the table by click on the button in Microsoft Access -

javascript - jQuery .height() return 0 when visible but non-0 when hidden -