run a python script with python and catch command line output

Solutions on MaxInterview for run a python script with python and catch command line output 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 - "run a python script with python and catch command line output"
Lou
13 Mar 2018
1import os
2cmd = 'wc -l my_text_file.txt > out_file.txt'
3os.system(cmd)
4
similar questions