How do you write this in python

Ali alikakakhel3 at hotmail.com
Sun Oct 3 06:00:30 CEST 2004


I have the following webpage with a javasctript in it:

<html>
<head>
<title>Custom Objects Test</title>
<script language="javascript">
function PrintCard() {
line1 = "<hr>\n";
line2 = "<b>Name: </b>" + this.name + "<br>\n";
line3 = "<b>Email: </b>" + this.email + "<br>\n";
document.write(line1, line2, line3);
}
function Card(name,email) {
	this.name = name;
	this.email = email;
	this.PrintCard = PrintCard;
}
</script>
</head>
<body>
<script language="javascript">
ali = new Card("Ali", "alik at alik.com");
zainab = new Card("Zainab", "zainab at zainab.com");

ali.PrintCard();
zainab.PrintCard();
</script>
</body>
</html>

The script in this page, has a function (Card) that is used to create
an object with its own properties and methods (ali and zainab in this
script). I was wondering if this was possible in python.

If you have questions plz dont hesitate to ask. Please Help. Thank you
:)



More information about the Python-list mailing list