Using Python to implement an ASP program oriented to image

Source: Internet
Author: User
Tags in python
Usually when we write ASP, we usually use 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 ()
%〉

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.