On Wed, Apr 19, 2017, 11:18 AM MA07 <[email protected]> wrote:

> I just realised It does not make sense.. Thank You,
>
> I just thought the utility of cmds.fileDialog2 () and cd/ os.chdir() are
> kinda same.
>
> sorry,guess I misunderstood the concept. thank you again.
>

Oh I see. Yes os.chdir() expects a string directory path as an argument.
The Maya fileDialog2() will return a list, since multi selection is
possible. You need to handle that and pass just one string from the list.


>
> On Tuesday, April 18, 2017 at 12:11:47 PM UTC+1, MA07 wrote:
>>
>>
>>
>>
>> *Hello,Here is my code.*
>> *input*
>> import maya.cmds as cmds
>>
>> dirPath =cmds.fileDialog2()
>>
>> filePath=str(dirPath)
>>
>> print filePath
>>
>>
>>
>> *output*
>> import maya.cmds as cmds
>>
>> dirPath =cmds.fileDialog2()
>>
>> filePath=str(dirPath)
>>
>> print filePath
>> [u'C:/Users/Documents/pymel.log'] *# *
>>
>> *can someone explain to me is this considered as string or list??? Is it
>> possible to convert it to either way? is it using str().?im not very sure
>> how to convert the path from the dialog2*
>>
>>
>> *I would like to get something like this when the path is printed*
>> *C:/Users/Documents/pymel.log**  rather than this
>>  [u'C:/Users/Documents/pymel.log']*
>>
>> *Thank you*
>>
> --
> 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/55b2c91d-efa1-4439-9d1e-a4bd62c3bf0d%40googlegroups.com
> <https://groups.google.com/d/msgid/python_inside_maya/55b2c91d-efa1-4439-9d1e-a4bd62c3bf0d%40googlegroups.com?utm_medium=email&utm_source=footer>
> .
> 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/CAPGFgA2b-Dues96b%3D7BacrvxbeRAXOcmDoYeXB8ND9g7AGSn6A%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to