9 Years
Discussion Span
Last Post by Your_mum

Thanx for clearing that up.
Noobish question number 2:
python and the internet-
How can I embed python into HTML code and how do you interface with the internet using python


I was experimenting with python and was trying to create an adressbook style thing. I have a class which creates all of the neccasary attributes, but I also wanted a function which added things to it, but it doesn't work:

class Data:
    def __init__(self, home, mobile, email):
        self.home = home
        self.mobile = mobile
        self.email = email
    def Coll_Data(self):
        self.info = """
Home Phone: %s
Mobile Phone: %s
Email: %s
""" % (self.home, self.mobile, self.email)

def add_new():
    name = raw_input("Enter name to be added: ")
    h = raw_input("Enter home phone: ")
    m = raw_input("Enter Mobile phone: ")
    e = raw_input("Enter Email address: ")
    name = Data(h, m, e)

How can I get this to work????????


Sorry, please do use the other post, how can i delete this post


Firstly, welcome to our Python community.
Secondly, I recommend to create a new thread when you have a different question. Also. please be a bit more specific about the thread title.

This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.