[Python-ideas] Python as a tool to download stuff for bootstrapping

anatoly techtonik techtonik at gmail.com
Tue Jul 10 09:01:02 CEST 2012


On Thu, Jul 5, 2012 at 11:24 PM, Amaury Forgeot d'Arc
<amauryfa at gmail.com> wrote:
> 2012/7/5 anatoly techtonik <techtonik at gmail.com>:
>> This makes me kind of sad. You have Python installed. Why can't you
>> just crossplatformly do:
>>
>>   mkdir nacl
>>   cd nacl
>>   python -m urllib get
>> http://commondatastorage.googleapis.com/nativeclient-mirror/nacl/nacl_sdk/update_sdk.py
>>   python update_sdk.py
>
> I'm sure there is already a way with standard python tools. Something
> along these lines:
>
> python -c "from urllib.request import urlretrieve; urlretrieve('URL',
> 'update_sdk.zip')"
> python -m update_sdk.zip
>
> The second command will work if the zip file has a __main__.py.
> Do you think we need other tools?

Wow! Nice, but still a hack. I doubt many people wouls accept magic
files messing in the root dir of the package. The only way it will
look good is:

    python -m update_sdk.zip sdk_update[.py]

but I don't know if that's supported.
--
anatoly t.



More information about the Python-ideas mailing list