Re: [Tutor] trying to split or rpartition the contents of a list

2013-05-23 Thread Amit Saha
Hi Stuart, On Thu, May 23, 2013 at 10:57 PM, Stuart Tozer wrote: > Hello Amit- your solution works very well. Thanks very much! Good to know that! Hope it was clear. All the best. -Amit > > Best regards, > Stu > > > On Wed, May 22, 2013 at 11:39 AM, Stuart Tozer wrote: >> >> Thanks very much

Re: [Tutor] trying to split or rpartition the contents of a list

2013-05-23 Thread Stuart Tozer
Hello Amit- your solution works very well. Thanks very much! Best regards, Stu On Wed, May 22, 2013 at 11:39 AM, Stuart Tozer wrote: > Thanks very much guys- I'll get back to this when I have a spare moment > and let you know how I get on. > > Cheers, > Stu > > > > On Wed, May 22, 2013 at 11:0

Re: [Tutor] trying to split or rpartition the contents of a list

2013-05-22 Thread Stuart Tozer
Thanks very much guys- I'll get back to this when I have a spare moment and let you know how I get on. Cheers, Stu On Wed, May 22, 2013 at 11:06 AM, Albert-Jan Roskam wrote: > > > > >forobjectinobjects:sorted(set(object.split('_',1)[0]))cmds.menuItem(label > =object,parent ="objectMenu") > >

Re: [Tutor] trying to split or rpartition the contents of a list

2013-05-22 Thread Albert-Jan Roskam
> >forobjectinobjects:sorted(set(object.split('_',1)[0]))cmds.menuItem(label >=object,parent ="objectMenu") "sorted" returns the sorted list but you don't assign anything to it. You can either assign it to a variable, or use the .sort method instead. Also, you don't need to specify the maxspl

Re: [Tutor] trying to split or rpartition the contents of a list

2013-05-22 Thread Amit Saha
Hello, On Wed, May 22, 2013 at 5:49 PM, Stuart Tozer wrote: > Hi everyone. > > I'm stuck on a problem while developing a small tool for Maya. Basically, I > have a folder with some filenames in it which have been returned by > os.listdir(). These filenames look something like... > > > apple_d.jpg

[Tutor] trying to split or rpartition the contents of a list

2013-05-22 Thread Stuart Tozer
Hi everyone. I'm stuck on a problem while developing a small tool for Maya. Basically, I have a folder with some filenames in it which have been returned by os.listdir(). These filenames look something like... apple_d.jpg apple_si.jpg apple_sg.jpg box_d.jpg box_si.jpg pumpkin_d.jpg Right now,