def add(emplyees): name = input('Name: ') ID = input('ID Number: ') department = input('department: ') title = input('Job Title: ') entry = emp.Employee(name, ID, department, title) if name not in employees: employees[name] = entry print('Entry has been added') else: peint('Name already exists')
def main(): print('Hamza Kassem') name1 = 'Susan Meyers' ID1 = '47899' department1 = 'accounting' title1 = 'Vice President' emp1 = emp.Employee(name1, ID1, department1, title1) print(emp1) print() name2 = 'Mark Jones' ID2 = '39119' department2 = 'IT' title2 = 'Programmer' emp2 = emp.Employee(name2, ID2, department2, title2) print(emp2) print() name3 = 'Joy Rogers' ID3 = '81774' department3 = 'Manufacturing' title3 = 'Engineer' emp3 = emp.Employee(name3, ID3, department3, title3) print(emp3)
import emp, pickle f = open("emp.dat", "wb") n = int(input("Enter The number of Employees:")) for i in range(n): eno = int(input("Enter Employee Number:")) ename = input("Enter Employee Name:") esal = float(input("Enter Employee Salary:")) eaddr = input("Enter Employee Address:") e = emp.Employee(eno, ename, esal, eaddr) pickle.dump(e, f) print("Employee Objects pickled successfully")
import emp,pickle num=int(input('Enter number of employee :- ')) f=open("emp.dat","wb") for i in range(num): eid=int(input("enter number if of employee:- ")) ename=input("enter ename if of employee:- ") esal=int(input("enter esal if of employee:- ")) eaddrs=input("enter eaddrs if of employee:- ") obj=emp.Employee(eid,ename,esal,eaddrs) data=pickle.dump(obj,f)
import emp import pickle f = open("emp1.dat", "wb") n = int(input("enter no of employees: ")) for i in range(n): eno = int(input("enter empno: ")) ename = input("enter empno: ") e = emp.Employee(eno, ename) pickle.dump(e, f) print(e) f.close()
# import sys import time sys.path.append('D:/set4/pk1') print() print() import emp ee = emp.Employee(101, 'Micky', 'Hyd', 900000) ee.emp_status() print() ee.emp_code() print() print() sys.path.append('D:/set4/pk2') print() time.sleep(3) import stu as study ss = study.Student(1, 'Micky', 'Delhi', 'how to become billionaire') ss.Stu_status() print() ss.stu_code() ''' ------------------------- # 1st
import pickle import emp f = open("emp.dat", "wb") n = int(input("Enter the number of employee")) for _ in range(n): name = raw_input("Enter the employee name") no = int(raw_input("enter the Employee NUmber")) sal = int(raw_input("Enter the Employee sallerry")) obj = emp.Employee(name, no, sal) pickle.dump(obj, f) print("Pickling is done")
import emp,pickle f=open("emp.dat","wb") n=int(input("enter no of employees")) for i in range(n): no=int(input("enter no")) name=input("enter name") sal=float(input("enter sal")) addr=input("enter addr") e=emp.Employee(no,name,sal,addr) pickle.dump(e,f)