Programs usually when we write ASP, usually with VBScript or JavaScript.
JavaScript is the use of function to implement the class, very cumbersome, and the effect is unpleasant. VBScript can implement classes, but there are also significant functional limitations.
If you write an ASP script in Python, you can implement the real class and become a true object-oriented image. Consider the following example:
〈% @LANGUAGE = "python" codepage= "936"%〉
〈%
Import Sys
Import Urllib
Class Urtt:
def __init__ (self):
self.text1= ' Testpython '
def urt (self):
Fr=urllib.urlopen (' http://www.163.com ')
for FL in Fr.readlines ():
Response.Write (Server.HTMLEncode (FL))
Fr.close ()
Response.Write (SELF.TEXT1)
Class Urtta (Urtt):
def __init__ (Self,url):
Self.strurl=url
self.text1= ' Textpython '
def urts (self):
Fr=urllib.urlopen (Self.strurl)
for FL in Fr.readlines ():
Response.Write (Server.HTMLEncode (FL))
Fr.close ()
Response.Write (SELF.TEXT1)
Utta=urtt ()
Utta.urt ()
Utt=urtta ("http://sohu.com")
Utt.urts ()
%〉