The nice thing about using python is that you have better communication between VC and your script. i.e. you can pass values back and forth between the two easily.
The code that Kalle posted is one way to do it, but if you are new to python you will probably find it a bit difficult to understand because it uses threading, a loop, and events.
Here is a simple code that is very similar to your VBS code, except that it is written in python and returns the result "True" or "False" to your command macro so that you can then act accordingly with a logic block in the LCB. (This is the same code that is in the attached file, which you should put in the VoxCommando\PY folder.)
import os
def pingGoogle():
ping = os.popen("ping 8.8.8.8 -n 1 -w 450")
pingResult= ping.read()
#if the result of ping contains 100% it is because there was a 100% loss of packets
#in other words, the ping failed
present = not "100%" in pingResult
return present
result=pingGoogle()
This code can be called from a command macro as follows:
<?xml version="1.0" encoding="utf-16"?>
<command id="719" name="ping google" enabled="true" alwaysOn="False" confirm="False" requiredConfidence="0" loop="False" loopDelay="0" loopMax="0" description="">
<action>
<cmdType>PY.ExecFile</cmdType>
<cmdString>py\pinggoogle.py</cmdString>
<cmdRepeat>1</cmdRepeat>
</action>
<if ifBlockDisabled="False" ifNot="False">
<ifType>(A)==(B)</ifType>
<ifParams>{LastResult}&&True</ifParams>
<then>
<action>
<cmdType>OSD.ShowText</cmdType>
<cmdString>All is well</cmdString>
<cmdRepeat>1</cmdRepeat>
</action>
</then>
<else>
<action>
<cmdType>OSD.ShowText</cmdType>
<cmdString>D'OH!</cmdString>
<cmdRepeat>1</cmdRepeat>
</action>
</else>
</if>
<phrase>ping google</phrase>
</command>
The important line in the python script is the one that calls the function and then stores the result in the variable "result".
This variable once set, will be stored in {LastResult} from the POV of your macro.
Technically the function that we define called "pingGoogle()" should be defined only once, when VC starts up, and then we can use a simple action to call it like this:
<action actiontype="PY.ExecString" repeat="1" logic="False"><paramstring>result=pingGoogle()</paramstring></action>
In other words, we use PY.ExecString to call a single line of code: result=pingGoogle()
If you want to do it this way you should remove the last line from the py file and use the following command to load the script when vc starts up
<?xml version="1.0" encoding="utf-16"?>
<command id="731" name="load pinggoogle script" enabled="true" alwaysOn="False" confirm="False" requiredConfidence="0" loop="False" loopDelay="0" loopMax="0" description="">
<action>
<cmdType>PY.ExecFile</cmdType>
<cmdString>py\pinggoogle.py</cmdString>
<cmdRepeat>1</cmdRepeat>
</action>
<event>VC.Loaded</event>
</command>