S
S
Sad Dosuna2018-10-19 19:41:51
Python
Sad Dosuna, 2018-10-19 19:41:51

How to execute a console command?

How to write a script that starts the console, enters a command there (for example, logoff), and then executes it. Is it possible to create such a code, and if so, could you give an example of such a program, with a brief explanation of how the script functions work?

Answer the question

In order to leave comments, you need to log in

2 answer(s)
S
Sergey Gornostaev, 2018-10-19
@DemnNoble

import os

os.system('logoff')

S
Stalker_RED, 2018-10-19
@Stalker_RED

https://pypi.org/project/auto-py-to-exe/
www.py2exe.org
Will it drive?

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question