import re
result = None
image = 'awesome.0101.exr'
number = re.search('\.(\d+)\.', image)
if number:
    result = len(number.group(1))
print result

I would use regex to pull that information out.

Brandon L. Harris


On 06/10/2011 10:06 AM, julien hery wrote:
Hello,

It's more a general python question, but image related.
I'm looking at detecting the padding of a filename let's say something like " Filename.001.exr" would return 3
I'm having a hard time to find this answer on the web

Thanks for your help


_______________________________________________
Nuke-python mailing list
[email protected], http://forums.thefoundry.co.uk/
http://support.thefoundry.co.uk/cgi-bin/mailman/listinfo/nuke-python

_______________________________________________
Nuke-python mailing list
[email protected], http://forums.thefoundry.co.uk/
http://support.thefoundry.co.uk/cgi-bin/mailman/listinfo/nuke-python

Reply via email to