mirror of
https://github.com/smallevilbeast/ntchat.git
synced 2025-05-23 05:16:07 +08:00
26 lines
403 B
Python
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()
|