mirror of
https://github.com/usmannasir/cyberpanel.git
synced 2025-11-07 05:45:59 +01:00
14 lines
382 B
Python
14 lines
382 B
Python
import subprocess
|
|
|
|
# Run the shell command and capture the output
|
|
result = subprocess.run(['ls', '-la'], capture_output=True, text=True)
|
|
|
|
# Get the lines containing 'lsphp' in the output
|
|
lsphp_lines = [line for line in result.stdout.split('\n') if 'lsphp' in line]
|
|
|
|
# Extract the version from the lines
|
|
php_versions = [line.split()[8] for line in lsphp_lines]
|
|
|
|
print(php_versions)
|
|
|