Looking for someone to answer a simple question about Python coding. I have some code with a "while" loop. The loop encompasses fewer instructions than I want. In other words, it loops back too early. I am a hobbiest and am just dabbling in Python to write scripts.
I want to loop on all of the code following the "while." The while loop only gets to the lines before the asterisks comment before it loops back:
Code: Select all
from PSPApp import *
def ScriptProperties():
return {
'Author': u'',
'Copyright': u'',
'Description': u'',
'Host': u'P',
'Host Version': u'24.00'
}
# Begin Loop ++++++++++++++++++++++++++++++++
numtimes = 1
while numtimes < 5:
numtimes += 1
print numtimes
def Do(Environment):
# EnableOptimizedScriptUndo
App.Do( Environment, 'EnableOptimizedScriptUndo', {
'GeneralSettings': {
'ExecutionMode': App.Constants.ExecutionMode.Default,
'AutoActionMode': App.Constants.AutoActionMode.Match,
'Version': ((24,0,0),1)
}
})
# LayerDuplicate
App.Do( Environment, 'LayerDuplicate', {
'GeneralSettings': {
'ExecutionMode': App.Constants.ExecutionMode.Default,
'AutoActionMode': App.Constants.AutoActionMode.Match,
'Version': ((24,0,0),1)
}
})
# Vector Selection Update
App.Do( Environment, 'VectorSelectionUpdate', {
'Path': (0,-1,[],False),
'Type': App.Constants.ObjectSelection.Select,
'GeneralSettings': {
'ExecutionMode': App.Constants.ExecutionMode.Silent,
'AutoActionMode': App.Constants.AutoActionMode.Default,
'Version': ((24,0,0),1)
}
})
