Week 6 ends - Python

This commit is contained in:
2026-06-08 19:54:16 +00:00
parent 59aed7c741
commit b0ed7431e8
1344 changed files with 233907 additions and 0 deletions
+15
View File
@@ -0,0 +1,15 @@
import subprocess
# Save the raw text input first so we don't lose what was typed
user_input = input("Input your Command my master: ")
try:
n = int(user_input)
print("Integer")
except ValueError:
# Safely escape single quotes if the user typed any
safe_input = user_input.replace("'", "'\\''")
# Pass the user's exact text directly into cowsay
command = f"cowsay '{safe_input}' | lolcat -a -d 50"
subprocess.run(command, shell=True)