I looked through some examples. Although I understand that threads are
an issue, I'm still unsure what code I need to make http://localhost:8080/quit
exit the script. Here's what I have so far...
############################################################
import web, os, sys
#load urls and matching classes
urls = (
'/view', 'view',
'/quit', 'quit'
)
class quit:
def POST(self):
#I'm not sure what should go here... and possibly above...
class view:
def POST(self):
i = web.input()
print 'test1: ' + i.test1 + '\n'
print 'test2: ' + i.test2 + '\n'
web.internalerror = web.debugerror
if __name__ == "__main__":
web.run(urls, globals())
#############################################################
What's the recommended workaround? Thanks a lot guys!
Cheers,
Ben
On Aug 25, 10:39 am, Tzury <[EMAIL PROTECTED]> wrote:
> When you call sys.exit() within your POST function you are actually
> trying to invoke it within the thread that runs the server.
> calling sys.exit() from a thread does nothing
> see:http://www.google.com/search?q=sys.exit+thread
>
> Even after the sys.exit() call, the server is still running which is
> the reason you get the HTTP-500 Error (from the server) and not an
> error from your browser style "unable to connect" and alike.
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"web.py" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at http://groups.google.com/group/webpy?hl=en
-~----------~----~----~----~------~----~------~--~---