UPDATE:Thanks to Jitterjames impressive help, here are some examples of sorting numbers with python.
here is a group of commands as examples for others
Replace
1, 3, 4, 2, 5 with
your numbers that you want sorted
Python Numbers Sorting Examples
<?xml version="1.0" encoding="utf-16"?>
<!--VoxCommando 2.2.4.5-->
<commandGroup open="True" name="Python Number sorting Examples" enabled="True" prefix="" priority="0" requiredProcess="" description="">
<command id="916" name="Sorting for Lowest Number" enabled="true" alwaysOn="False" confirm="False" requiredConfidence="0" loop="False" loopDelay="0" loopMax="0" description="">
<action>
<cmdType>PY.ExecString</cmdType>
<params>
<param>numbers = [1, 3, 4, 2, 5] </param>
</params>
<cmdRepeat>1</cmdRepeat>
</action>
<action>
<cmdType>PY.ExecString</cmdType>
<params>
<param>numbers.sort()</param>
</params>
<cmdRepeat>1</cmdRepeat>
</action>
<action>
<cmdType>PY.ExecString</cmdType>
<params>
<param>result=numbers[0]</param>
</params>
<cmdRepeat>1</cmdRepeat>
</action>
<action>
<cmdType>OSD.ShowText</cmdType>
<params>
<param>{LastResult}</param>
</params>
<cmdRepeat>1</cmdRepeat>
</action>
</command>
<command id="918" name="Compressed Sorting for Lowest Number" enabled="true" alwaysOn="False" confirm="False" requiredConfidence="0" loop="False" loopDelay="0" loopMax="0" description="">
<action>
<cmdType>PY.ExecString</cmdType>
<params>
<param>numbers = [1, 3, 4, 2, 5] {CR}numbers.sort(){CR}result=numbers[0]</param>
</params>
<cmdRepeat>1</cmdRepeat>
</action>
<action>
<cmdType>OSD.ShowText</cmdType>
<params>
<param>{LastResult}</param>
</params>
<cmdRepeat>1</cmdRepeat>
</action>
</command>
<command id="917" name="Sorting for Highest number" enabled="true" alwaysOn="False" confirm="False" requiredConfidence="0" loop="False" loopDelay="0" loopMax="0" description="">
<action>
<cmdType>PY.ExecString</cmdType>
<params>
<param>numbers = [1, 3, 4, 2, 5] </param>
</params>
<cmdRepeat>1</cmdRepeat>
</action>
<action>
<cmdType>PY.ExecString</cmdType>
<params>
<param>numbers.sort(reverse = True)</param>
</params>
<cmdRepeat>1</cmdRepeat>
</action>
<action>
<cmdType>PY.ExecString</cmdType>
<params>
<param>result=numbers[0]</param>
</params>
<cmdRepeat>1</cmdRepeat>
</action>
<action>
<cmdType>OSD.ShowText</cmdType>
<params>
<param>{LastResult}</param>
</params>
<cmdRepeat>1</cmdRepeat>
</action>
</command>
<command id="950" name="Compressed Sorting for Highest number" enabled="true" alwaysOn="False" confirm="False" requiredConfidence="0" loop="False" loopDelay="0" loopMax="0" description="">
<action>
<cmdType>PY.ExecString</cmdType>
<params>
<param>numbers = [1, 3, 4, 2, 5] {CR}numbers.sort(reverse = True){CR}result=numbers[0]</param>
</params>
<cmdRepeat>1</cmdRepeat>
</action>
<action>
<cmdType>OSD.ShowText</cmdType>
<params>
<param>{LastResult}</param>
</params>
<cmdRepeat>1</cmdRepeat>
</action>
</command>
</commandGroup>
===================================================================================================
Original Post:I gotta say I thought this would be a simple task
I'm trying to sort a list of integers using python
list:
5, 3, 9, 4, 2, 6, 8, 7, 11, 10, 1
wanting:
1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11
I thought I would be able to do it with python but I haven't had much luck, here's some of what I have tried
<?xml version="1.0" encoding="utf-16"?>
<!--VoxCommando 2.2.4.5-->
<command id="847" name="Python sorting" enabled="true" alwaysOn="False" confirm="False" requiredConfidence="0" loop="False" loopDelay="0" loopMax="0" description="">
<action>
<cmdType>Results.SetLastResult</cmdType>
<params>
<param>5, 3, 9, 4, 2, 6, 8, 7, 11, 10, 1</param>
</params>
<cmdRepeat>1</cmdRepeat>
</action>
<action>
<cmdType>PY.ExecString</cmdType>
<params>
<param>result=sorted={lastResult}</param>
</params>
<cmdRepeat>0</cmdRepeat>
</action>
<action>
<cmdType>PY.ExecString</cmdType>
<params>
<param>result=sorted{lastResult}</param>
</params>
<cmdRepeat>0</cmdRepeat>
</action>
<action>
<cmdType>PY.ExecString</cmdType>
<params>
<param>result=sorted({lastResult})</param>
</params>
<cmdRepeat>0</cmdRepeat>
</action>
<action>
<cmdType>PY.ExecString</cmdType>
<params>
<param>result=sort({lastResult})</param>
</params>
<cmdRepeat>0</cmdRepeat>
</action>
<action>
<cmdType>PY.ExecString</cmdType>
<params>
<param>result=sort{lastResult}</param>
</params>
<cmdRepeat>1</cmdRepeat>
</action>
<action>
<cmdType>OSD.ShowText</cmdType>
<params>
<param>{LastResult}</param>
</params>
<cmdRepeat>1</cmdRepeat>
</action>
</command>
I'm needing to sort the list numerically, so I can get the highest number in the list for naming custom Youtube episodes, any help would be great