Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import pickle
- class ultra:
- def __init__(self,No,Na,K):
- self.AgentNo=No
- self.AgentName=Na
- self.KCode=K
- def Create():
- Gamma=open("TOPSECRET.dat","wb")
- print("enter information about top secret agents")
- print("to exit, enter code") #terminator is "code"
- Num=input("Enter Agent number:")
- while Num!="code":
- Name=input("Enter Agent name:")
- Code=input("Enter agent kill code:")
- x=ultra(Num,Name,Code)
- pickle.dump(x,Gamma)
- Num=input("Enter Agent number:")
- x=ultra("","","")
- Gamma.close()
- Create()
- def Expose():
- Gamma=open("TOPSECRET.dat","rb")
- while True:
- try:
- x=pickle.load(Gamma)
- print(x.AgentName)
- except EOFError:
- break
- Gamma.close()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement