Re: comparing elements of a list with a string

2007-09-27 Thread Gabriel Genellina
En Thu, 27 Sep 2007 07:44:08 -0300, Shriphani <[EMAIL PROTECTED]> escribi�: > def listAllbackups(filename): > list_of_backups = glob(home+'/Desktop/backupdir/*%s*'%filename) > for element in list_of_back: > if element.find(file) != -1: > date_compo

Re: comparing elements of a list with a string

2007-09-27 Thread Marc 'BlackJack' Rintsch
On Thu, 27 Sep 2007 08:16:59 -0400, Steve Holden wrote: > Shriphani wrote: >> Hello, >> Would that mean that if I wanted to append all the (date, time) tuples >> to a list, I should do something like: >> >> for file in list_of_backup_files: >> some_list.append(file) > > That would be one way

Re: comparing elements of a list with a string

2007-09-27 Thread Steve Holden
Shriphani wrote: > Hello, > Would that mean that if I wanted to append all the (date, time) tuples > to a list, I should do something like: > > for file in list_of_backup_files: > some_list.append(file) That would be one way to do it (assuming you started with some_list as an empty list). Bu

Re: comparing elements of a list with a string

2007-09-27 Thread Shriphani
Hello, Would that mean that if I wanted to append all the (date, time) tuples to a list, I should do something like: for file in list_of_backup_files: some_list.append(file) By the way I did this: def listAllbackups(filename): list_of_backups = glob(home+'/Desktop/backupdir/*%s*'%file

Re: comparing elements of a list with a string

2007-09-25 Thread byte8bits
On Sep 25, 11:39 am, Shriphani <[EMAIL PROTECTED]> wrote: > If I have a string "fstab", and I want to list out the files in whose names > the word fstab appears should I go about like this : > > def listAllbackups(file): > list_of_files = os.listdir("/home/shriphani/backupdir") > for eleme

Re: comparing elements of a list with a string

2007-09-25 Thread Steve Holden
Larry Bates wrote: > Shriphani wrote: >> Hello all, >> I have a problem here. I have a list named list_of_files which >> contains filenames with their timestamps attached to the name. If I >> have a string "fstab", and I want to list out the files in whose names >> the word fstab appears should I g

Re: comparing elements of a list with a string

2007-09-25 Thread Larry Bates
Shriphani wrote: > Hello all, > I have a problem here. I have a list named list_of_files which > contains filenames with their timestamps attached to the name. If I > have a string "fstab", and I want to list out the files in whose names > the word fstab appears should I go about like this : > > d

Re: comparing elements of a list with a string

2007-09-25 Thread Matimus
Shriphani wrote: > Hello all, > I have a problem here. I have a list named list_of_files which > contains filenames with their timestamps attached to the name. If I > have a string "fstab", and I want to list out the files in whose names > the word fstab appears should I go about like this : > > d

Re: comparing elements of a list with a string

2007-09-25 Thread Evan Klitzke
On Tue, 2007-09-25 at 08:39 -0700, Shriphani wrote: > Hello all, > I have a problem here. I have a list named list_of_files which > contains filenames with their timestamps attached to the name. If I > have a string "fstab", and I want to list out the files in whose names > the word fstab appears s