ntchat/examples/get_contacts.py
2022-08-23 16:16:11 +08:00

26 lines
403 B
Python

# -*- coding: utf-8 -*-
import sys
import ntchat
wechat = ntchat.WeChat()
# 打开pc微信, smart: 是否管理已经登录的微信
wechat.open(smart=False)
# 等待登录
wechat.wait_login()
# 获取联系人列表并输出
contacts = wechat.get_contacts()
print("联系人列表: ")
print(contacts)
try:
while True:
pass
except KeyboardInterrupt:
ntchat.exit_()
sys.exit()