Support Forums
Company Mangement Script 1.1 - Printable Version

+- Support Forums (https://www.supportforums.net)
+-- Forum: Categories (https://www.supportforums.net/forumdisplay.php?fid=87)
+--- Forum: Coding Support Forums (https://www.supportforums.net/forumdisplay.php?fid=18)
+---- Forum: Python Programming Language (https://www.supportforums.net/forumdisplay.php?fid=32)
+---- Thread: Company Mangement Script 1.1 (/showthread.php?tid=2861)



Company Mangement Script 1.1 - nevets04 - 11-13-2009

This is one part of a full out management program I'm working on. This script here is still a beta, please report back any errors including spelling errors.
Note: Even this section is uncomplete

Code:
import os,platform
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()
    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()
        salary()
    elif f == 2:
        salary()
    else:
        salary()

def salary():
    clearer()
    print "1) Add Employee"
    print "2) View 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")
        salary()
    else:
        print "Invalid Option"
salary()



RE: Salary/Employee Manging Script - Extasey - 11-13-2009

Even though I have no idea how to code python, you seen to have very well structured code. Nice and neat!


RE: Salary/Employee Manging Script - nevets04 - 11-13-2009

(11-13-2009, 09:36 PM)Extasey Wrote: Even though I have no idea how to code python, you seen to have very well structured code. Nice and neat!

Thanks. I always hear how messy my coding is, so that means a lot Big Grin


RE: Salary/Employee Manging Script - Extasey - 11-13-2009

I like to keep my code really clean, once I had a software engineer show me how messy his code was and I almost cried (not really, but still). It was just like a big chunk of { and other random characters. Made no sense to me and he said that he wouldn't be able to fix it if something went wrong. He would just have to start again. I think it was VBS.


RE: Salary/Employee Manging Script - nevets04 - 11-13-2009

Ecstasy, what do you program in?


RE: Salary/Employee Manging Script - Extasey - 11-13-2009

VB, bit of PHP.

Not really too concerned with learning much right now. I'm about to apply to join the Australian Defence Force Academy (ADFA) and study IT under them. I'm assuming they will teach me C or something.