HI,
How do i find files with .so extension using python . 4 3083
On Wed, 02 May 2007 21:58:41 -0700, pradeep nair wrote:
HI,
How do i find files with .so extension using python .
import os
help(os.listdir )
help(os.walk)
help(os.path.sp litext)
That should give you all the tools you need.
--
Steven D'Aprano
do YOU mean hit "reply to all" not "reply?"
On 5/3/07, kaens <ap************ ***@gmail.comwr ote:
do you mean
filelst.append( i)?
On 5/3/07, rishi pathak <ma************ *@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 <de*****@gmail. comwrote:
HI,
>
>
How do i find files with .so extension using python .
>
-- http://mail.python.org/mailman/listinfo/python-list
>
--
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, 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 .
-- http://mail.python.org/mailman/listinfo/python-list
--
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
HAPPY CODING This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics |
by: Berislav Lopac |
last post by:
I know how to set Apache to send files with any extension to PHP before
sending a response. Is there a way to do so for files with no extension
whatsoever? I don't want *all* files to be parsed by PHP, but only those
without extension (and, of course, with some selected extensions).
Berislav
--
If the Internet is a Marx Brothers movie, and Web, e-mail, and IRC are
Groucho, Chico, and Harpo, then Usenet is Zeppo.
|
by: hokiegal99 |
last post by:
The below code does what I need it to do, but I thought that using
something like ext = os.path.splitext(fname) and then searching ext
for '.mp3' would be a much more accurate approach to solving this
problem. Could someone demonstrate how to search ext for a specific
string? This script works great for deleting illegal music on user
machines ;)
Thanks!!!
|
by: J. Shrimp, Jr. |
last post by:
Following code exports tables as text files:
For Each tdf In db.TableDefs
StrTblName = tdf.Name
Me.txtProgName = StrTblName
Me.txtProgName.Requery
tblAtt = tdf.Attributes
moddate = tdf.LastUpdated
If Left(StrTblName, 3) <> "tbl" And tblAtt = 0 Then
strSQL = "INSERT INTO tmpExport ( Code ) SELECT _
|
by: Kenneth Myhra |
last post by:
Hi all, We are trying to make an ISAPI Filter, in .NET by implementing the
IHttpModule interface, that will authorize the request for certain binary
file types (GET), this is working fine. But we also want it to authorize the
upload of binary files (PUT), The problem with the PUT-scenario is that the
file is *not* uploaded when its extension *is* mapped up in IIS, by mapped
up I mean the Application Mappings displayed when clicking on the...
|
by: Milsnips |
last post by:
Can anyone help out on this one?
i would like to find out all the ASPX and ASCX pages that are in my project,
and return them in an arraylist.
thanks,
Paul.
| |
by: Aaron via DotNetMonster.com |
last post by:
I am testing for several file types in a directory by creating an array of masks and for each mask in the array, I execute a GetFiles.
My issue is that the VB code:
myDirectoryInfo.GetFiles("*.asp")
is returning not only .asp files, but .aspx files in the directory as well!!!
A test from the Windows command line found that the command "dir *.asp" also returns .aspx files in the directory as well as .asp. This is obviously an issue...
|
by: kbperry |
last post by:
Hi all,
Background:
I need some help. I am trying to streamline a process for one of our
technical writers. He is using Perforce (version control system), and
is constantly changing his word documents, and then converts them to
both .pdf and "Web page" format (to publish to the web). He has a
licensed copy of Adobe Acrobat Professional (7.x).
Questions:
|
by: graphicsxp |
last post by:
Hi,
How can I open all the files in a directory, which names match a
particular string ?
Say I have a string like 'a file name to find' and I want to find and
open all the files of a given directory, which name contains that
string.
Here is how I open the file of a directory. How can it be modified to
|
by: john6630 |
last post by:
I am trying to get PDO for sqlite to work on my localhost system. I
have modified the PHP5.ini file as shown below and run the following
PHP script. As stated below, it reports the mssql, mysql and sqlite2
drivers but then gives a "could not find driver" exception. Any help
is greatly appreciated. Also, I am concerned if PDO for sqlite is
widely supported by hosting companies, any input or opinions on that?
<?php...
|
by: jinu1996 |
last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth.
The Art of Business Website Design
Your website is...
|
by: Hystou |
last post by:
Overview:
Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
| |
by: tracyyun |
last post by:
Dear forum friends,
With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
|
by: agi2029 |
last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own....
Now, this would greatly impact the work of software developers. The idea...
|
by: conductexam |
last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one.
At the time of converting from word file to html my equations which are in the word document file was convert into image.
Globals.ThisAddIn.Application.ActiveDocument.Select();...
|
by: TSSRALBI |
last post by:
Hello
I'm a network technician in training and I need your help.
I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs.
The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols.
I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
|
by: 6302768590 |
last post by:
Hai team
i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
|
by: muto222 |
last post by:
How can i add a mobile payment intergratation into php mysql website.
| |
by: bsmnconsultancy |
last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...
| |