#!/usr/bin/env python
# -*- coding: utf-8 -*-
import urllib
import readline
n=1
while True:
print
quest = raw_input("In[%d]:= " % (n))
print
url = "http://integrals.wolfram.com/index.jsp?expr=D[%s,x]&random=false" % (quest)
req = urllib.urlopen(url).read()
resn = req.find(', x] ==</em><br/>')
if resn > 0:
print 'Out[%d]= %s' % (n,req[resn+17:req.find('</p>')])
else:
print 'Out[%d]= %s' % (n,quest)
n=n+1
http://storage3.static.itmages.ru/i/12/0525/h_1337955001_4392007_4ebf6fe107.png