Python
斜梯
这个作者很懒,什么都没留下…
展开
-
Python - 条件表达式(三元操作符)
通过三元操作符的条件表达式用一条语句来完成以下的条件判断和赋值操作:x , y = 3 , 5if x < y : small = xelse: small = y可以更写为:small = x if x < y else y...原创 2020-03-09 21:33:49 · 441 阅读 · 0 评论 -
Python - if elif else
按照100分制,90分以上原创 2020-03-09 18:33:49 · 163 阅读 · 0 评论 -
Python : 使用Lassie两行代码检索页面内容
import lassielassie.fetch('https://www.ctolib.com/lassie.html')输出:import lassie...{'images': [{'src': 'https://www.ctolib.com/static/favicon.ico', 'type': 'favicon'}], 'videos': [], 'descri...原创 2020-03-06 16:34:35 · 281 阅读 · 0 评论 -
Python : 使用Pillow模块(加载、查看属性、显示)图片
from PIL import Image#打开一个jpg文件,注意是当前路径:im = Image.open('E:\\c4dWORK\\2.jpg')#使用实例属性检查文件内容print(im.format,im.size,im.mode)#显示图像im.show()输出:JPEG (1920, 1908) RGBPIL模块中最重要的类 Image,创建Image...原创 2020-03-05 17:18:39 · 4468 阅读 · 1 评论