Last active
August 29, 2015 14:06
-
-
Save benelog/825fef3296e294eeddbd to your computer and use it in GitHub Desktop.
철도예약
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
git clone git://github.com/carpedm20/korail2.git | |
cd korail2 | |
python setup.py install |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#-*- coding: utf-8 -*- | |
from korail2 import * | |
korail = Korail("회원번호", "비밀번호") | |
korail.login() | |
dep='부산' | |
arr='서울' | |
date='20140908' | |
time='163000' | |
psgrs = [AdultPassenger(1), ChildPassenger(1)] | |
trains = korail.search_train(dep, arr, date, time, train_type = TrainType.KTX , passengers=psgrs) | |
for train in trains: | |
print train | |
seat = korail.reserve(trains[0], psgrs) | |
print seat |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment