[Twisted-web] Re: Writing a resource like PythonScript

Nicola Larosa nico at tekNico.net
Sat Jul 17 00:19:17 MDT 2004


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

> from twisted.web.resource import Resource
> 
> class TestScript(resource.Resource):
> ...
> I get the error:
> 
> NameError: name 'resource' is not defined

That won't fly. Either you do:

from twisted.web.resource import Resource
class TestScript(Resource):

or you do:

from twisted.web import resource
class TestScript(resource.Resource):

I prefer the latter.


- -- 
Nicola Larosa - nico at tekNico.net

"When a student asks why case matters, simply ask why it shouldn't matter.
If they think it would be easier to use Python if they can be inconsistent
in their use of case, then they have the answer. Python helps teach that
consistency matters." -- Michael McLay, April 2004


-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.4 (GNU/Linux)

iD8DBQFA+MTnXv0hgDImBm4RAkA3AKC2erojphiRF2IZkD3uDC/HlH2urwCgk0k4
f/SPpAw+ukk/xZGoVrpY/XE=
=rbXc
-----END PGP SIGNATURE-----




More information about the Twisted-web mailing list