6 lines
154 B
Python
6 lines
154 B
Python
import subprocess
|
|
|
|
result = subprocess.run(['hostname'], capture_output=True, text=True)
|
|
hostname = result.stdout.strip()
|
|
print(f"Hostname: {hostname}")
|
|
|