Forum Discussion
Hi Kate,
If you just need to download a file programmatically, you can use Python's urllib.request.urlretrieve:
import urllib.request
urllib.request.urlretrieve("http://example.com/myfile.exe", "C:\\myfile.exe")- Kate9 years agoContributor
Will it work with partial file name? How can I handle it?
There will be different versions in my file name in every run...
- AlexKaras9 years agoCommunity Hero
Hi,
> Will it work with partial file name?
Could you please provide more details or some example of what do you mean ?
- Kate9 years agoContributor
I mean that my script is expected to go to my jenkins release builder page and grab latest build (download .exe file)
Yesterday we had, for ex, build 1.2, and my file name was kind of 'myapp-1.2-install.exe'
Today it is 'myapp-1.3-install.exe'
Tomorrow it may be 'myapp-1.3.1-install.exe'
And so on...
So I need a flexible solution that will let me download a file by partial link, containing, let's say, 'myapp' and 'install.exe'
I can probably use regular expressions for that, but I do not have enough practical knowledge on that... So it will take toooo long for me.