# ``twisted`.`web`.`script`.`PythonScript``

class documentation

`class PythonScript(resource.Resource): (source)`

View In Hierarchy

I am an extremely simple dynamic resource; an embedded python script.

This will execute a file (usually of the extension '.epy') as Python code, internal to the webserver.

Method | `__init__` | Initialize me with a script name.
Method | `render` | Render me to a web client.
Class Variable | `isLeaf` | Signal if this IResource implementor is a "leaf node" or not. If True, getChildWithDefault will not be called on this Resource.
Instance Variable | `filename` | Undocumented
Instance Variable | `registry` | Undocumented

Inherited from `Resource`:

Method | `delEntity` | Undocumented
Method | `getChild` | Retrieve a 'child' resource from me.
Method | `getChildForRequest` | Undocumented
Method | `getChildWithDefault` | Retrieve a static or dynamically generated child resource from me.
Method | `getDynamicEntity` | Undocumented
Method | `getStaticEntity` | Undocumented
Method | `listDynamicEntities` | Undocumented
Method | `listDynamicNames` | Undocumented
Method | `listEntities` | Undocumented
Method | `listNames` | Undocumented
Method | `listStaticEntities` | Undocumented
Method | `listStaticNames` | Undocumented
Method | `putChild` | Register a static child.
Method | `reallyPutEntity` | Undocumented
Method | `render_HEAD` | Default handling of HEAD method.
Class Variable | `server` | Undocumented
Instance Variable | `children` | Undocumented

def __init__(self, filename, registry): (source)
overrides `twisted.web.resource.Resource.__init__`
Initialize me with a script name.
def render(self, request): (source)
from `twisted.web.resource.IResource`
overrides `twisted.web.resource.Resource.render`

Render me to a web client.

Load my file, execute it in a special namespace (with 'request' and '__file__' global vars) and finish the request. Output to the web-page will NOT be handled with print - standard output goes to the log - but with request.write.

isLeaf: `bool` = (source)
from `twisted.web.resource.IResource`
overrides `twisted.web.resource.Resource.isLeaf`
Signal if this IResource implementor is a "leaf node" or not. If True, getChildWithDefault will not be called on this Resource.
filename = (source)

Undocumented

registry = (source)

Undocumented