Explorar el Código

修复读取项目根目录问题

Jack hace 1 año
padre
commit
bca622a135
Se han modificado 1 ficheros con 4 adiciones y 2 borrados
  1. 4 2
      message/message_coinmarketcap.py

+ 4 - 2
message/message_coinmarketcap.py

@@ -3,10 +3,12 @@
 使用 httpx 获取 coinmarketcap 最新数字币数据
 '''
 import time
-
+import os
+import sys
 import httpx
 import re
-from bs4 import BeautifulSoup
+
+sys.path.append(os.path.join(os.path.abspath(__file__).split('auto')[0] + 'auto'))
 
 from utils.utils_send_gotify import *