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