Programming Forums
User Name Password Register
 

RSS Feed
FORUM INDEX | TODAY'S POSTS | UNANSWERED THREADS | ADVANCED SEARCH

Reply
 
Thread Tools Display Modes
Old May 18th, 2005, 4:05 PM   #11
Sane
Programming Guru
 
Sane's Avatar
 
Join Date: Apr 2005
Location: Waterloo, Ontario
Posts: 1,886
Rep Power: 5 Sane will become famous soon enough
Send a message via MSN to Sane
def Add_Member(members):
    a = raw_input("Enter Member Name. ")
    b = raw_input("Enter Member Rate. ")
    members.append([len(members)+1,a, b])
    return members

def Print_Members(members):
    for a in range(len(members)):
        print"""
Member: %s
Rate: %s
Name: %s

"""%(members[a][0], members[a][1], members[a][2])
    return members

def Change_Member(members):
    a = raw_input("Which Member? (#) ")
    b = raw_input("Name or Rate? (1/2) ")
    c = raw_input("New Value? ")
    members[int(a)-1][int(b)] = c
    return members

def Main():
    members = []
    choice = ""
    while choice.lower() != "exit":
        c = raw_input("Add Member/View Member(s)/Change Member? (A/V/C) ")
        if c.lower() == "a":
            members = Add_Member(members)
        if c.lower() == "v":
            members = Print_Members(members)
        if c.lower() == "c":
            members = Change_Member(members)
        
Main()

I think that does it. But really, I don't mind making a text translator for you (to save it as a data file). I have time. If you want anything, just ask.

But right now I have to have supper then umpire some baseball. See ya.
Sane is offline   Reply With Quote
Old May 18th, 2005, 5:06 PM   #12
al1986
Newbie
 
Join Date: Feb 2005
Posts: 24
Rep Power: 0 al1986 is on a distinguished road
Text translation often involves the 'translate' method of the string type, as well as the 'maketrans' function from the string library.
al1986 is offline   Reply With Quote
Old May 18th, 2005, 7:21 PM   #13
Sane
Programming Guru
 
Sane's Avatar
 
Join Date: Apr 2005
Location: Waterloo, Ontario
Posts: 1,886
Rep Power: 5 Sane will become famous soon enough
Send a message via MSN to Sane
By translate, I meant translate from a one string data file to the multiple variables needed in the program.
Sane is offline   Reply With Quote
Reply

Bookmarks

« Previous Thread in Forum | Next Thread in Forum »

Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump




DaniWeb IT Discussion Community
All times are GMT -5. The time now is 5:56 AM.

Powered by vBulletin® Version 3.7.0, Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Copyright ©2007 DaniWeb® LLC