2 # Display Latin famous phrases in the terminal
11 def main(args=sys.argv[1:]):
12 parser = argparse.ArgumentParser(description="Latin famous phrases in the terminal.")
13 parser.add_argument("-e", "--english", action='store_true', help="Print the English translation.")
14 parser.add_argument("-i", "--id", action='store_true', help="Print the id of the phrase.")
15 parser.add_argument("-l", "--latin", action='store_true', help="Print the Latin phrase (default)")
16 parser.add_argument("-m", "--min", type=int, default=0, help="Set the minimum length of the Latin phrase")
17 parser.add_argument("-M", "--max", type=int, default=10000000, help="Set the maximum length of Latin phrase")
18 parser.add_argument("-n", "--notes", action='store_true', help="Print any notes on phrase")
19 args = parser.parse_args()
23 with open('/usr/share/phrases/phrases.csv') as f:
24 reader = csv.reader(f)
26 if args.max >= int(row[len(row) - 1]) >= args.min:
28 chosen = id[random.randint(0, len(id))]
30 with open('/usr/share/phrases/phrases.csv') as f:
31 reader = csv.reader(f)
42 if not len(sys.argv) > 1:
45 if __name__ == "__main__":