GithubHelp home page GithubHelp logo

classicvalues / stock-3 Goto Github PK

View Code? Open in Web Editor NEW

This project forked from felixglow/stock

1.0 0.0 0.0 13 KB

python使用线程池实时获取股票价格 python use threading pool to get the stock's price via terminal

Python 100.00%

stock-3's Introduction

Stock

终端实时获取股票价格

给有需要的朋友,投资需谨慎。

用途:

实时查询股票价格,默认查询了沪指、深指
结果输出到终端
stock_terminal1.py 增加了实时涨幅和昨日收盘价

使用:

需要安装requests库
支持命令行多参数,如果需要帮助:
    python stock_terminal.py -h
设置查询代码(必传)   -c   
设置查询时间间隔(默认6秒)   -s   
设置线程数(默认3)(如果有需要)   -t    

查询 智慧农业 sz000816
例如:
    python stock_terminal.py -c sz000816 -t 4 -s 3

支持查询多个股票
例如:
    python stock_terminal.py -c sh601003,sz000816,sz000778

实现:

通过调用新浪股票API,实时查询股票价格
支持查询多支股票,通过threading多线程同时查询结果
通过Queue实现线程池
requests请求接口
optparse实现命令行参数处理

stock-3's People

Contributors

felixglow avatar xllbit avatar

Stargazers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.