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

Donnie Hale dhale at speakeasy.net
Sat Jul 17 07:50:04 MDT 2004


Thanks for the response - sorry about the user error. I have it doing pretty
much what I want at this point.

Donnie


-----Original Message-----
From: twisted-web-bounces at twistedmatrix.com
[mailto:twisted-web-bounces at twistedmatrix.com] On Behalf Of Nicola Larosa
Sent: Saturday, July 17, 2004 2:19 AM
To: twisted-web at twistedmatrix.com
Subject: [Twisted-web] Re: Writing a resource like PythonScript

-----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-----


_______________________________________________
Twisted-web mailing list
Twisted-web at twistedmatrix.com
http://twistedmatrix.com/cgi-bin/mailman/listinfo/twisted-web





More information about the Twisted-web mailing list