Advertisement
Guest User

Untitled

a guest
Oct 9th, 2016
87
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 22.76 KB | None | 0 0
  1. import pymysql
  2. import random
  3.  
  4. db = pymysql.connect("localhost", "root", "Hero2of1war", "lib")
  5. cursor = db.cursor()
  6.  
  7.  
  8. class Library(object):
  9.     def __init__(self):
  10.         super(Library, self).__init__()
  11.  
  12.         self.number_of_library = ''  # library_number
  13.         self.street = ''
  14.         self.phone_number = 0
  15.         self.books = []
  16.         self.visitors = []
  17.         self.history = []
  18.         self.authors = []
  19.  
  20.     def add_book(self, book):
  21.         # not_found = True
  22.         # for i in self.books:
  23.         #     if i.name == book.name and i.author == book.author:
  24.         #         not_found = False
  25.         #         break
  26.         # if not_found:
  27.         #     self.books.append(book)
  28.         # else:
  29.         #     print('Book exist!')
  30.  
  31.         for i in self.books:
  32.             if i.name == book.name and i.author == book.author:
  33.                 print('Book exist!')
  34.                 break
  35.         else:
  36.             self.books.append(book)
  37.  
  38.     def delete_book(self, name, author):
  39.         book = False
  40.         for i in lib.books:
  41.             if i.name == name and i.author == author:
  42.                 self.books.remove(i)
  43.                 return True
  44.         if book == False:
  45.                 print('This book not exist')
  46.                 return False
  47.  
  48.     def search_book(self, book):
  49.         for i in self.books:
  50.             if i.name == book:
  51.                 return i
  52.  
  53.     def add_visitor(self, visitor):
  54.         not_found = True
  55.         for i in self.visitors:
  56.             if i.name == visitor.name and i.last_name == visitor.last_name and i.number == visitor.number:
  57.                 not_found = False
  58.         if not_found == True:
  59.                 self.visitors.append(visitor)
  60.         else:
  61.             print('Visitor exist!')
  62.             return False
  63.  
  64.     def remove_visitor(self, name, last_name, number):
  65.         remove = False
  66.         for i in lib.visitors:
  67.             if i.name == name and i.last_name == last_name and i.number == number:
  68.                 lib.visitors.remove(i)
  69.                 return True
  70.         if remove == False:
  71.                 print('Can not delete!')
  72.                 return False
  73.  
  74.     def write_book_visitor(self, write, book, data):
  75.         book_in_visitor = BookInVisitor(visitor_name, visitor_last_name, book_name, book_author, data)
  76.         book_in_visitor.visitor_name = write.name
  77.         book_in_visitor.visitor_last_name = write.last_name
  78.         book_in_visitor.book_name = book.name
  79.         book_in_visitor.book_author = book.author
  80.         book_in_visitor.data_of_take = data
  81.  
  82.         self.history.append(book_in_visitor)
  83.  
  84.     def print_history(self):
  85.         for i in self.history:
  86.             print(i.visitor_name + ' take', i.book_name)
  87.  
  88.     def edit_book(self, old_name, new_name):
  89.         for i in lib.books:
  90.             if i.name == old_name:
  91.                 i.name = new_name
  92.  
  93.     def edit_visitors(self, old_name, old_last_name, old_number, new_name, new_last_name, new_number):
  94.         for i in lib.visitors:
  95.             if i.name == old_name and i.last_name == old_last_name and i.number == old_number:
  96.                 i.name = new_name
  97.                 i.last_name = new_last_name
  98.                 i.number = new_number
  99.  
  100.     def user_exist(self, old_name, old_last_name, old_number):
  101.         not_exist = False
  102.         for i in lib.visitors:
  103.             if i.name == old_name and i.last_name == old_last_name and i.number == old_number:
  104.                 return True
  105.         if not_exist == False:
  106.                 print('Not exist')
  107.                 return False
  108.  
  109.     def find_book_by_name(self, name, author):
  110.         for i in lib.books:
  111.             if i.name == name and i.author == author:
  112.                 return i
  113.         # return None
  114.  
  115.     def find_visitor_by_name(self, name, last_name):
  116.         for i in lib.visitors:
  117.             if i.name == name and i.last_name == last_name:
  118.                 return i
  119.         # return None
  120.  
  121.     # add_return_date
  122.     def add_data_of_remove(self, name, last_name, book, author, remove_date):
  123.         for i in lib.history:
  124.             if i.visitor_name == name and i.visitor_last_name == last_name and i.book_name == book and i.book_author == author:
  125.                 i.remove_of_data = remove_date
  126.  
  127.     def initialize_database(self):
  128.         cursor.execute("INSERT INTO gender (id, name) VALUES (NULL, 'male')")
  129.         cursor.execute("INSERT INTO gender (id, name) VALUES (NULL, 'female')")
  130.         db.commit()
  131.         # cursor.execute("SELECT name FROM gender")
  132.         # name_gender = cursor.fetchall()
  133.  
  134.  
  135.  
  136.  
  137. class Book(object):
  138.     def __init__(self,id, name, author, date, count = '', available_count = ''):
  139.         super(Book, self).__init__()
  140.  
  141.         self.id = id
  142.         self.name = name
  143.         self.author = author
  144.         self.date = date
  145.         self.count = count
  146.         self.available_count = available_count
  147.  
  148.     def save(self):
  149.         cursor.execute("INSERT INTO author (id, name, last_name) VALUES (NULL, '{0}', '{1}')".format(author_name, author_last_name))
  150.  
  151. class Visitor(object):
  152.     def __init__(self, id, name, last_name, birth_date, number, gender):
  153.         super(Visitor, self).__init__()
  154.  
  155.         self.id = id
  156.         self.name = name
  157.         self.last_name = last_name
  158.         self.birth_date = birth_date
  159.         self.number = number
  160.         self.gender = gender
  161.  
  162.     def save(self):
  163.         cursor.execute("INSERT INTO visitor (id, name, last_name, birth_date, number, gender_id) VALUES (NULL, '{0}','{1}','{2}','{3}','{4}')".format(first_name, second_name, birth_date, number, gender))
  164.  
  165. class BookInVisitor(object):
  166.     def __init__(self, visitor_name, visitor_last_name, book_name, book_author, data_of_take, remove_of_data=''):
  167.         super(BookInVisitor, self).__init__()
  168.  
  169.         self.visitor_name = visitor_name
  170.         self.visitor_last_name = visitor_last_name
  171.         self.book_name = book_name
  172.         self.book_author = book_author
  173.         self.data_of_take = data_of_take
  174.         self.remove_of_data = remove_of_data
  175.  
  176. class Author(object):
  177.     def __init__(self, id = '', name = '', last_name = ''):
  178.         super(Author, self).__init__()
  179.  
  180.         self.id = id
  181.         self.name = name
  182.         self.last_name = last_name
  183.  
  184.  
  185. # user = 'Mike'
  186. # password = '123456'
  187.  
  188. lib = Library()
  189.  
  190. # user_input = input("Enter user: ")
  191. # password_input = input("Enter password: ")
  192.  
  193. # if user == user_input and password == password_input:
  194.  
  195. cursor.execute("SELECT * FROM gender")
  196. bk = cursor.fetchall()
  197. if len(bk) == 0:
  198.     lib.initialize_database()
  199.  
  200. cursor.execute("SELECT * FROM author")
  201. au = cursor.fetchall()
  202. for author in au:
  203.     author = Author(author[0], author[1], author[2])
  204.     lib.authors.append(author)
  205.  
  206. cursor.execute("SELECT * FROM book")
  207. bk = cursor.fetchall()
  208. for book in bk:
  209.     # cursor.execute("SELECT id from book WHERE name = '{0}'".format(book[1]))
  210.     # b = cursor.fetchall()
  211.     b = book[0]
  212.     # print(b)
  213.     cursor.execute("SELECT author_id from book_has_author WHERE book_id = {}".format(b))
  214.     v = cursor.fetchall()
  215.     v = v[0][0]
  216.     # print(v)
  217.     cursor.execute("SELECT name FROM author WHERE id = {}".format(v))
  218.     na = cursor.fetchall()
  219.     na = na[0][0]
  220.     # print(na)
  221.     # print(book)
  222.     book = Book(book[0], book[1], na, book[2], book[3], book[4])
  223.     lib.books.append(book)
  224.  
  225. cursor.execute("SELECT * FROM visitor")
  226. vs = cursor.fetchall()
  227. for visitor in vs:
  228.     gender_name = visitor[5]
  229.     # print(gender_name)
  230.     cursor.execute("SELECT name FROM gender  WHERE id = {}".format(gender_name))
  231.     gender = cursor.fetchall()
  232.     gender = gender[0][0]
  233.     # print(gender)
  234.     visitor = Visitor(visitor[0], visitor[1], visitor[2], visitor[3], visitor[4], visitor[5])
  235.     lib.visitors.append(visitor)
  236.     # print(visitor)
  237.  
  238. cursor.execute("SELECT * FROM book_in_visitor")
  239. bookinvisitor = cursor.fetchall()
  240. for bkinvs in bookinvisitor:
  241.     """айді списка"""
  242.     idfirst = bkinvs[0]
  243.     # cursor.execute("SELECT taking_date FROM book_in_visitor WHERE id = {}".format(idfirst))
  244.     # takingdate = cursor.fetchall()  # takingDate, TakingDate, taking_date
  245.     # takingdate = takingdate[0][0]
  246.     takingdate = str(bkinvs[1])
  247.     # print(takingdate)
  248.     # cursor.execute("SELECT returning_date FROM book_in_visitor WHERE id = {}".format(idfirst))
  249.     # returningdate = cursor.fetchall()
  250.     # returningdate = returningdate[0][0]
  251.     returningdate = str(bkinvs[2])
  252.     # print(returningdate)
  253.     # cursor.execute("SELECT visitor_id FROM book_in_visitor WHERE id = {}".format(idfirst))
  254.     # """берем число в вісітора_айді"""
  255.     # visid = cursor.fetchall()
  256.     # visid = visid[0][0]
  257.     visid = str(bkinvs[3])
  258.     cursor.execute("SELECT name FROM visitor WHERE id = {}".format(visid))
  259.     """дістаєм імя"""
  260.     visname = cursor.fetchall()
  261.     visname = visname[0][0]
  262.     # print(visname)
  263.     cursor.execute("SELECT last_name FROM visitor WHERE id = {}".format(visid))
  264.     """дістаєм прізвище"""
  265.     vislastname = cursor.fetchall()
  266.     vislastname = vislastname[0][0]
  267.     # print(vislastname)
  268.     # cursor.execute("SELECT book_id FROM book_in_visitor WHERE id = {}".format(idfirst))
  269.     # """берем число бук_айді"""
  270.     # bookid = cursor.fetchall()
  271.     # bookid = bookid[0][0]
  272.     bookid = str(bkinvs[4])
  273.     # print(bookid)
  274.     cursor.execute("SELECT name FROM book WHERE id = {}".format(bookid))
  275.     bookname = cursor.fetchall()
  276.     bookname = bookname[0][0]
  277.     # print(bookname)
  278.     cursor.execute("SELECT author_id FROM book_has_author WHERE book_id = {}".format(bookid))
  279.     authorid = cursor.fetchall()
  280.     authorid = authorid[0][0]
  281.     # print(authorid)
  282.     cursor.execute("SELECT name FROM author WHERE id = {}".format(authorid))
  283.     authorname = cursor.fetchall()
  284.     authorname = authorname[0][0]
  285.     # print(authorname)
  286.     # cursor.execute("SELECT last_name FROM author WHERE id = {}".format(authorid))
  287.     # authorlastname = cursor.fetchall()
  288.     # authorlastname = authorlastname[0][0]
  289.     # print(authorlastname)
  290.     bookvisitor = BookInVisitor(visname, vislastname, bookname, authorname, takingdate, returningdate)
  291.     lib.history.append(bookvisitor)
  292.  
  293.  
  294. # book1 = Book(None, '300 spartans', 'Zak Plahin', '2001')
  295. # lib.add_book(book1)
  296.  
  297. # visitor1 = Visitor(None, 'Oleg', 'See', '12-12-2001', '+380635887884', 'male')
  298. # lib.add_visitor(visitor1)
  299. #
  300. # visitor2 = Visitor(None, 'Chak', 'Broflovski', '09-11-2001', '+38073911112', 'male')
  301. # lib.add_visitor(visitor2)
  302.  
  303.  
  304.  
  305. while True:
  306.     number = int(input('1 - Show all books\n2 - Show all visitors\n3 - Add visitor\n4 - Add book\n5 - Show author\n6 - Change visitor\n7 - Write book on visitor\n8 - Add remove date\n9 - Show history\n10 - Serch book by name\n11 - Search book by author\n12 - Show books in visitor\n:'))
  307.     if number == 1:
  308.         if len(lib.books) == 0:
  309.             print('Our library has not book')
  310.         for i in lib.books:
  311.             print(str(i.id) + ' Book: ' + i.name +', author: ' + i.author + ', date: ' + str(i.date))
  312.     elif number == 2:
  313.         if len(lib.visitors) == 0:
  314.             print('Our library has not visitors')
  315.         for i in lib.visitors:
  316.             cursor.execute("SELECT name FROM gender WHERE id = '{}'".format(i.gender)) # дістав назву статі із бази данних(id)
  317.             gender = cursor.fetchall()
  318.             gender = gender[0][0] # дістав з кортежу стать в правильному вигляді
  319.             print('ID: ' + str(i.id) + ', Name: ' + i.name + ', last name: ' + i.last_name + ', birth date: ' + str(i.birth_date) + ', number: ' + str(i.number) + ', gender: ' + gender)
  320.     elif number == 3:
  321.         first_name = input('Enter name: ')
  322.         first_name = first_name.capitalize()
  323.         second_name = input('Enter last_name: ')
  324.         second_name = second_name.capitalize()
  325.         birth_date = input('Enter birth date(yyyy-mm-dd): ')
  326.         number = int(input('Enter your number(380** *** *** *): '))
  327.         gender = input('Enter: 1-male / 2-female: ')
  328.         if gender == str(1):
  329.             cursor.execute("select name from gender where id = '{}'".format(1))
  330.             sex = cursor.fetchall()
  331.             sex = sex[0][0]
  332.             # print(sex)
  333.         elif gender == str(2):
  334.             cursor.execute("select name from gender where id = '{}'".format(2))
  335.             sex = cursor.fetchall()
  336.             sex = sex[0][0]
  337.             # print(sex)
  338.         else:
  339.             print('Error: gender_id!')
  340.             break
  341.         visit = Visitor(None, first_name, second_name, birth_date, number, gender)
  342.         if lib.add_visitor(visit) == False:
  343.             break
  344.         visit.save()
  345.         cursor.execute("SELECT last_insert_id()")
  346.         vid = cursor.fetchall()
  347.         db.commit()
  348.         # print(vid)
  349.         visit.id = vid[0][0]
  350.         # lib.add_visitor(visit)
  351.     elif number == 4:
  352.         name_book = input('Enter book name: ')
  353.         name_book = name_book.capitalize()
  354.         author_name = input('Enter author name: ')
  355.         author_name = author_name.capitalize()
  356.         author_last_name = input('Enter author last name: ')
  357.         author_last_name = author_last_name.capitalize()
  358.         found = False
  359.         for author in lib.authors:
  360.             if author.name == author_name and author.last_name == author_last_name:
  361.                 found = True
  362.                 aid = author.id
  363.                 db.commit()
  364.         if not found:
  365.             cursor.execute("INSERT INTO author (id, name, last_name) VALUES (NULL, '{0}', '{1}')".format(author_name, author_last_name))
  366.             cursor.execute("Select last_insert_id()")
  367.             aid = cursor.fetchall()
  368.             aid = aid[0][0]
  369.             # print(aid)
  370.             author = Author(aid, author_name, author_last_name)
  371.             lib.authors.append(author)
  372.             db.commit()
  373.         for book in lib.books:
  374.             if book.name == name_book:
  375.                 found = True
  376.                 print('This book exist')
  377.         if not found:
  378.             date = input('Enter date(yyyy-mm-dd): ')
  379.             count = int(input('Enter count:'))
  380.             available_count = count
  381.             # print(available_count)
  382.             # print(count)
  383.             cursor.execute("INSERT INTO book (id, name, date, count, available_count) VALUES (NULL, '{0}', '{1}', {2}, {3})".format(name_book, date, count, available_count))
  384.             cursor.execute("SELECT last_insert_id()")
  385.             bid = cursor.fetchall()
  386.             bid = bid[0][0]
  387.             db.commit()
  388.             cursor.execute("INSERT INTO book_has_author (book_id, author_id) VALUES ({0},{1})".format(bid, aid))
  389.             db.commit()
  390.             bok = Book(bid, name_book, author_name, date, count, available_count)
  391.             lib.add_book(bok)
  392.     elif number == 5:
  393.         if len(lib.authors) == 0:
  394.             print("Author do not exist")
  395.         for i in lib.authors:
  396.             print('ID:', i.id, ',' + 'name author: ' + i.name + ', last name: ' + i.last_name)
  397.     elif number == 6:
  398.         old_name = input('Enter old name of visitor: ')
  399.         old_name = old_name.capitalize()
  400.         old_last_name = input('Enter old last name of visitor: ')
  401.         old_last_name = old_last_name.capitalize()
  402.         old_number = int(input('Enter old number of visitor: '))
  403.         if lib.user_exist(old_name, old_last_name, old_number) == False:
  404.             break
  405.         else:
  406.             new_name = input('Enter new name visitor: ')
  407.             new_name = new_name.capitalize()
  408.             new_last_name = input('Enter new last name visitor: ')
  409.             new_last_name = new_last_name.capitalize()
  410.             new_number = input('Enter new number visitor: ')
  411.             if new_number != int():
  412.                 print('Error int number!')
  413.                 break
  414.             cursor.execute("UPDATE visitor SET name = '{0}', last_name = '{1}', number = '{2}' WHERE number = '{3}'". format(new_name, new_last_name, new_number, old_number))
  415.             db.commit()
  416.             if new_last_name == '':
  417.                 lib.edit_visitors(old_name, old_last_name, old_number, new_name, old_last_name, new_number)
  418.             elif new_name == '':
  419.                 lib.edit_visitors(old_name, old_last_name, old_number, old_name, new_last_name, new_number)
  420.             elif new_number == '':
  421.                 lib.edit_visitors(old_name, old_last_name, old_number, new_name, new_last_name, old_number)
  422.             else:
  423.                 lib.edit_visitors(old_name, old_last_name, old_number, new_name, new_last_name, new_number)
  424.     elif number == 7:
  425.         visitor_name = input('Enter visitor name: ')
  426.         visitor_name = visitor_name.capitalize()
  427.         visitor_last_name = input('Enter visitor last name: ')
  428.         visitor_last_name = visitor_last_name.capitalize()
  429.         vis = lib.find_visitor_by_name(visitor_name, visitor_last_name)
  430.         data_take = input('Enter data take(yyyy-mm-dd): ')
  431.         if vis == None:
  432.             print('Enter again visitor')
  433.             break
  434.         else:
  435.             book_name = input('Enter book name: ')
  436.             book_name = book_name.capitalize()
  437.             book_author = input('Enter author name: ')
  438.             book_author = book_author.capitalize()
  439.             bo = lib.find_book_by_name(book_name, book_author)
  440.             if bo == None:
  441.                 print('Enter again book')
  442.                 break
  443.             else:
  444.                 cursor.execute("SELECT available_count FROM book WHERE name = '{}'".format(book_name))
  445.                 avcoif = cursor.fetchall()
  446.                 avcoif = avcoif[0][0]
  447.                 if avcoif == 0:
  448.                     print("This book is not available!")
  449.                 else:
  450.                     lib.write_book_visitor(vis, bo, data_take)
  451.                     cursor.execute("SELECT id FROM visitor WHERE name = '{0}' AND last_name = '{1}'".format(visitor_name, visitor_last_name))
  452.                     idvisitor = cursor.fetchall()
  453.                     idvisitor = idvisitor[0][0]
  454.                     # print(idvisitor)
  455.                     cursor.execute("SELECT id FROM book WHERE name = '{}'".format(book_name))
  456.                     idbook = cursor.fetchall()
  457.                     idbook = idbook[0][0]
  458.                     # print(idbook)
  459.                     cursor.execute("INSERT INTO book_in_visitor (id, taking_date, returning_date, visitor_id, book_id) VALUES (NULL, '{0}', {1}, {2}, {3})".format(data_take, 'NULL', idvisitor, idbook))
  460.                     cursor.execute("SELECT available_count FROM book WHERE id = {}".format(idbook))
  461.                     avco = cursor.fetchall()
  462.                     # print(avco)
  463.                     avco = avco[0][0]
  464.                     # print(avco)
  465.                     result = int(avco) - 1
  466.                     cursor.execute("UPDATE book SET available_count = '{0}' WHERE id = {1}".format(result, idbook))
  467.                     db.commit()
  468.     elif number == 8:
  469.         name1 = input('Enter visitor name: ')
  470.         name1 = name1.capitalize()
  471.         last_na = input('Enter last_name: ')
  472.         last_na = last_na.capitalize()
  473.         if lib.find_visitor_by_name(name1, last_na) == None:
  474.             print("This visitor not exist")
  475.             break
  476.         else:
  477.             book = input('Enter book: ')
  478.             book = book.capitalize()
  479.             author = input('Enter author: ')
  480.             author = author.capitalize()
  481.             if lib.find_book_by_name(book, author) == None:
  482.                 print("This book not exist")
  483.                 break
  484.             else:
  485.                 data = input('Enter data remove(yyyy-mm-dd): ')
  486.                 cursor.execute("SELECT name FROM book")
  487.                 bookname = [row[0] for row in cursor.fetchall()]
  488.                 # print(bookname)
  489.                 cursor.execute("SELECT id FROM visitor WHERE name = '{0}' AND last_name = '{1}'".format(name1, last_na))
  490.                 mid = cursor.fetchall()
  491.                 mid = mid[0][0]
  492.                 # print(mid)
  493.                 for i in bookname:
  494.                     if i == book:
  495.                         cursor.execute("UPDATE book_in_visitor SET returning_date = '{0}' WHERE visitor_id = {1}".format(data, mid))
  496.                         cursor.execute("SELECT available_count FROM book WHERE name = '{}'".format(book))
  497.                         avbo = cursor.fetchall()
  498.                         avbo = avbo[0][0]
  499.                         result = int(avbo) + 1
  500.                         cursor.execute("UPDATE book SET available_count = '{0}' WHERE name = '{1}'".format(result, book))
  501.                         db.commit()
  502.                         lib.add_data_of_remove(name1, last_na, book, author, data)
  503.     elif number == 9:
  504.         for i in lib.history:
  505.             print(i.visitor_name + ' ' + i.visitor_last_name + ' take: ' + i.book_name + ', author: ' + i.book_author + ', date: ' + str(i.data_of_take) + ', return: ' + str(i.remove_of_data))
  506.     elif number == 10:
  507.         i = input("Enter book name: ")
  508.         i = i.capitalize()
  509.         found = False
  510.         for book in lib.books:
  511.             if book.name == i:
  512.                 print('ID: ' + str(book.id) + ', Book: ' + book.name + ', Author: ' + book.author)
  513.                 found = True
  514.         if not found:
  515.             print("Not found")
  516.     elif number == 11:
  517.         i = input("Enter author name: ")
  518.         i = i.capitalize()
  519.         found = False
  520.         for book in lib.books:
  521.             if book.author == i:
  522.                 print('ID: ' + str(book.id) + ', Book: ' + book.name + ', Author: ' + book.author)
  523.                 found = True
  524.         if not found:
  525.             print("Not found")
  526.     elif number == 12:
  527.         name = input("Enter visitor name: ")
  528.         name = name.capitalize()
  529.         last_name = input("Enter visitor last name: ")
  530.         last_name = last_name.capitalize()
  531.         for i in lib.history:
  532.             if i.visitor_name == name and i.visitor_last_name == last_name and i.remove_of_data == 'None':
  533.                 print('Name: ' + i.visitor_name + ', last name: ' + i.visitor_last_name + ', book: ' + i.book_name + ', author: ' + i.book_author + ', date:' + i.data_of_take)
  534.  
  535. # lib = Library()
  536. #
  537. # book1 = Book()
  538. # book1.name = '300 spartans'
  539. # book1.author = 'Zak Plahin'
  540. #
  541. # book2 = Book()
  542. # book2.name = 'Hello'
  543. # book2.author = 'Jack Frans'
  544. #
  545. # book3 = Book()
  546. # book3.name = 'Madame Bovary'
  547. # book3.author = ''
  548. #
  549. # visitor1 = Visitor()
  550. # visitor1.name = 'Oleg'
  551. # visitor1.last_name = 'See'
  552. #
  553. # visitor2 = Visitor()
  554. # visitor2.name = 'Victor'
  555. # visitor2.last_name = 'Selo'
  556. #
  557. # visitor3 = Visitor()
  558. # visitor3.name = 'Victor'
  559. # visitor3.last_name = 'Selo'
  560. #
  561. # lib.add_visitor(visitor1)
  562. # lib.add_visitor(visitor2)
  563. # lib.add_visitor(visitor3)
  564. # lib.add_book(book2)
  565. #
  566. # lib.write_book_visitor(visitor2, book3)
  567. # lib.write_book_visitor(visitor1, book1)
  568. # lib.print_history()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement