how to make a variable take a html link without formatting in python?
Question: I need to take a url input and use it in subprocess.call().how is it possible?
I wanted to write a loop so that it keeps on downloading images until required
by doing this

    
    
    for i in range(1,tot):
        subprocess.call(["wget","http://z.mfcdn.net/store/manga/10543/01-003.0/compressed/beelzebub_3.beelzebub_ch003_%02d.jpg"%num])
    

to automate this further. is there any way so that the user gives input like
`http://z.mfcdn.net/store/manga/10543/01-003.0/compressed/beelzebub_3.beelzebub_ch003_%02d.jpg`
and I can directly insert the variable into subprocess.call().

I Tried the following

    
    
    urlin=raw_input("input the url: ")
    for i in range(1,tot):
        subprocess.call(["wget",urlin\"%num"])
    

but it is not working.how to make it work.Hope you understood my problem..


Answer: You are declaring `i` as the iterator for your loop but you use an undeclared
`num`. Here is what I came up with (working on my computer):

    
    
    import subprocess
    
    numberImages = 3
    urlin=raw_input("input the url: ")
    for i in range(1,numberImages+1):
        print urlin%i
        subprocess.call(["wget",urlin%i])
    

used
`http://z.mfcdn.net/store/manga/10543/01-003.0/compressed/beelzebub_3.beelzebub_ch003_%02d.jpg`as
raw_input

here is my output:

    
    
    input the url: http://z.mfcdn.net/store/manga/10543/01-003.0/compressed/beelzebub_3.beelzebub_ch003_%02d.jpg
    http://z.mfcdn.net/store/manga/10543/01-003.0/compressed/beelzebub_3.beelzebub_ch003_01.jpg
    #Some wget download debug
    http://z.mfcdn.net/store/manga/10543/01-003.0/compressed/beelzebub_3.beelzebub_ch003_02.jpg
    #Some wget download debug
    http://z.mfcdn.net/store/manga/10543/01-003.0/compressed/beelzebub_3.beelzebub_ch003_03.jpg
    #Some wget download debug
    

