I am trying to display the python version installed with the following script but cannot.
B4X:
Sub btnGetPythonVersion_Click
' Execute shell command to get the Python version
Dim sb As StringBuilder
sb.Initialize
p.Shell("sh", Array As String("-c", "python3 --version || python --version"), sb, Null)
Dim pythonVersion As String = sb.ToString.Trim
' Display the result
If pythonVersion = "" Then
lblPythonVersion.Text = "Error: Unable to get Python version"
Else
lblPythonVersion.Text = "Python Version: " & pythonVersion
End If
End Sub