Oh, and probably make wPath a raw string as well:
wPath = r"C:\workFolder\shots\renderFolder"
wPath.split('\\')[:4]
-Ean
On Tue, May 15, 2012 at 9:48 PM, Ean Carr <[email protected]> wrote:
> Hello,
>
> You need to escape your backslash in your split method arg:
>
> wPath = "C:\workFolder\shots\renderFolder"
> wPath.split('\\')[:4]
>
> -Ean
>
> On Tue, May 15, 2012 at 9:39 PM, Noggy <[email protected]
> > wrote:
>
>> **
>> Thanks! Now I get it. Does split only work on a list? I am getting an
>> error trying to use split on a string. There's something about this that
>> isn't clicking for me.
>>
>> wPath = "C:\workFolder\shots\renderFolder"
>> wPath.split('\')[:4]
>>
>> SyntaxError: EOL while scanning string literal
>>
>> _______________________________________________
>> 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