title: simple approach to create a template file to be changed as needed
body: <p>I have been trying to get into python programming for a bit but cannot find the right moment or project. Now I may have! I am trying to generate multiple files that are used as input for a DFT (density functional theory) software (quantum espresso) and I would like to use python for this.</p>
  <p>An input file looks like this:</p>
  <pre><code>&amp;control
   calculation         = 'scf'
   restart_mode        = 'from_scratch'
   prefix              = 'pto'
   disk_io             = 'low'
   tstress             = .true.
   tprnfor             = .true.
   etot_conv_thr       = 1.e-6
   forc_conv_thr       = 1.e-5
   verbosity           = 'high'
   pseudo_dir          = '../pp/'
   outdir              = 'pto'
  /
  
  &amp;system
   ibrav               = 6
   celldm(1)           = 7.37934
   celldm(3)           = 1.06428
   nat                 = 5
   ntyp                = 3
   ecutwfc             = 75.
  /
  
  &amp;electrons
   diagonalization     = 'ppcg'
   mixing_beta         = 0.1
   mixing_mode         = 'plain'
   conv_thr            = 1.e-10
  /
  
  ATOMIC_SPECIES
   Pb  207.2   Pb.upf
   Ti   47.867 Ti.upf
   O    15.999  O.upf
  
  ATOMIC_POSITIONS {crystal}
  Pb  0.0    0.0    z1
  O   0.5    0.5    z2 
  Ti  0.5    0.5    z3
  O   0.0    0.5    z4
  O   0.5    0.0    z5
  
  K_POINTS {automatic}
  3 3 3
  </code></pre>
  <p>What I would like to change is the <code>z1, z2, z3, z4 and z5</code> parts in the atomic positions section. My idea was to create a file like this to be used as a template, use it as input for the python script, search for z1 (and also the rest of the zX) and replace it with the value I need. Save to a new file and repeat as needed.</p>
  <p>The trouble is, I don't know how to approach this. I know how to generate the zZ values and that's about it.</p>
  <p>Is there a simple way to approach this?</p>
  <p>Thank you!</p>