Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix window show and add readme.md #5

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# install
```
pip install docopt prettytable
python .\tickets.py 郑州 宁波 2018-02-01
```
5 changes: 3 additions & 2 deletions tickets.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
from datetime import datetime
from docopt import docopt
from prettytable import PrettyTable
from colorama import Fore
from colorama import Fore, init
from requests.packages.urllib3.exceptions import InsecureRequestWarning

requests.packages.urllib3.disable_warnings(InsecureRequestWarning)
Expand Down Expand Up @@ -85,7 +85,7 @@ def pretty_print(self):
class Cli(object):

url_template = (
'https://kyfw.12306.cn/otn/leftTicket/query?leftTicketDTO.'
'https://kyfw.12306.cn/otn/leftTicket/queryZ?leftTicketDTO.'
'train_date={}&'
'leftTicketDTO.from_station={}&'
'leftTicketDTO.to_station={}&'
Expand Down Expand Up @@ -122,4 +122,5 @@ def run(self):


if __name__ == '__main__':
init()
Cli().run()