convert dirnames[:] to string ?

28 views
Skip to first unread message

gnn

unread,
May 11, 2017, 4:24:42 PM5/11/17
to Python Programming for Autodesk Maya
Hello world!
I'd like to convert this result:
dirnames[:]
#RESULT:   ['FolderName']
to a string:
#RESULT:   FolderName
to use it in a path...
any idea is welcome :)

Russel Rehmund

unread,
May 11, 2017, 4:35:05 PM5/11/17
to python_in...@googlegroups.com
This is a string within a list...you access by index and you have your string.

Loop:
for x in dirnames[:]:
    print x

or just get this value only:

dirnames[:][0]


--
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_maya+unsub...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/python_inside_maya/6388293c-15de-451e-856d-96e65d69828c%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.



--

gnn

unread,
May 13, 2017, 6:07:42 AM5/13/17
to Python Programming for Autodesk Maya
many many thanks Russel for your response, this is perfect!!
Reply all
Reply to author
Forward
0 new messages