Python Forum

Full Version: calling a variable in a for loop in windows
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
I am new to python and I am trying to figure out how to call some windows commands inside a python script, below is the powershell script that works but I can't figure out how to convert this to python with the subprocess command any help would be appreciated.

horcmstart 100 101

$servers = @(“dc2pa90048”,”tocpaIIB-TI”,”lsys7011a-TI”,"powerlink-asys002-TI")
Foreach ($server in $servers) {
	pairdisplay -IM100 -g $server -fcx
    
	start-sleep -s 1 
    "`n"
}
You can use system().
installs pip-review.
system("pip install --user pip-review")

clears screen.
system("clear")

Note: The commands must be strings.