0 Replies - 5746 Views - Last Post: 23 June 2011 - 04:28 PM Rate Topic: -----

#1 StooZorNess  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 25
  • Joined: 17-April 09

Hi, I need help with this simple piece of code...

Posted 23 June 2011 - 04:28 PM

Hi, I need help with this piece of code...
Sorry for the noobish thread title but I have no idea what's going on.
I am trying to make a google app.

I trimmed the code to narrow down the problem.

        q_IP = self.request.get("ip")
        q_agent = self.request.get("agent")
        q_callback = self.request.get("callback")
        if not q_IP and not q_agent :
            reply += "\"IP\": \"" + IP + "\", " + "\"User-Agent\": \"" + agent + "\", "
        else :
            print "else"
        
        reply = reply.rstrip(", ")
        reply += "}"
        print "otherstuff"   
        print reply  



This will work and print out reply fine.
But if I take out the print "otherstuff" statement, nothing will be printed at all.





Edit...

Problem fixed, it was a header problem.
I had to print an empty line before printing my result to end the header.

This post has been edited by StooZorNess: 23 June 2011 - 04:46 PM


Is This A Good Question/Topic? 0
  • +

Page 1 of 1