[Tutor] Running Command Prompt In Python

Am Ra marastboud at gmail.com
Thu Feb 29 06:26:01 EST 2024


Hi,
I am trying to activate and run command prompt in python but I am stuck in
one section of the code. Below I will explain what I have done so far and
what issue I am dealing with.

Importing os, and using os.system to connect to Command Prompt.
[image: image.png]

Then, dmel922.exe will be activated to generate an empty csv file from a
raw dataset.
[image: image.png]

Up to here it is working as it is supposed to. However, it goes on a pause
and not adding any data to the empty csv file because it is waiting on the
user input which is “Enter y to Continue”.  As we see in the picture below,
the Command Prompt is asking the user to press y to continue. As soon as, I
press y in the Command Prompt it will continue and finish the task.
[image: image.png]

I just cannot figure out how to write a code in python to answer that
“Enter y to Continue” prompt or bypass that so that the system continues
and finishes its task.

Please advise. Thank you very much.



Sincerely,

Mike


More information about the Tutor mailing list