This commit is contained in:
usmannasir
2023-11-26 14:32:35 +04:00
parent f41f07d8f2
commit 6a4e63bf93
7 changed files with 223 additions and 55 deletions

View File

@@ -0,0 +1,13 @@
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)