Quantcast
Channel: MobileRead Forums
Viewing all articles
Browse latest Browse all 50069

Pick a random book?

$
0
0
I'd like to create something that goes through all of my Calibre books, finds those that have the onkobo column checked but doesn't have a date in the finished column, then choose one at random.

Something like:

Code:

import random

unfinished = [book for books if book.onkobo and not book.finished]
book = random.choice(unfinished)
show(book.title, book.author)

How would I do this?

Viewing all articles
Browse latest Browse all 50069

Latest Images

Trending Articles



Latest Images