On 5/3/07, kaens <apatheticagnos tic@gmail.comwr ote:
do you mean
filelst.append( i)?
>
On 5/3/07, rishi pathak <mailmaverick66 6@gmail.comwrot e:
May be this would work
import os
grep="so"
dir="."
lst = os.listdir(dir)
filelst=[]
for i in lst:
if i.split(".")[len(i.split("." ))-1] == grep:
lst.append(i)
print lst
On 2 May 2007 21:58:41 -0700, pradeep nair <deepns7@gmail. comwrote:
HI,
>
>
How do i find files with .so extension using python .
>
--
--
Regards--
Rishi Pathak
National PARAM Supercomputing Facility
Center for Development of Advanced Computing(C-DAC)
Pune University Campus,Ganesh Khind Road
Pune-Maharastra
--
On May 3, 11:27 am, kaens <apatheticagnos ...@gmail.comwr ote:
do YOU mean hit "reply to all" not "reply?"
>
On 5/3/07, kaens <apatheticagnos ...@gmail.comwr ote:
>
do you mean
filelst.append( i)?
>
On 5/3/07, rishi pathak <mailmaverick.. .@gmail.comwrot e:
May be this would work
import os
grep="so"
dir="."
lst = os.listdir(dir)
filelst=[]
for i in lst:
if i.split(".")[len(i.split("." ))-1] == grep:
lst.append(i)
print lst
>
On 2 May 2007 21:58:41 -0700, pradeep nair <deep...@gmail. comwrote:
HI,
>
How do i find files with .so extension using python .
--
Regards--
Rishi Pathak
National PARAM Supercomputing Facility
Center for Development of Advanced Computing(C-DAC)
Pune University Campus,Ganesh Khind Road
Pune-Maharastra
--
>http://mail.python.org/mailman/listinfo/python-list
On May 3, 9:58 am, pradeep nair <deep...@gmail. comwrote:
HI,
>
How do i find files with .so extension using python .
Hi pradeep
This piece of code should help you
import os,re
def findfile(filepa ttern, base = '.'):
regex = re.compile(file pattern)
matches = []
for root,dirs,files in os.walk(base):
for f in files:
if regex.match(f):
matches.append( root + '/' + f)
return matches
Comment