Thursday, 8 September 2016

Bus time prediction script in Chicago , USA with python

Bus time prediction script in USA with python :  This script will tell you at what time the nest Bus coming towards your way in Chicago ,USA .

 Here i am using following website for route and Bus prediction .

Lets  create a file called and copy the following code to it .

import urllib.request
import sys
if len(sys.argv) !=3:
        raise SystemExit('We need route and stopid.')
from xml.etree.ElementTree import XML
for pt in doc.findall('.//pt'):

Now  save the file and run this as :  python3.4 22 14787

here 22 is route  and 14787 is bus-stop .

You will get following result :

 Enjoy . :)

Connect With Me: Facebook 

No comments:

Post a Comment

Popular Posts