string formating question

16 views
Skip to first unread message

jettam

unread,
Oct 16, 2017, 2:33:52 PM10/16/17
to Python Programming for Autodesk Maya

 I am trying to get the name Step_Grp01 out of all this

steps = {'name':'Step','slide':5,'rotations':10,'spacing':1,'stepDepth':2,'stepHeight':.75}  # first I define this dictionary

Then using string formating I am trying to get the name Step_Grp01

"{0}"+"Grp#".format(steps.get('name'))   

Justin Israel

unread,
Oct 16, 2017, 2:53:44 PM10/16/17
to python_in...@googlegroups.com
Get rid of the +
You are formatting the second of 2 strings which does not have the placeholder 

"{0}_Grp#".format(steps.get('name'))

--
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 python_inside_m...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/python_inside_maya/7c3f9fa0-b9a1-4370-89d6-284c1847e5f3%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Reply all
Reply to author
Forward
0 new messages