python, character replacement

Hello, I need to do this in python but I'm just learning py and it's quite urgent.

I have a script I created and need an interactive python script to modify part of a line.

MY SCRIPT

#ligand prep. Uses 'ind' prefix. The initial ligand must be ind.pdb. This
#generates ind.pdbqt.
prepare_ligand4.py -l ind.pdb -A hydrogens_bonds -U nphs_lps -o ind.pdbqt

#First a 'generic' receptor must be made. Here the molecule should be called
#rec.pdb
#The receptor has ad atom types (t), gasteiger charges (q) added. This also
#adds non-polar hydrogens (nphs) and bonds (bonds) so a torsion root can be
#found. The output is a *pdbqt file ready for dockng. The command is:

prepare_receptor4.py -r rec.pdb -o rec_rigid.pdbqt -A 'bonds'-A 'checkhydrogens' -U 'nphs'
#where *.pdb is input file and the output will be pdbqt.

#The flex and rigid receptors, use the receptor pdbqt made earlier

**** prepare_flexreceptor4.py -r rec_rigid.pdbqt -s TYR119_TRP312 -x rec_flex.pdbqt

#Movable residue list seperated by underscores.
#-s is the movable residue; this is aswell as the backbone and amide bonds are
#fixed. This makes 2 files, a flexible and a rigid, that is rec_flex.pdbqt and
#rec_rigid.pdbqt. Use the rigid file for grid
#param file.-x flex.pdbqt

#prep of flex docking

*** prepare_flexdocking4.py -l ind.pdbqt -r rec_flex.pdbqt -s TYR119_TRP312

#To prepare a gpf we use the rigid ligand. Use:ligand_types for hsg1="A_C_HD_N_OA"
prepare_gpf4.py -l ind.pdbqt -r rec_rigid.pdbqt -x rec_flex.pdbqt -p npts="150 150 150" -i ref.grid

#The ligand types are those obtained from, prepare_ligand_dict.py -l ind.pdbqt
#-d ./ligand.types. ref.grid holds the co ordinates for docking.
#making a file called ligand.types containing the types of residues.
#Thes atoms are used in creating the dpf, docking parameter file.
#The docking parameter file contains the information on the docking.

prepare_dpf4.py -l ind.pdbqt -r rec_rigid.pdbqt -i ref.dpf -p flexres=rec_flex.pdbqt -p set_ga=lga -p ga_num_evals=5000000 -o ind_rec_rigid.dpf
#This uses the ligand atoms. Other parameters should be varied. The resulting
#flexres specifies the flexible residue file. dpf is ind_rec_rigid.dpf.

#Now autogrid4 and autodock4 can be used.
autogrid4 -p rec_rigid.gpf -l dock.glg
#this makes the necessary maps and logs. Use the rigid receptor.

autodock4 -p ind_rec_rigid.dpf -l my_docking.dlg &
#the dpf is named after the receptor and ligand. Producing the docking log
#(dlg) which contains any errors and the results.

######################### ###################################################

At the lines I marked ***
there is
-s TYR119_TRP312
I need to be able to change this.

For example I need a prog that says

'enter movable residues seperated by underscore:

then replaces the capitalised bit. eg 'enter residues:'
I type ALA1_LYS2

the prog puts this on the line at the correct point.

Thanks
ps I'm a biochemist. Learning py but it will be ages.