A curiosity - Printable Version +- Gimp-Forum.net (https://www.gimp-forum.net) +-- Forum: GIMP (https://www.gimp-forum.net/Forum-GIMP) +--- Forum: Extending the GIMP (https://www.gimp-forum.net/Forum-Extending-the-GIMP) +---- Forum: Scripting questions (https://www.gimp-forum.net/Forum-Scripting-questions) +---- Thread: A curiosity (/Thread-A-curiosity) |
A curiosity - david - 09-12-2020 I have written the attached code which works perfectly (to my amazement!), except for the naming of channels. The screenshot shows the layer names which are identical to the channel names. What I was hoping to have was just the numbers 0 to 9. I have tried: channelName=channelName[-1] and channelName=""+str(channelNum), but the result is always the same. It is of no great importance, although I am curious to know why this is the case. david. Code: for spline in splinePoints: RE: A curiosity - tmanni - 09-12-2020 The problem is simple : you initialize the channelNum variable inside the loop (by doing channelNum=(0)). So, at each iteration of the loop, the channelNum variable is set to (0). Simply move the initialization of the variable before the loop : Code: # integer index of channelName RE: A curiosity - david - 09-12-2020 tmann, Thank you for pointing out my stupid mistake. I think i must be becoming senile! I only noticed the problem at the end of a long session at the keyboard. I should have walked away and come back to it with a fresh pair of eyes. Thanks again, david. |