import logging, configparser, sys, os, json, time, logging, sseclient, urllib3,re, threading, pandas as pd, datetime, requests from PyQt5.QtWidgets import QApplication, QWidget, QGridLayout logging.basicConfig(level=logging.INFO, format='%(asctime)s - %(levelname)s: %(message)s') from strategy.w_BigMidSmall_liangbi_pool import w_bms_liangbi class ThreadMain(threading.Thread): def __init__(self): super(ThreadMain, self).__init__() def funcmain(self, arg): print(arg) class subThread(threading.Thread): def __init__(self): global ThreadMain threading.Thread.__init__(self) def run(self): ThreadMain.funcmain(self,'myargs') def run(self) -> None: while True: threads = [] try: for i in range(3): # 创建新线程 subthread = self.subThread() subthread.start() threads.append(subthread) for thread in threads: thread.join() except: pass time.sleep(2) t = ThreadMain() t.start()
python 类里面定义类
于 2022-07-07 23:31:29 首次发布