Variable Substitution in Python

Hi,

Please I have the following python code.

x = time.strftime("%Y_%m_%d")
os.system("/gsn/mme/parse_ebm_log.pl -x /gsn/mme/ -u -r gsm -f /gsn/mme/mme01/ebs/A* >> /gsn/mme/mme01/+ str(x)_gsm.txt")
os.system("/gsn/mme/parse_ebm_log.pl -x /gsn/mme/ -u -r wcdma -f /gsn/mme/mme01/ebs/A* >> /gsn/mme/mme01/+ str(x)_wcdma.txt")

How do i introduce the variable 'x' so as to use the time to name my files?

Try this

x = time.strftime("%Y_%m_%d")
os.system("/gsn/mme/parse_ebm_log.pl -x /gsn/mme/ -u -r gsm -f /gsn/mme/mme01/ebs/A* >> /gsn/mme/mme01/+ str(" + x + ")_gsm.txt")
os.system("/gsn/mme/parse_ebm_log.pl -x /gsn/mme/ -u -r wcdma -f /gsn/mme/mme01/ebs/A* >> /gsn/mme/mme01/+ str(" + x + ")_wcdma.txt")

Thanks SriniShoo!

But the code was still giving errors, so i played around with your suggestion and finally this one worked.

x = time.strftime("%Y_%m_%d")
os.system("/gsn/mme/parse_ebm_log.pl -x /gsn/mme/ -u -r gsm -f /gsn/mme/mme01/ebs/A* >> /gsn/mme/mme01/'" + x + "'_gsm.txt")
os.system("/gsn/mme/parse_ebm_log.pl -x /gsn/mme/ -u -r wcdma -f /gsn/mme/mme01/ebs/A* >> /gsn/mme/mme01/'" + x + "'_wcdma.txt")