in my dream.
However anyway, I can use this one-liner to accomplish the most frequently used action with wget and curl:
python -c "url='http://glaros.dtc.umn.edu/gkhome/fetch/sw/metis/metis-4.0.tar.gz'; import urllib; open(url.split('/')[-1], 'wb').write(urllib.urlopen(url).read())"
Just replace the url string as you wish.
Update:
This could be a better version:
python -c "import urllib, sys; open(sys.argv[1].split('/')[-1],'wb').write(urllib.urlopen(sys.argv[1]).read())" http://glaros.dtc.umn.edu/gkhome/fetch/sw/metis/metis-4.0.tar.gz
Posted by yungyuc
at 14:43,
0 comment,
0 trackback.
Navigate
- Previous: 治療系的修改 @2007/07/03
- Next: 自編 Python 要記得裝的 dependency (Debian) @2007/07/05
Add a trackback
Please send trackback to: http://blog.seety.org/everydaywork/2007/7/4/689/trackback/.
Add a comment