Skip to content

Instantly share code, notes, and snippets.

@j-min j-min/srt_example.py
Last active Feb 3, 2019

Embed
What would you like to do?
Korean express train ticket reservation example
# pip install SRTpy (https://github.com/dotaitch/SRTpy)
from SRTpy import Srt
from heconvert.converter import h2e
from time import sleep
# Login
EMAIL = '' # email
PW = '' # password
srt = Srt(EMAIL, PW)
# Ticket Information
dep = h2e('동대구') # 출발
arr = h2e('수서') # 도착
date = '20180926' # YYYYMMDD
time = '110000' # HHMMSS
# Reservation
while True:
trains = srt.search(dep, arr, date, time)
if len(trains) > 0:
reservation = srt.reserve(trains[0])
print(reservation)
break
sleep(1)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.