This page looks plain and unstyled because you're using a non-standard compliant browser. To see it in its best form, please upgrade to a browser that supports web standards. It's free and painless.

Your sexiest photo
calendar
« February 2010 »
Mo Tu We Th Fr Sa Su
1 2 3 4 5 6 7
8 9 10 11 12 13 14
15 16 17 18 19 20 21
22 23 24 25 26 27 28
recently...
Need script to download file from a server using python script
Congratulations!
syndicate
RSS 0.90
RSS 1.0
RSS 2.0
Atom 0.3

Need script to download file from a server using python script

murali 23 January, 2009 00:56 General Permalink Trackbacks (0)

Hi,

I am fairly new to python and i am looking for a python script to download 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://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,

Murali

Comments

Your file

Peter | 12/02/2009, 13:03

Hello Murali,

I think what you want to achieve is pretty hard (the number part).
Actually fetching a file from a server is pretty straight forward in Python
just import urllib2 and play around a little bit. There are also pretty simple and good tutorials online e.g. http://www.voidspace.org.uk/python/articles/urllib2.shtml which probably is enough for your purpose.
Now for the number part.
Did you find a pattern after which the number is generated? If so try to get a loop working or write a simple function which generates the number and passes the number via a return to the function with the urllib2 file fetching part. If there is no pattern you don't have a chance. Maybe if you have a HTML-file which links to this file you might want to try to work with regular expressions finding the number or the whole link in question.

Your file

Peter | 12/02/2009, 13:04

Hello Murali,

I think what you want to achieve is pretty hard (the number part).
Actually fetching a file from a server is pretty straight forward in Python
just import urllib2 and play around a little bit. There are also pretty simple and good tutorials online e.g. http://www.voidspace.org.uk/python/articles/urllib2.shtml which probably is enough for your purpose.
Now for the number part.
Did you find a pattern after which the number is generated? If so try to get a loop working or write a simple function which generates the number and passes the number via a return to the function with the urllib2 file fetching part. If there is no pattern you don't have a chance. Maybe if you have a HTML-file which links to this file you might want to try to work with regular expressions finding the number or the whole link in question

Add comment
 authimage
archives
January 2009
categories
General [2]
my links
General