I
I
Ilya Kuznetsov2018-09-10 18:53:40
Python
Ilya Kuznetsov, 2018-09-10 18:53:40

Can Python interact with OS (Win, Linux)?

I switched to a new course in my specialty, where they used to teach one programming language - C #, where they did not even touch on the topic of interaction with the OS. Now I really want to master Python, also to do my own projects. The question is, can Python:
a) Interact with the operating system, its policies, logs
b) Monitor incoming or outgoing traffic in any way (or library)
. I will be glad to hear your advice.
PS
I'm going to write a small script (?) that would help me to simplify the policy setting in Windows. I want to put forward this idea on the diploma. Decided to use python for this. Will it be enough?

Answer the question

In order to leave comments, you need to log in

2 answer(s)
A
Alexey Cheremisin, 2018-09-10
@KuzyXD

Depending on what you mean by interaction... There are typical ioctls, then yes, this is implemented partially, by a third-party package, for windows https://github.com/mhammond/pywin32 and almost completely for linux - https://docs.python.org /3/library/fcntl.html
Also in the python itself there are modules for accessing the main system functions - https://docs.python.org/3/library/os.html
Well, you can do everything with third-party (and your own) libraries! For example, for Linux there is a very good API for gstreamer.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question