Hi, 
I am fairly new to python and i am looking for a python script to
download file(latest build) from the server. But, the build name changes
daily. For Ex:  today the build URL will be
"http://mybuilds/myapp_1234.exe"; and tomorrow it will be 
"http://myserver/mybuilds/myapp_3456.exe";.  So i need a script which downloads
the latest build without any knowledge of build number. 
 Can anyone  help me? 
Advance thanks, 


This is my start:

###################################################################
import os,sys,httplib,time,
Server="myserver"
Build2Download=mybuilds/myapp_3456.exe
installer=myapp_3456.exe

    print "Downloading Installer... from the site:%s"%Server
    connection=httplib.HTTPConnection(Server)
    connection.request("GET",Build2Download)
    resp = connection.getresponse()
    if resp.status != 200:
        print "Error getting installer.  GET response : %d %s" % (resp.status, 
resp.reason)
        sys.exit(-1)   
    try:
        open(Installer, 'wb').write(resp.read())
        time.sleep(15)
    except:
        pass


###################################################################
The build number keeps changing. So how can i use wildchars(?) or something 
else to handle change in the build no.?

Advance Thanks,

Murali.



      
--
http://mail.python.org/mailman/listinfo/python-list

Reply via email to