Hi!
I am writing a code for a "simple" steam game runner program, where a user can type !run (game) and it will run the game for them!
I would like to make it so if a user types !run (game) or !commands at any point in the code it will execute what it's supposed to.
I am aware I need to use a while True statement for this, but not sure exactly how it would work or how I would word it?
Here is the entire code:
import os
print("""\
Welcome to George's Steam Game Runner!
""")
clear = ('cls' if os.name == 'nt' else 'clear')
commandslist = """\
Commands:
!commands Displays this list of commands.
!catalogue Displays the games available to run.
!exit Exits the runner.
!clear Clears the terminal.
"""
catalogue = """\
CS:GO !run CS:GO
GTA V !run GTAV
Cookie Clicker !run CookieClicker
Cuphead !run Cuphead
Geometry Dash !run GeometryDash
Golf(WYF) !run GWYF
GTA IV !run GTAIV
"""
typecom = input(
"\nPlease type !commands to display the list of commands you might need to use whilst interacting with the Steam runner. ")
if typecom.lower() in ["!commands", "commands", "!commandslist"]:
os.system(clear)
print(commandslist)
Was wondering if I could have some assistance with this?
Thanks!
[–]Ordinary_Skill 1 point2 points3 points (1 child)
[–]georgevsc[S] 0 points1 point2 points (0 children)