Change Pip Conf in Global
1cat >> .pip/pip.conf << EOF 23[global] 45timeout = 6000 67index-url = https://pypi.douban.com/simple/ 89[install] 1011use-mirrors = true 1213mirrors = https://pypi.douban.com/simple/ 1415trusted-host = pypi.douban.com 1617EOF
1from PIL import Image 2import sys 3def gipit(pname): 4 with Image.open(pname) as im: 5 im.save(pname+'.jpeg', 'jpeg', progressive=True, optimize=True) 6if __name__ == '__main__': 7 _, pname = sys.argv 8 gipit(pname)
Flask logging 使用 Flask 时,如何优雅的输出日志。这些日志也许需要特定的格式,更丰富的信息,或者添加一些上下文的信息(如当前登录的用户名)等等。 根据官方文档
exec() Syntax: 1exec(object[, globals[, locals]]) 2 3:param object: As already said this can be a string or object code 4:param globals: This can be a dictionary and the parameter is optional 5:param locals: This can be a mapping object and is also optional eg.
1from math import * 2exec("print(factorial(5))", …