Exemple #1
0
def get_all_stock():
    df = ts.get_stock_basics()
    df['stock'] = df.index
    df = df.sort_values(by=['stock'], ascending=True)
    return df['stock'].tolist()


def exe(parms):
    print(parms['code'])
    get_all_day_data(parms['code'], parms['num'], parms['market'])


if __name__ == '__main__':
    a = time.clock()

    obj = DBConnection()
    dbcon = obj.connect2()

    num = 1

    stocks = get_all_stock()

    parms = [{
        'code': stocks[i],
        'num': num,
        'market': 1 if str(stocks[i]).startswith('60') else 0
    } for i in range(0, len(stocks))]
    pool = multiprocessing.Pool(processes=2)
    # result = pool.map(exe, parms)
    for i in stocks:
        print(i)
Exemple #2
0
from controllers.main_controller import MainController
from db.db_connection import DBConnection
from PyQt5 import QtWidgets
import sys

con = DBConnection()
app = QtWidgets.QApplication(sys.argv)

c = MainController(window=QtWidgets.QMainWindow(), db_connection=con)
#c = AdminWindowController(window=QtWidgets.QMainWindow(), db_connection=con)

sys.exit(app.exec())
 def __init__(self):
     self.db = DBConnection()
Exemple #4
0
from db.db_connection import DBConnection

db = DBConnection()