本文整理汇总了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.")