Support Forums

Full Version: Company Mangement Script 1.2
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Release Notes:

1.1
  • First release
  • Allows you to keep track of your employee's and their salaries
1.2
  • Schedule added
  • You can clear your lists

Code:
import os,platform

def menu():
    clearer()
    print "##################################### "
    print "#   Nevets04's Company Management   # "
    print "##################################### "
    print '                                   '
    print "1) Schedule                       "
    print "2) Salaries                       "
    z = int(raw_input("What do you want to do?: "))
    if z == 1:
        schedule()
    elif z == 2:
        salary()

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:
        menu()

def salary():
    clearer()
    print "1) Add Employee"
    print "2) View Employees"
    print "3) Clear Employees"
    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 == 3:
        os.remove("Employee.txt")
        menu()
    else:
        print "Invalid Option"


def schedule():
    clearer()
    print "1) Add an Event"
    print "2) View Shedule"
    print "3) Clear Schedule"
    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()
        if f == 2:
            menu()
        else:
            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 == 3:
        os.remove("schedule.txt")
        menu()
        
menu()

I'm looking for a new name for this script, please help me think of a good one.
I will no longer be posting the progress of this project due to the fact it may be considered spam, I post the final product
Please still post ideas for names, and what else can I add beside the schedule and salary tracker?
"Clear" doesn't work in Vista, but "cls" does -- so I don't really understand why you did that in your clearer() function.

As for a name, I would call it something like Salary Tracker or something, but it's probably too basic get a real name, really. =P Sorry.
Eh, you sure, I think it is clear in vista.
(11-14-2009, 10:41 PM)nevets04 Wrote: [ -> ]Eh, you sure, I think it is clear in vista.

Yup, I'm sure. I tried it.
It's "clear" in *nix.