0
from django.http import HttpResponse

import urllib2
import simplejson
import memcache


def epghome(request):
    mc=memcache.Client(['localhost:11211'])

    if mc.get("jsondata"):
        myval=mc.get("jsondata")

        return HttpResponse("<h1>This Data is coming from Cache :</h1><br> " + str(myval))

    else:

        responseFromIDubba = ""
        responseFromIDubba = urllib2.urlopen("http://www.idubba.com/apps/guide.aspx?key=4e2b0ca2328e03acce0014101d302ac7&type=1&f1=1&f2=0&channel=&gener=&page=0&summary=1").read()
        parseResponseString = simplejson.loads(responseFromIDubba)
    print(parseResponseString)
        body=""

        for data in parseResponseString["data"]:
            #for keys in data:
                #body=body+str(data .items())+".."+str(data[str(keys)])+"<br>"
                body=body+str(data.items())+"<br><br>"
            #body=body+"<br><br>"
        mc.set("epgdata3",body)

        mc.set("jsondata",responseFromIDubba)
        returndata=str(mc.get("jsondata"))
        return HttpResponse("<h1>No Cache Set</h1>" + responseFromIDubba)

Hi, This code is working if I run it in the terminal Python, without any error. But in ECLIPSE IDE it always gives Import Error.
Even if I downloaded and install those modules. Also, and I restarted both Eclipse and my system, but it won't help.

Can you please suggest me a site where I get all libraries at once ?

Burhan Khalid
  • 169,990
  • 18
  • 245
  • 284
WEshruth
  • 769
  • 3
  • 16
  • 32
  • 2
    have you set proper path in eclipse ide ?? http://stackoverflow.com/questions/4324502/most-efficient-way-of-setting-up-a-project-pydev-pythonpath-in-eclipse-helios – avasal Sep 28 '12 at 09:48
  • 1
    Welcome to Stack Overflow! Please try to make your question more clear and don't use random upper- and lower-cases. Also try to post code examples that are only as minimal as possible. This helps us to limit the search and provide a solution. The more work *you* put in when asking, the less work *we* have to do and you will be more likely to receive help. – javex Sep 28 '12 at 09:50

0 Answers0