get python to run cli commands

Solutions on MaxInterview for get python to run cli commands by the best coders in the world

we are a community of more than 2 million smartest coders
registration for
employee referral programs
are now open
get referred to google, amazon, flipkart and more
register now
  
pinned-register now
showing results for - "get python to run cli commands"
Valentín
30 Aug 2016
1import os
2sequence = (
3	"git init",
4  	"git add ."
5)
6
7for i, x in enumerate(sequence):
8  print("{}. RUNNING: [{}]".format(i, x))
9  os.system(x)
10  
11#short explanation
12"""
13	1) Init sequence
14    2) Loop through sequence and use `os.system()` to run commands
15"""