Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Company Mangement Script 1.1
#1
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()
Reply
#2
Even though I have no idea how to code python, you seen to have very well structured code. Nice and neat!
Reply
#3
(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
Reply
#4
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.
Reply
#5
Ecstasy, what do you program in?
Reply
#6
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.
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  Company Mangement Script 1.2 nevets04 4 1,319 11-15-2009, 12:12 PM
Last Post: J4P4NM4N

Forum Jump:


Users browsing this thread: 1 Guest(s)