GithubHelp home page GithubHelp logo

shanbay-cli's Introduction

程序

一个在命令行下,通过扇贝查询单词的程序。

查询过程中可以选择性得将其加入单词计划中。这个功能使用前,需要人工登录并记录下cookie。

使用

  1. 程序在使用时会尝试读取~/.lshanbay/cookie文件作为发送http请求时所带的cookie。若没有这个文件,则会输出一行错误信息,但查询功能不受影响。

  2. 直接使用命令行第一个参数指定要查询的单词

python shanbay.py word
  1. 使用参数-c指定查询时使用的cookie
python shanbay.py -c "your cookie"
or
python shanbay.py --cookie "your cookie"
  1. 在makefile中使用 pyinstaller将shanbay.py打包为一个可执行文件。make install会将其放在~/bin目录下,并建立~/.lshanbay/cookie文件。

例子

$ python shanbay.py server
----------------------------------------
-> Server ['sɜːrvər]
 n. 服伺者,服勤者,伺候者
----------------------------------------
Definitions in English:
- 1: a person whose occupation is to serve at table (as in a restaurant)
- 2: (court games) the player who serves to start a point
- 3: (computer science) a computer that provides client stations with access to files and printers as shared resources to a computer network
----------------------------------------
$ python shanbay.py -c "your cookie"
% python shanbay.py Valor
---------- UserId:   userId ----------
-> valor ['vælə] -0▄▅▆▇█-
 n. 勇气, 英勇,勇猛
----------------------------------------
Definitions in English:
- 1: the qualities of a hero or heroine; exceptional or heroic courage when facing danger (especially in battle)
----------------------------------------
A NEW word for you, learn it? [Y] for yes: yes
----------------------------------------
% ./shanbay.py epitome
---------- UserId:   userId ----------
-> epitome [ɪ'pɪtəmi] -▃▄2▆▇█-
 n. 摘要, 缩影, 化身
----------------------------------------
Definitions in English:
- 1: a standard or typical example
- 2: a brief abstract (as of an article or book)
----------------------------------------
An OLD word for you, learn it? [Y] for yes: yes
----------------------------------------
% ./shanbay.py shanbay    
---------- UserId:   userId ----------
Unknow word!
----------------------------------------

shanbay-cli's People

Contributors

lmzqwer2 avatar

Watchers

 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.