From d0b35e8692931818bb21f20a09bde0e0300c1617 Mon Sep 17 00:00:00 2001 From: Thon <thomas.borot@viarezo.fr> Date: Mon, 18 Oct 2021 14:48:57 +0200 Subject: [PATCH] Feature: translation of params --- code/main.py | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/code/main.py b/code/main.py index e0c603c..76fa762 100644 --- a/code/main.py +++ b/code/main.py @@ -1,4 +1,5 @@ import emoji +import sys wordToEmoji = { 'super': ':thumbs_up:', @@ -22,4 +23,13 @@ def convert(word): if __name__ == "__main__": - print("super") + if len(sys.argv) <= 1: + print("Veuillez entrer une phrase en paramètre.") + + else: + convertedText = "" + for sentence in sys.argv[1:]: + words = sentence.split(" ") + for word in words: + convertedText += convert(translate(word)) + " " + print(convertedText) -- GitLab