Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Business Manager Version 1.5 and Other Info About The Project
#1
Version 1.5

This is the latest version of my Business Management Script as of 11/16/09. Over the following weekend I may look into making a GUI for this. If you missed any of the other version (I know I didn't post version 1.3) you can see them all here along with the release notes. Again I urge you report any bugs and suggestions.

Version 1.5:

Code:
#!/usr/bin/env python
import os,platform

def menu():
    clearer()
    print "##################################### "
    print "#   Nevets04's Business Management  # "
    print "##################################### "
    print "1) Schedule                           "
    print "2) Salaries                           "
    print "3) Phonebook                          "
    print "4) Other Notes                        "
    z = int(raw_input("What do you want to do?: "))
    if z == 1:
        schedule()
    elif z == 2:
        salary()
    elif z == 3:
        phone()
    elif z == 4:
        notes()
    else:
        raw_input("Invalid Option, Press Enter To Continue")
        menu()

def clearer():
    systemver=platform.release()
    if systemver=='XP':
        os.system("cls")
    elif systemver=='Vista':
        os.system("clear")
    else:
        os.system("clear")
clearer()

def add(b):
    clearer()
    c = int(raw_input("How much is %s paid an hour?: $" % b))
    clearer()
    d = int(raw_input("How many hours does %s work a day?: " % b))
    clearer()
    d2 = int(raw_input("How many days does %s work a week?: " % b))
    clearer()
    e = (c * d) * d2
    q = "%s: $%s" %(b,e)
    q = "".join(q)
    print q
    print "1) Yes"
    print "2) No"
    f = int(raw_input("Do you want to save this?: "))
    if f == 1:
        x = open('Employee.txt', 'a')    
        x.write(q)
        x.write('\n')
        x.close()
        menu()
    elif f == 2:
        menu()
    else:
        raw_input("Invalid Option, Press Enter To Continue")
        menu()

def salary():
    clearer()
    print "1) Add an Employee"
    print "2) View Employees"
    print "3) Delete an Employee"    
    print "4) Clear Employees"
    print "9) Main Menu"
    a = int(raw_input("What do you want to do?: "))
    if a == 1:
        add(raw_input("Employee Name: "))
    elif a == 2:
        clearer()
        f = open("Employee.txt", 'r')
        for line in f:
            print line,
        raw_input("Press Enter To Continue")
        menu()
    elif a == 4:
        x = open('Employee.txt', 'w')    
        x.write("")
        x.close()
        menu()
    elif a == 3:
        x = open('Employee.txt','r')
        l = []
        q = 0
        y4=0
        for line in x:
            y4 = y4+1
            z4 = ')',' ',line
        print '\n',y4,"".join(z4)
        a = raw_input("Which employee do you want to delete?: ")
        r = int(a)
        q = r - 1
        l[q:r] = ""
        b = "".join(l)
        x.close()
        x = open('Employee.txt','w')
        x.write(b)
        x.close()
        menu()
    if a == 9:
        menu()
    else:
        raw_input("Invalid Option, Press Enter To Continue")
        menu()


def schedule():
    clearer()
    print "1) Add an Event"
    print "2) View Shedule"
    print "3) Delete an Event"    
    print "4) Clear Schedule"
    print "9) Main Menu"
    ask = int(raw_input("What do you want to do: "))
    if ask == 1:
        a = raw_input("When is the event?: ")
        b = raw_input("What is the event?: ")
        q = "%s: %s" %(a,b)
        q = "".join(q)
        print q
        print "1) Yes"
        print "2) No"
        f = int(raw_input("Do you want to save this?: "))
        if f == 1:    
            c = open('Schedule.txt', 'a')
            c.write(q)
            c.write("\n")
            c.close()
            menu()
        elif f == 2:
            menu()
        else:
            raw_input("Invalid Option, Press Enter To Continue")
            menu()
    elif ask == 2:
        clearer()
        f = open("Schedule.txt", 'r')
        for line in f:
            print line,
        raw_input("Press Enter To Continue")
        menu()
    elif ask == 4:
        c = open('Schedule.txt', 'w')
        c.write("")
        c.close()
        menu()
    elif ask == 3:
        x = open('Schedule.txt','r')
        l = []
        q = 0
        y4=0
        for line in x:
            y4 = y4+1
            z4 = ')',' ',line
        print '\n',y4,"".join(z4)
        a = raw_input("Which event do you want to delete?: ")
        r = int(a)
        q = r - 1
        l[q:r] = ""
        b = "".join(l)
        x.close()
        x = open('Schedule.txt','w')
        x.write(b)
        x.close()
        menu()

    elif ask == 9:
        menu()
    else:
        raw_input("Invalid Option, Press Enter To Continue")
        menu()

def phone():
    clearer()
    print "1) Add a Number"
    print "2) View Phonebook"
    print "3) Delete a Number"
    print "4) Clear Phonebook"
    print "9) Back"
    a1 = int(raw_input("What do you want to do: "))
    if a1 == 1:
        a = raw_input("Name: ")
        b = raw_input("Phone Number: ")
        q = "%s: %s" %(a,b)
        q = "".join(q)
        print q
        print "1) Yes"
        print "2) No"
        c = int(raw_input("Do you want to save this this?: "))
        if c == 1:
            d1=open("Phonebook.txt", 'a')
            d1.write(q)
            d1.write("\n")
            d1.close()
            menu()
        elif c == 2:
            menu()
        else:
            raw_input("Invalid Option, Press Enter To Continue")
            menu()
    elif a1 == 2:
        clearer()
        f = open("Phonebook.txt", 'r')
        for line in f:
            print line,
        raw_input("Press Enter To Continue")    
        menu()
    elif a1 == 4:
        x = open("Phonebook.txt", "w")
        x.write("")
        x.close()
        menu()
    elif a1 == 9:
        menu()
    elif a1 == 3:
        x = open('Phonebook.txt','r')
        l = []
        q = 0
        y4=0
        for line in x:
            y4 = y4+1
            z4 = ')',' ',line
        print '\n',y4,"".join(z4)
        a = raw_input("Which Number do you want to delete?: ")
        r = int(a)
        q = r - 1
        l[q:r] = ""
        b = "".join(l)
        x.close()
        x = open('Phonebook.txt','w')
        x.write(b)
        x.close()
        menu()
    else:
        raw_input("Invalid Option, Press Enter To Continue")
        menu()    

    
def notes():
    clearer()
    print "1) Add a Note"
    print "2) View Notes"
    print "3) Delete a Note"
    print "4) Clear Notes"
    print "9) Back"
    a1 = int(raw_input("What do you want to do: "))
    if a1 == 1:
        a = raw_input("What do you want to add to your notes?: ")
        print a
        print "1) Yes"
        print "2) No"
        c = int(raw_input("Do you want to save this this?: "))
        if c == 1:
            d1=open("Notes.txt", 'a')
            d1.write(a)
            d1.write("\n")
            d1.close()
            menu()
        elif c == 2:
            menu()
        else:
            raw_input("Invalid Option, Press Enter To Continue")
            menu()
    elif a1 == 2:
        clearer()
        f = open("Notes.txt", 'r')
        for line in f:
            print line,
        raw_input("Press Enter To Continue")    
        menu()
    elif a1 == 4:
        x = open("Notes.txt", "w")
        x.write("")
        x.close()
        menu()
    elif a1 == 9:
        menu()
    elif a1 == 3:
        x = open('Notes.txt','r')
        l = []
        q = 0
        y4=0
        for line in x:
            y4 = y4+1
            z4 = ')',' ',line
        print '\n',y4,"".join(z4)
        a = raw_input("Which note do you want to delete?: ")
        r = int(a)
        q = r - 1
        l[q:r] = ""
        b = "".join(l)
        x.close()
        x = open('Notes.txt','w')
        x.write(b)
        x.close()
        menu()
    else:
        raw_input("Invalid Option, Press Enter To Continue")
        menu()            
        


menu()
Reply
#2
Maybe some info to what it does would be nice?
At the top will be the same place you hang from.
Reply
#3
Code:
print "1) Schedule                           "
    print "2) Salaries                           "
    print "3) Phonebook                          "
    print "4) Other Notes                        "
That stuff Big Grin
Reply
#4
Programs like that force me to change to python lol(i will NOTleave perl).Nice work nevets04......
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  Busniess Management Script Version 1.4 nevets04 2 1,052 11-15-2009, 06:26 PM
Last Post: nevets04
  Text Encrypt 1.1 Through Version 1.4 nevets04 3 1,001 10-13-2009, 01:49 AM
Last Post: Akshay*

Forum Jump:


Users browsing this thread: 1 Guest(s)