how to get ipconfig from python

import os 
commend = ipconfig\input(give me a commend)
res = os.popen(commend)
print(res.read)

Here is what the above code is Doing:
1. It’s creating a variable called commend, and setting it equal to the string ipconfig\input(give me a commend).
2. It’s using the os.popen() function to run the commend variable as a command.
3. It’s printing the output of the commend.

You can also use the subprocess module to run commands. The subprocess module is more powerful than the os module, and it’s the recommended way to run commands in Python.

Here’s an example of how to use the subprocess module to run a command:

import subprocess
commend = ipconfig\input(give me a commend)
res = subprocess.check_output(commend, shell=True)
print(res)

The subprocess module has a lot of features. For more information, see the official documentation: https://docs.python.org/3/library/subprocess.html