Exemplo n.º 1
0
def runWithThread(stockids):
    s = QuoteSourceSina(stockids)
    #s = QuoteSourceQtimg(stockids)
    s.addListener(QuotePrinter())
    #s.addListener(QuotePercentInformer('510300'))
    s.addListener(QuoteDifferenceValueInformer('510050', '1.485', '-0.008', '0.005'))
    thread = QuoteThread(s)
    thread.setDaemon(True)
    thread.start()
    mainloop(thread)
Exemplo n.º 2
0
def runNoThread(stockids):
    s = QuoteSourceSina(stockids)
    #s = QuoteSourceQtimg(stockids)
    #s.addListener(QuotePrinter())
    #s.addListener(QuoteDifferenceValueInformer('510050', '0.0', '-0.008', '0.005'))
    s.addListener(QuoteSaveToCSV('510050'))
    s.addListener(
        QuoteDiffValuesInformer('510050', [-0.009, -0.019, -0.029],
                                [0.009, 0.019, 0.029], '0.0'))
    try:
        while True:
            s.queryStock()
            sleep(3)
    except KeyboardInterrupt, e:
        print 'StockQuote stop'
Exemplo n.º 3
0
def runNoThread(stockids):
    s = QuoteSourceSina(stockids)
    #s = QuoteSourceQtimg(stockids)
    #s.addListener(QuotePrinter())
    #s.addListener(QuoteDifferenceValueInformer('510050', '0.0', '-0.008', '0.005'))
    s.addListener(QuoteSaveToCSV('510050'))
    s.addListener(QuoteDiffValuesInformer('510050', [-0.009,-0.019,-0.029], [0.009, 0.019, 0.029], '0.0'))
    try:
        while True:
            s.queryStock()
            sleep(3)
    except KeyboardInterrupt, e:
        print 'StockQuote stop'
Exemplo n.º 4
0
def runWithThread(stockids):
    s = QuoteSourceSina(stockids)
    #s = QuoteSourceQtimg(stockids)
    s.addListener(QuotePrinter())
    #s.addListener(QuotePercentInformer('510300'))
    s.addListener(
        QuoteDifferenceValueInformer('510050', '1.485', '-0.008', '0.005'))
    thread = QuoteThread(s)
    thread.setDaemon(True)
    thread.start()
    mainloop(thread)