コード例 #1
0
ファイル: viewer.py プロジェクト: ClearBlade/OPC-Adapter
def main():
    nasdaq = StockMarket("NASDAQ", ["AAPL", "CSCO", "MSFT", "GOOG"])
    newyork = StockMarket("NYSE", ["IBM", "HPQ", "BP"])

    agg = Aggregator()
    agg.add_market(nasdaq)
    agg.add_symbols(nasdaq.symbols)
    agg.add_market(newyork)
    agg.add_symbols(newyork.symbols)
    print("aggregated symbols:", agg.symbols)

    view = Viewer()
    view.aggregator(agg, ["IBM", "AAPL", "MSFT"])
    view.print_quotes()
コード例 #2
0
ファイル: main.py プロジェクト: adityax10/Pyro4
def main():
    nasdaq=StockMarket("NASDAQ", ["AAPL", "CSCO", "MSFT", "GOOG"])
    newyork=StockMarket("NYSE", ["IBM", "HPQ", "BP"])

    agg=Aggregator()
    agg.add_symbols(nasdaq.symbols())
    agg.add_symbols(newyork.symbols())
    print("aggregated symbols:", agg.available_symbols())

    nasdaq.listener(agg)
    newyork.listener(agg)

    view=Viewer()
    agg.view(view, ["IBM", "AAPL", "MSFT"])
    print("")
    while True:
        nasdaq.generate()
        newyork.generate()
        time.sleep(0.5)
コード例 #3
0
ファイル: main.py プロジェクト: benkahle/snake3d
def main():
    nasdaq=StockMarket('NASDAQ',['AAPL','CSCO','MSFT','GOOG'])
    newyork=StockMarket('NYSE',['IBM','HPQ','BP'])

    agg = Aggregator()
    agg.add_symbols(nasdaq.symbols())
    agg.add_symbols(newyork.symbols())
    print("aggregated symbols: ", agg.available_symbols())

    nasdaq.listener(agg)
    newyork.listener(agg)

    view=Viewer()
    agg.view(view, ['IBM','AAPL','MSFT'])
    print("")
    while True:
        nasdaq.generate()
        newyork.generate()
        time.sleep(0.5)