作家
登录

那些有趣/用的Python库

作者: 来源: 2017-08-08 17:28:09 阅读 我要评论

图片处理

  1. pip install httpstat 
  2.  
  3. httpstat httpbin.org/get 
  1. pip install pillow 
  2.  
  3. from PIL import Image 
  4.  
  5. import numpy as np 
  6.  
  7. a = np.array(Image.open('test.jpg')) 
  8.  
  9. b = [255,255,255] - a 
  10.  
  11. im = Image.fromarray(b.astype('uint8')) 
  12.  
  13. im.save('new.jpg' 

youtube-dl下载国外视频

  1. pip install youtube-dl #直接安装youtube-dl 
  2.  
  3. pip install -U youtube-dl #安装youtube-dl并更新 
  4.  
  5. youtube-dl "http://www.youtube.com/watch?v=-wNyEUrxzFU"  

查看对象的全部属性和办法

  1. pip install pdir2 
  2.  
  3. >>> import pdir,requests 
  4.  
  5. >>> pdir(requests) 
  6.  
  7. module attribute: 
  8.  
  9.     __cached__, __file__, __loader__, __name__, __package__, __path__, __spec__ 
  10.  
  11. other: 
  12.  
  13.     __author__, __build__, __builtins__, __copyright__, __license__, __title__, 
  14.  
  15. __version__, _internal_utils, adapters, api, auth, certs, codes, compat, cookies 
  16.  
  17. , exceptions, hooks, logging, models, packages, pyopenssl, sessions, status_code 
  18.  
  19. s, structures, utils, warnings 
  20.  
  21. special attribute: 
  22.  
  23.     __doc__ 
  24.  
  25. class: 
  26.  
  27.     NullHandler: This handler does nothing. It's intended to be used to avoid th 
  28.  
  29.  
  30.     PreparedRequest: The fully mutable :class:`PreparedRequest <PreparedRequest> 
  31.  
  32. ` object, 
  33.  
  34.     Request: A user-created :class:`Request <Request>` object. 
  35.  
  36.     Response: The :class:`Response <Response>` object, which contains a 
  37.  
  38.     Session: A Requests session. 
  39.  
  40. exception: 
  41.  
  42.     ConnectTimeout: The request timed 
     1/11    1 2 3 4 5 6 下一页 尾页

      推荐阅读

      Windows 10 16257完美启用控制台新版配色的操作方法

    很多人在启用Windows10 16257控制台的新版配色时,发清楚明了一个小问题,那就是“大年夜Win+X菜单启动的Powershell和CMD标题栏上右击,选择“属性”,弹出窗口的色彩选项>>>详细阅读


    本文标题:那些有趣/用的Python库

    地址:http://www.17bianji.com/lsqh/36609.html

关键词: 探索发现

乐购科技部分新闻及文章转载自互联网,供读者交流和学习,若有涉及作者版权等问题请及时与我们联系,以便更正、删除或按规定办理。感谢所有提供资讯的网站,欢迎各类媒体与乐购科技进行文章共享合作。

网友点评
自媒体专栏

评论

热度

精彩导读
栏目ID=71的表不存在(操作类型=0)