How to Download a file to a specific path in the server : Python

前端 未结 2 1421
小蘑菇
小蘑菇 2021-01-14 06:31

How to download a file through http on to a local folder on my server in jython(or python)

The below code might work

os.chdir(\"/path/to/change/to\"         


        
2条回答
  •  攒了一身酷
    2021-01-14 07:09

    How about urllib.urlretrieve

    import urllib
    urllib.urlretrieve('http://python.org/images/python-logo.gif', '/tmp/foo.gif')
    

提交回复
热议问题