Questions tagged [basehttpserver]

This Python class is used to make a simple HTTP web server.

Related links

126 questions
0
votes
1 answer

Converting htaccess setting to BaseHTTPServer setting

So what I'm trying to do is allow users to embed an image on their site, and then that image be automatically replaced by an iframe with their button inside. The reason is to make it easy for users avoiding using js or other code on networks where…
0
votes
1 answer

TypeError: 'datetime.timedelta' object is not iterable-BaseHttpServer issue

I set up a basic python webserver using BaseHttpServer and am practicing querying data from a postgresql database. Everything is going swimmingly, but I have an error when I'm parsing the SQL results. Here is my…
Amanda_Panda
  • 1,156
  • 4
  • 26
  • 68
-1
votes
2 answers

Object is not iterable when replacing word called by function

How do I get otherImages to return the string in it so that I can replace a word within it when called from 'narrow' method? def otherImages(self): self.wfile.write(bytes("
-1
votes
1 answer

How to change a string in a function when calling a function after it passes through list?

Is there way to change the word cat to dog in string() when calling it in main()? For example: def notimportant2("Not using this." def notimportant1("Not worried about this.") def string(): print ("This cat was scared.") def…
Kade Williams
  • 1,041
  • 2
  • 13
  • 28
-1
votes
1 answer

Python's BaseHTTPServer returns junky responses

I use Python's BaseHTTPServer and implement the following very simple BaseHTTPRequestHandler: class WorkerHandler(BaseHTTPRequestHandler): def do_GET(self): self.wfile.write('{"status" : "ready"}') self.send_response(200) When…
SomethingSomething
  • 11,491
  • 17
  • 68
  • 126
-1
votes
1 answer

Python Script doesnt start, something involving a 'subprocess'

import SimpleHTTPServer import SocketServer import os class randomiser(self): def random(): print "hi" class MyRequestHandler(SimpleHTTPServer.SimpleHTTPRequestHandler): def do_GET(self): self.send_response(200) …
1 2 3
8
9