[Chicago] Python in the browser IDE

Carl Karsten carl at personnelware.com
Sat Mar 29 02:39:51 CET 2014


I pasted your code, ran it and now will share the link:

http://codepad.org/AUvZFWwd

Is that what you wanted? ;)

    p = urllib.urlopen('
http://chicago.transitapi.com/bustime/map/getStopPredictions.jsp?stop=5623&route=80
')
  File "/usr/lib/python2.5/urllib.py", line 82, in urlopen
    return opener.open(url)
...
  File "/usr/lib/python2.5/httplib.py", line 663, in connect
    socket.SOCK_STREAM):
IOError: [Errno socket error] (-2, 'Name or service not known')

I think they have it sandboxed so you can't do things like send spam.

There is also a Python 3.3.2+ shell on https://www.python.org/  (hit the
yellow [>_] button.)
but you can't upload a script or share the URL.. and urllib isn't this same?

----> 1 import urllib.urlopen
ImportError: No module named 'urllib.urlopen'

Someone else's problem.






On Fri, Mar 28, 2014 at 3:36 PM, Randy Baxley <randy7771026 at gmail.com>
wrote:
>
> Having a lot of fun writing little programs like:
>
> x = 5
> print(1 < x < 10)
> print(10 < x < 20 )
> print(x < 10 < x*10 < 100)
> print(10 > x <= 9)
> print(5 == x > 4)
> import urllib
>
> from xml.etree.ElementTree import parse
>
>
> def monitor():
>
>     p = urllib.urlopen('
http://chicago.transitapi.com/bustime/map/getStopPredictions.jsp?stop=5623&route=80
')
>     pdoc = parse(p)
>     for pre in pdoc.findall('pre'):
>         vid = pre.findtext('v')
>         eta = pre.findtext('pt')
>         print 'Bus number ', vid, 'will arrive in ', eta
>         print '---'
>
>
>     print '_'*10
> import time
> count = 0
> while count < 60 :
>     monitor()
>     count = count + 1
>     time.sleep(60)
>
> Someday I may also learn a framework but for now I am wondering if there
is a browser ide that I could just and paste to then share the link which I
could also run from safari on my phone?
>
> _______________________________________________
> Chicago mailing list
> Chicago at python.org
> https://mail.python.org/mailman/listinfo/chicago
>



--
Carl K
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/chicago/attachments/20140328/3f2b6f98/attachment.html>


More information about the Chicago mailing list