N
N
Nikolay Baranenko2017-03-12 09:10:09
Python
Nikolay Baranenko, 2017-03-12 09:10:09

How to pass several commands to cmd at once in Python?

Hello.
I want to execute several commands from python at once,
for example, chcp and ping 192.168.10.41

import os
cmd = 'список команд'
os.system(cmd)

how to correctly form the list in this example in cmd
to ensure the execution of 2 commands at once?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Andrey Myvrenik, 2017-03-12
@drno-reg

Two commands at the same time:
Two commands in series:
cmd = 'echo hi ; echo hello'

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question