Skip to content

Instantly share code, notes, and snippets.

@benelog
Last active August 29, 2015 14:06
Show Gist options
  • Star 3 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save benelog/825fef3296e294eeddbd to your computer and use it in GitHub Desktop.
Save benelog/825fef3296e294eeddbd to your computer and use it in GitHub Desktop.
철도예약
git clone git://github.com/carpedm20/korail2.git
cd korail2
python setup.py install
#-*- 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