Can you post a new version of the code you tried? I have a feeling you are
trying to either update the default case but still passing in a customRepl
solution (a string with a replacement pattern). Or you are changing the
wrong part of the format string.
It should be possible to make the default case be padded to 3 places, if
you don't pass in a string with your own pattern. Another approach would be
to refactor the function to have a second param for the fill size and
default it to 3. Then you would just fill the counter to that padding
before formatting it into the base string.

On Wed, 14 Sep 2016, 6:20 PM likage <[email protected]> wrote:

> Prior to what yann19 has mentioned, having the padding incorporated into
> the function instead of writing it out, whenever I need to call it. I
> thought of changing the second last line of the function from
>
> name = "{0}{1}".format(base, i)
>
> into
>
> name = "{0:<03}".format(i)
>
> But as I tried to use uniqueNamePattern("test_{0}_GRP"), the padding
> revert back to a single digit unless I change {0} to {0:<03}
>
> I apologize in advance that I have not done much testing before I type
> this out
>
> --
> You received this message because you are subscribed to the Google Groups
> "Python Programming for Autodesk Maya" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to [email protected].
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/python_inside_maya/08b2f88c-1aa5-4b9c-948a-428081ae8498%40googlegroups.com
> .
> For more options, visit https://groups.google.com/d/optout.
>

-- 
You received this message because you are subscribed to the Google Groups 
"Python Programming for Autodesk Maya" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/python_inside_maya/CAPGFgA3yRUoEhvv4%2Bu%3Dz2dBHGeiTb%2BUea3o_38auEW87qEK%2BTw%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to