Python equivalent of a given wget command

前端 未结 10 2190
面向向阳花
面向向阳花 2020-12-02 10:04

I\'m trying to create a Python function that does the same thing as this wget command:

wget -c --read-timeout=5 --tries=0 \"$URL\"

-c

10条回答
  •  野趣味
    野趣味 (楼主)
    2020-12-02 10:48

    TensorFlow makes life easier. file path gives us the location of downloaded file.

    import tensorflow as tf
    tf.keras.utils.get_file(origin='https://storage.googleapis.com/tf-datasets/titanic/train.csv',
                                        fname='train.csv',
                                        untar=False, extract=False)
    

提交回复
热议问题