"Paras K." <[email protected]> wrote

lotusnotesmaildir = glob.glob('C:\Documents and Settings/pkinariwala/Local
Settings/Application Data/lotus/notes/data/'+'*mail*/')

You don't need the plus.

lotusnotesmaildir = glob.glob('C:\Documents and Settings/pkinariwala/Local
Settings/Application Data/lotus/notes/data/'*mail*/')

That returns: ['C:\\Documents and Settings/pkinariwala/Local
Settings/Application Data/lotus/notes/data\\mail02\\']

Are you sure it isn't

['C:\\Documents and Settings\\pkinariwala\\Local
Settings\\Application Data/lotus\\notes\\data\\mail02\\']

What I am trying to do is split the mail folder, in this case it would be
mail02, but not all users would have that same mail folder.

If so then you can use

var[0].split('\\')[-1]

to get the last item.

You might also find the path manipulation and basename functions
useful for mamnipulating paths. Especially if you need to do it on
multiple different computers/OS. These are in the os/os.path
module family.

HTH,


--
Alan Gauld
Author of the Learn to Program web site
http://www.alan-g.me.uk/

_______________________________________________
Tutor maillist  -  [email protected]
http://mail.python.org/mailman/listinfo/tutor

Reply via email to