From 31d517600c538e6aad0094db57167353bb208b27 Mon Sep 17 00:00:00 2001 From: Alex Chan Date: Tue, 2 Nov 2021 17:33:01 -0700 Subject: [PATCH] Initial python script --- lipsum.py | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) create mode 100644 lipsum.py diff --git a/lipsum.py b/lipsum.py new file mode 100644 index 0000000..a1289f2 --- /dev/null +++ b/lipsum.py @@ -0,0 +1,24 @@ +import sys +from lib.lorem import lorem + +args = sys.argv +type = args[1] +count = int(args[2]) if len(args) >= 3 else 1 + +def lipsum(type): + if type == 'characters': + return '' + + elif type == 'words': + return lorem.get_word(count).capitalize() + + elif type == 'sentences': + return lorem.get_sentence(count) + + elif type == 'paragraphs': + return lorem.get_paragraph(count) + + else: + return lorem.get_sentence(count) + +print(lipsum(type))