Get the App
SLTechnology News&Howtos  ›  Internet Technology  › 

What is the installation and use of wxpy in python

Shulou Source: shulou.com Published: 2022-06-01 17:40:05 10月03日 Update

What is the installation and use of wxpy in python? I believe many inexperienced people don't know what to do about it. Therefore, this paper summarizes the causes and solutions of the problem. Through this article, I hope you can solve this problem.

Basic introduction to 1.wxpy

Wxpy is based on itchat and uses the communication protocol of Web Wechat. Through a large number of interface optimization, the ease of use of the module is improved and rich functional expansion is carried out. Achieve Wechat login, send and receive messages, search for friends, data statistics, Wechat official account, Wechat friends, WeChat group basic information and other functions. It can be used to realize the automatic operation of various Wechat personal accounts.

2.wxpy installation

Method 1: install directly

Pip install wxpy

Method 2: installation of bean valve source (recommended)

Pip install-I https://pypi.douban.com/simple/ wxpy3. Let's have something interesting (1) get the gender and location distribution data of Wechat friends.

Author: Python Automation Office Community

Data: 2020.1.3

Goal: get the gender, distribution and Wechat nicknames of Wechat friends, and [visual analysis]

''

From wxpy import *

# initialize a robot object

# cache_path cache path. The given value is the cache file path generated by the first login.

Bot = Bot ()

# get a friend list (including yourself)

My_friends = bot.friends (update=False)

''

Stats_text function: helps us to simply count the basic information of Wechat friends.

Text of simple statistical results: param total: total quantity: param sex: gender distribution: param top_provinces: provincial distribution: param top_cities: urban distribution: return: statistical result text''

Print (my_friends.stats_text ())

After reading the above, have you mastered how to install and use wxpy in python? If you want to learn more skills or want to know more about it, you are welcome to follow the industry information channel, thank you for reading!

Tags: Friends methods statistics gender information content functions data text more results caching paths problems login automation fun helpless for this location Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno Docker NVidia Linux vpn MariaDB