python 下载模块和时间模块

Posted on Posted in python

python 两个模块

下载模块 wget

documentation

#!/usr/bin/env python3
# -*- coding: utf-8 -*-

import wget
url = 'https://mirrors.aliyun.com/ubuntu-releases/releases/18.04.1/ubuntu-18.04.1-desktop-amd64.iso'

filename = wget.download(url, out="./tmp")

时间模块 pendulum

documentation

#!/usr/bin/env python3
# -*- coding: utf-8 -*-

import pendulum

now = pendulum.now()
today = pendulum.today()
tomorrow = pendulum.tomorrow()
yesterday = pendulum.yesterday()
print(now.format('dddd DD MMMM YYYY'))
print(now.format('ddd DD MMMM YYYY'))
print(now.format('YYYY-MM-DD-d'))
print(now.format('YYYY-MM-DD-d HH:mm:ss A'))
print(now.timestamp())
print(now.int_timestamp)
print(now)
print(today)
print(tomorrow)
print(yesterday)

>>>

Wednesday 28 November 2018
Wed 28 November 2018
2018-11-28-3
2018-11-28-3 14:07:03 PM
1543385223.227654
1543385223
2018-11-28T14:07:03.227654+08:00
2018-11-28T00:00:00+08:00
2018-11-29T00:00:00+08:00
2018-11-27T00:00:00+08:00
» 转载请注明来源:呢喃 » python 下载模块和时间模块

Leave a Reply

Your email address will not be published. Required fields are marked *

19 − 8 =