Skip to content

Instantly share code, notes, and snippets.

@spacemeowx2
Created July 11, 2019 11:59
Show Gist options
  • Save spacemeowx2/474e0ed62aabf712b72da511b00bf205 to your computer and use it in GitHub Desktop.
Save spacemeowx2/474e0ed62aabf712b72da511b00bf205 to your computer and use it in GitHub Desktop.
#!/usr/bin/env python3
import shbus.realtime
line = '733路'
direction = True
stop = 0
client = shbus.realtime.client()
response = client.getRealtimeBus(line, stop, direction=direction)
print(response.info.routes[0 if direction else 1].names[stop])
for i in response.items:
print('%s: 发车时间: %s' % (i.vehicle, i.time))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment