wsgiref.handlers.BaseHandler.error_output()

error_output(environ, start_response) This method is a WSGI application to generate an error page for the user. It is only invoked if an error occurs before headers are sent to the client. This method can access the current error information using sys.exc_info(), and should pass that information to start_response when calling it (as described in the “Error Handling” section of PEP 3333). The default implementation just uses the error_status, error_headers, and error_body attributes to genera

wsgiref.handlers.BaseHandler.error_headers

error_headers The HTTP headers used for error responses. This should be a list of WSGI response headers ((name, value) tuples), as described in PEP 3333. The default list just sets the content type to text/plain.

wsgiref.handlers.BaseHandler.error_body

error_body The error response body. This should be an HTTP response body bytestring. It defaults to the plain text, “A server error occurred. Please contact the administrator.”

wsgiref.handlers.BaseHandler.add_cgi_vars()

add_cgi_vars() Insert CGI variables for the current request into the environ attribute.

wsgiref.handlers.BaseHandler

class wsgiref.handlers.BaseHandler This is an abstract base class for running WSGI applications. Each instance will handle a single HTTP request, although in principle you could create a subclass that was reusable for multiple requests. BaseHandler instances have only one method intended for external use: run(app) Run the specified WSGI application, app. All of the other BaseHandler methods are invoked by this method in the process of running the application, and thus exist primarily t

wsgiref.handlers.BaseCGIHandler

class wsgiref.handlers.BaseCGIHandler(stdin, stdout, stderr, environ, multithread=True, multiprocess=False) Similar to CGIHandler, but instead of using the sys and os modules, the CGI environment and I/O streams are specified explicitly. The multithread and multiprocess values are used to set the wsgi.multithread and wsgi.multiprocess flags for any applications run by the handler instance. This class is a subclass of SimpleHandler intended for use with software other than HTTP “origin server

winsound.PlaySound()

winsound.PlaySound(sound, flags) Call the underlying PlaySound() function from the Platform API. The sound parameter may be a filename, audio data as a string, or None. Its interpretation depends on the value of flags, which can be a bitwise ORed combination of the constants described below. If the sound parameter is None, any currently playing waveform sound is stopped. If the system indicates an error, RuntimeError is raised.

winsound.MessageBeep()

winsound.MessageBeep(type=MB_OK) Call the underlying MessageBeep() function from the Platform API. This plays a sound as specified in the registry. The type argument specifies which sound to play; possible values are -1, MB_ICONASTERISK, MB_ICONEXCLAMATION, MB_ICONHAND, MB_ICONQUESTION, and MB_OK, all described below. The value -1 produces a “simple beep”; this is the final fallback if a sound cannot be played otherwise.

winsound.Beep()

winsound.Beep(frequency, duration) Beep the PC’s speaker. The frequency parameter specifies frequency, in hertz, of the sound, and must be in the range 37 through 32,767. The duration parameter specifies the number of milliseconds the sound should last. If the system is not able to beep the speaker, RuntimeError is raised.

winreg.SetValueEx()

winreg.SetValueEx(key, value_name, reserved, type, value) Stores data in the value field of an open registry key. key is an already open key, or one of the predefined HKEY_* constants. value_name is a string that names the subkey with which the value is associated. reserved can be anything – zero is always passed to the API. type is an integer that specifies the type of the data. See Value Types for the available types. value is a string that specifies the new value. This method can also set