Run Unix shell command $ parse command line arguments in python

rkoida at yahoo.com rkoida at yahoo.com
Fri Apr 22 02:39:03 EDT 2005


  Hello evryone

     I am a newbie to python. I have a makefile which i can compile in
UNIX/LINUX, But i
I am planning to write a python script which actually does what my
MAKEFILE does. The make file is

#Makefile and some scripts to give output
#numbers
#Change till sign #END
var1:=564-574
a1 = 23
b1 = 678
kxm = ixm_7.gh
out = c$(var1)_s.gh
imageim
#END
#other files
file1 = sec$(b1).jk
file2 = sgf$(a1)
file3 = p$(b1).gh
prg3scriptfile = prg3_produce.xx
findoutdir = Dir:~/home/
x=67
#work
evrything: prg1 script2 prg3 script4
withoutprg1: script2 prg3 script4
prg1:
        s$(ca)$(d) .

script2: Makefile
       ./script2 -i '$(file2)' -o '$(file1)' -a $(x) -n

prg3:
        : > $(prg3scriptfile)
>>  $(prg3scriptfile)
        prg3 $(prg3scriptfile)
        rm $(prg3scriptfile)
script4:
        ./script4 $(kxm) $(file2)  $(out)  $(var1)

I want to write a python script to replace this Makefile.
I Have tried using getopt/optparse for parsing command line options
How to Run  Unix shell command from python.

My Task is

Myprg.py a1 b1 kxm out

Kindly suggest me some ideas/comments.

Thanks
koid wayne




More information about the Python-list mailing list