How to use python to make micro-letter friends head Photo Wall?

This is not difficult, mainly used itchat and pillow these two libraries, which itchat for obtaining micro-letter friends head photos, pillow for splicing head to generate a photo wall, here I briefly explain the implementation process, code volume is also very easy to understand, the experimental environment win10 + python3.6 + pycharm5.0, the following major elements, look at the generated renderings:

1. First, download and install itchat, which is a micro-channel interface to package, designed to obtain micro-letter friends information, here we mainly use it to obtain micro-letter friends head information, installed, directly enter the command cmd window "pip install itchat" on the line ,as follows:

2. Next, install the pillow, which is an image processing library of python, specifically for processing images, here we mainly use it to splice micro-channel friend's head, generate photo wall, installed, similar to the above, directly in the cmd window input command "pip install pillow" on the line, as follows:

3. Finally, is to write the code to implement the photo wall to make the main code is as follows, the basic idea is to use itchat obtain micro letter friends information, then get to the micro-letter friend's head based on the acquired UserName information, downloaded to the local image folder Finally, re-use a pillow stitching a micro-channel friend's head, to generate a complete picture wall:

Click to run the program, scan code to log micro letter, it will automatically download micro letter friends head to the image folder, the download is complete, it will automatically generate a all.jpg pictures, it is the ultimate photo wall, but also micro letter sent to the phone, The final results are as follows:

So far, we've had to make use of python micro letter friends head photo wall. Overall, the entire process is not difficult, mainly used itchat and pillow these two libraries, as long as you have some basic python, familiarize yourself with the relevant code and example, to practice what soon will be able to master, but also related to online tutorials and information of interest, you can search for what I hope to share more content can help you, but also welcome comment, leave a message.

Original link: How to use python to make micro-letter friends head Photo Wall? - Hi, Wang Songbai - blog Park https://www.cnblogs.com/wangsongbai/p/10487308.html

Guess you like

Origin www.cnblogs.com/tongongV/p/10978838.html