Those interesting Python library __python

Source: Internet
Author: User
Tags redis
Reprint Source Su Seng perplexed
Picture Processing
Pip Install Pillow
from PIL import Image
import NumPy as np

a = Np.array (Image.open (' test.jpg '))
B = [255, 255,255]-a
im = Image.fromarray (b.astype (' uint8 '))
im.save (' new.jpg ')
Parse Redis Dump.rdb
Pip install Rdbtools
> Rdb--command json/var/redis/6379/dump.rdb

[{
"user003": {"fname": "Ron", "sname" ":" Bumquist "},
" lizards ": [" Bush Anole "," Jackson's Chameleon "," Komodo Dragon "," Ground Agama "," bearded dragon "],
"user001": {"fname": "Raoul", "sname": "Duke"},
"user002": {"fname": "Gonzo", "sname": "Dr"},
"User_list" : ["user003", "user002", "user001"]},{"Baloon": {"Helium"
: "Birthdays", "medical": "Angioplasty", "Weather": " Meteorology "},
" Armadillo ": [" Chacoan naked-tailed "," Giant "," Andean Hairy "," nine-banded "," Pink Fairy "],
" Aroma ": {" pungent ":" Vinegar "," putrid ":" Rotten Eggs "," floral ":" Roses "}]
youtube-dl download Foreign videos
Pip install youtube-dl #直接安装youtube-dl
pip install-u youtube-dl #安装youtube-dl and update youtube-dl
"http:// Www.youtube.com/watch?v=-wNyEUrxzFU "
Asciinema Recording command line Operations
PIP3 Install Asciinema

Asciinema rec
asciinema play https://asciinema.org/a/132560 <script
type= "text /javascript "src=" https://asciinema.org/a/132560.js "
id=" asciicast-132560 "async></script>"
View all properties and methods of an object
Pip install pdir2 >>> import pdir,requests >>> Pdir (requests) module attribute: __cached__, __file__ , __loader__, __name__, __package__, __path__, __spec__ Other: __author__, __build__, __builtins__, __copyright__, __l  icense__, __title__, __version__, _internal_utils, adapters, API, Auth, certs, codes, Compat, cookies, exceptions, hooks, 
Logging, models, packages, PYOPENSSL, sessions, Status_code s, structures, utils, warnings special attribute: __doc__ Class:NullHandler:This handler does nothing. It ' s intended to is used to avoid th e preparedrequest:the fully mutable:class: ' Preparedrequest <preparedrequest&
Gt
    ' Object, request:a user-created:class: ' Request <Request> ' object.
Response:The:class: ' Response <Response> ' object, which contains a session:a session.
    Exception:ConnectTimeout:The request timed out with trying to connect to the remote server. CONNECTIONERROR:A Connection error occurRed. Dependencywarning:warned attempt is made to import a module with MI ssing optional filemodewarning:a file wa
    s opened in text mode and But Requests determined its binary length.
    Httperror:an HTTP error occurred.
    Readtimeout:the server did not send no data in the allotted amount of time.
    Requestexception:there was a ambiguous exception that occurred while Handl ing your the request timeout:the out.
    Toomanyredirects:too many redirects.
Urlrequired:a valid URL is required to make A request.
    Function:delete:Sends a delete request.
    Get:sends a GET request.
    Head:sends a head request.
    Options:sends a OPTIONS request.
    Patch:sends a patch request.
    Post:sends a POST request.
    Put:sends a put request.
    Request:constructs and sends A:class: ' Request <Request> '. Session:returns A:class: "Session" for Context-management.
Python play to NetEase cloud music
#https://github.com/ziwenxie/netease-dl pip install netease-dl
pip install ncmbot
import Ncmbot
#登录
bot = ncmbot.login (phone= ' xxx ', password= ' yyy ')
bot.content # Bot.json ()
#获取用户歌单
ncmbot.user_play_list ( Uid= ' 36554272 ')
Download Video Subtitles
Pip Install Getsub

Python Financial Data Interface Package

pip Install Tushare import tushare as TS #一次性获取最近一个日交易日所有股票的交易数据 ts.get_today_all () code, name, price, current, open, highest, lowest, latest closing, turnover , change hand Rate code name changepercent Trade open high-low settlement \ 0 002738 Ore resources 10.023 1     9.32 19.32 19.32 19.32 17.56 1 300410 zhengye technology 10.022 25.03 25.03 25.03 25.03 22.75-2  002736 Citic Securities 10.013 16.37 16.37 16.37 16.37 14.88 3 300412 Canaan Tech 10.010 31.54 31.54 31.54 31.54 28.67 4 300411 Golden Shield shares 

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.