Sololearn: Learn to Code
New course! Every coder should learn Generative AI!
Try a free lesson
+ 1
Create a call to what Steven M said here https://www.sololearn.com/Discuss/1488983/?ref=app "I think understand your question, you would like to be able to open the cmdline, using Python, and have Python send commands to the cmdline? If so, "subprocess" is a preferred library: import subprocess cmd=['echo hello', 'dir'] for each in cmd: process=subprocess.Popen(each,stdout=subprocess.PIPE,shell=True) output=process.communicate()[0] print(output.decode('utf-8')) That should print out cleaner"
12th Sep 2018, 4:36 PM
Alexander Santos
Alexander Santos - avatar