terminal command python code example

Example 1: execute command in python script

import os

os.system("ma Commande")

#Exemple:

os.system("cd Documents")

Example 2: python how to run terminal command

#By Uku Loskit

import os
os.system("ls -l")

Example 3: how to make a terminal in python

# Honestly
# Doing this in python without
# using some electron library or something would be hell
# Id highly recommend writing a terminal wrapper/CLI for what you want
# Not going out of your way to write a whole new terminal
#
# Wx/Tk can never go wrong tho \s