本文整理匯總了Python中book.Book.strip方法的典型用法代碼示例。如果您正苦於以下問題:Python Book.strip方法的具體用法?Python Book.strip怎麽用?Python Book.strip使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類book.Book
的用法示例。
在下文中一共展示了Book.strip方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。
示例1: delete_book
# 需要導入模塊: from book import Book [as 別名]
# 或者: from book.Book import strip [as 別名]
def delete_book():
to_do = input('''We're going to delete a book. Do you have the barcode? [y/N]: ''')
if to_do.strip() == "" or to_do.strip().lower() == "n":
results = search()
i = 1
for item in results:
print((i + ") " + item)) # not sure how this will come out.
del_me = input("Which one is it? ")
del_me = int(del_me)
del_me = results[del_me - 1]
del_me = del_me.split(",")
del_me = Book(del_me[0]) # this is really fudged atm. serious testing needed
the_db = Bdb(dbLocation)
the_db.delete(del_me)
print("Deleted.")
elif to_do.strip().lower() == "y":
del_me = input("Ok, enter it now: ")
if del_me.strip() == "":
print("Invalid input.")
else:
del_me = int(del_me)
del_me = Book(del_me)
the_db = Bdb(dbLocation)
the_db.delete(del_me)
print("Deleted.")