mirror of
https://github.com/LC044/WeChatMsg
synced 2024-11-15 06:11:19 +08:00
30 lines
632 B
Python
30 lines
632 B
Python
import os.path
|
|
import sqlite3
|
|
|
|
DB = None
|
|
cursor = None
|
|
misc_path = "./app/Database/Msg/Misc.db"
|
|
# misc_path = './Msg/Misc.db'
|
|
if os.path.exists(misc_path):
|
|
DB = sqlite3.connect(misc_path, check_same_thread=False)
|
|
# '''创建游标'''
|
|
cursor = DB.cursor()
|
|
|
|
|
|
def get_avatar_buffer(userName):
|
|
sql = '''
|
|
select smallHeadBuf
|
|
from ContactHeadImg1
|
|
where usrName=?;
|
|
'''
|
|
cursor.execute(sql, [userName])
|
|
result = cursor.fetchall()
|
|
# print(result[0][0])
|
|
if result:
|
|
return result[0][0]
|
|
return None
|
|
|
|
|
|
if __name__ == '__main__':
|
|
get_avatar_buffer('wxid_al2oan01b6fn11')
|