R
R
r1dddy4sv2021-06-07 23:53:05
Python
r1dddy4sv, 2021-06-07 23:53:05

Running commands in sequence in python cmd?

I need to execute several commands sequentially one after another in one cmd terminal, for example:

C:\Users\user>wsl sudo -i dockerd
[sudo] password for user: "password"

That is, first I enter wsl sudo -i dockerdand then the password and the like

. It is also very necessary that after executing a certain command the terminal does not close automatically.

I found information that this can be done with help. subprocess, but I could not find specific information, sorry (

Any help would be grateful
Thanks!

Answer the question

In order to leave comments, you need to log in

1 answer(s)
D
Daniil Shevkunov, 2021-06-07
@danila763

maybe you need to start with
cmd /k
then after the commands the terminal will not close

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question