On Sun, Jun 7, 2015 at 8:27 PM, Peter Otten <__pete...@web.de> wrote:
> Just wait for Python 3.5. The switch from os.listdir() to the (new)
> os.scandir() in the implementation of os.walk() is likely to improve the
> situation
Why wait? I've been using 3.5 for ages (and actually, my
/usr/local/bin
On Sun, 7 Jun 2015 07:33 pm, Laura Creighton wrote:
> In a message of Sun, 07 Jun 2015 08:20:46 +0200, Cecil Westerhof writes:
>>> You may get faster results if you use Matthew Barnett's replacement
>>> for re here: https://pypi.python.org/pypi/regex
>>>
>>> You will get faster results if you buil
In a message of Sun, 07 Jun 2015 12:27:05 +0200, Peter Otten writes:
>> There is no gain to get in standard Python? By switching from fnmatch
>> to re I got almost a speed gain of two. So I was wondering if I could
>> do more.
>
>Just wait for Python 3.5. The switch from os.listdir() to the (new)
Cecil Westerhof wrote:
> On Saturday 6 Jun 2015 13:07 CEST, Laura Creighton wrote:
>
>> The !find version is C code optimised to do one thing, find files in
>> your directory structure, which happens to be what you want to do.
>> General regular expression matching is harder.
>>
>> Carl Friedric
In a message of Sun, 07 Jun 2015 08:20:46 +0200, Cecil Westerhof writes:
>> You may get faster results if you use Matthew Barnett's replacement
>> for re here: https://pypi.python.org/pypi/regex
>>
>> You will get faster results if you build your IPython shell to use
>> PyPy, but I would still be v
On 07Jun2015 08:20, Cecil Westerhof wrote:
There is no gain to get in standard Python? By switching from fnmatch
to re I got almost a speed gain of two. So I was wondering if I could
do more.
Maybe write a few versions: one really dumb using filename == matchstring (like
-name foo), one using
On Saturday 6 Jun 2015 13:07 CEST, Laura Creighton wrote:
> The !find version is C code optimised to do one thing, find files in
> your directory structure, which happens to be what you want to do.
> General regular expression matching is harder.
>
> Carl Friedrich Bolz investigated regular expre
In a message of Sat, 06 Jun 2015 15:42:27 -0700, Albert-Jan Roskam via Python-l
ist writes:
>"To run any command at the system shell, simply prefix it with !"
>See: https://ipython.org/ipython-doc/dev/interactive/tutorial.html
Please don't top post.
2. He knows this. He's doing this for fun and
"To run any command at the system shell, simply prefix it with !"
See: https://ipython.org/ipython-doc/dev/interactive/tutorial.html--
https://mail.python.org/mailman/listinfo/python-list
The !find version is C code optimised to do one thing, find files in
your directory structure, which happens to be what you want to do.
General regular expression matching is harder.
Carl Friedrich Bolz investigated regular expression algorithms and their
implementation to see if this is the sort
On Friday 5 Jun 2015 01:04 CEST, Cameron Simpson wrote:
> On 04Jun2015 13:09, Michael Torrie wrote:
>> Why not use Python for what it's good for and say pipe the results
>> of find into your python script? Reinventing find poorly isn't
>> going to buy you anything.
>
> And several others made si
On Friday 5 Jun 2015 09:17 CEST, Cecil Westerhof wrote:
> I was already thinking along those lines. I made it:
> def find(directory, to_match):
> to_match = to_match.lower()
> results = []
> for dirpath, dirnames, filenames in os.walk(expanduser(directory)):
> for filename in filenames:
> if(fnma
Op Thursday 4 Jun 2015 22:13 CEST schreef random:
> On Tue, Jun 2, 2015, at 12:13, Cecil Westerhof wrote:
>> I am thinking about using ipython3 instead of bash. When I want to
>> find a file I can do the following:
>> !find ~ -iname '*python*.pdf'
>> but is there a python way?
>
> Python really is
On Friday, June 5, 2015 at 9:59:22 AM UTC+5:30, Cameron Simpson wrote:
> On 04Jun2015 20:23, Michael Torrie wrote:
> >On 06/04/2015 05:04 PM, Cameron Simpson wrote:
> >> On 04Jun2015 13:09, Michael Torrie wrote:
> >>> Why not use Python for what it's good for and say pipe the results of
> >>> fin
On 04Jun2015 20:23, Michael Torrie wrote:
On 06/04/2015 05:04 PM, Cameron Simpson wrote:
On 04Jun2015 13:09, Michael Torrie wrote:
Why not use Python for what it's good for and say pipe the results of
find into your python script? Reinventing find poorly isn't going to
buy you anything.
An
On 06/04/2015 05:04 PM, Cameron Simpson wrote:
> On 04Jun2015 13:09, Michael Torrie wrote:
>> Why not use Python for what it's good for and say pipe the results of
>> find into your python script? Reinventing find poorly isn't going to
>> buy you anything.
>
> And several others made similar dis
On 04Jun2015 13:09, Michael Torrie wrote:
Why not use Python for what it's good for and say pipe the results of
find into your python script? Reinventing find poorly isn't going to
buy you anything.
And several others made similar disparaging remarks. I think you're all missing
some of the p
On Tue, Jun 2, 2015, at 12:13, Cecil Westerhof wrote:
> I am thinking about using ipython3 instead of bash. When I want to
> find a file I can do the following:
> !find ~ -iname '*python*.pdf'
> but is there a python way?
Python really isn't a good substitute for a shell, but the normal python
On 2015-06-04 13:09, Michael Torrie wrote:
> Why not use Python for what it's good for and say pipe the results
> of find into your python script? Reinventing find poorly isn't
> going to buy you anything.
Until you port your app to Windows where find(1) is unavailable
natively ;-)
-tkc
--
h
On 06/04/2015 09:12 AM, Cecil Westerhof wrote:
>> Can't IPython just call the find and du utilities?
>
> That is what
> !find ~ -iname '*python*.pdf'
> does. But I do not find that aesthetically.
Like I said, I find ipython to be hackish, but invoking find this way is
no more hackish than wri
On 06/02/2015 10:13 AM, Cecil Westerhof wrote:
> I am thinking about using ipython3 instead of bash. When I want to
> find a file I can do the following:
> !find ~ -iname '*python*.pdf'
> but is there a python way?
No more than there is a bash-native way of doing find. Bash scripts use
a myri
Op Thursday 4 Jun 2015 16:27 CEST schreef Grant Edwards:
> On 2015-06-04, Cecil Westerhof wrote:
>> Op Thursday 4 Jun 2015 04:54 CEST schreef Cameron Simpson:
>>
>>> On 02Jun2015 18:13, Cecil Westerhof wrote:
I am thinking about using ipython3 instead of bash. When I want
to find a fil
On 2015-06-04, Cecil Westerhof wrote:
> Op Thursday 4 Jun 2015 04:54 CEST schreef Cameron Simpson:
>
>> On 02Jun2015 18:13, Cecil Westerhof wrote:
>>> I am thinking about using ipython3 instead of bash. When I want to
>>> find a file I can do the following:
>>> !find ~ -iname '*python*.pdf'
>>> b
On 04Jun2015 07:09, Cecil Westerhof wrote:
Op Thursday 4 Jun 2015 04:54 CEST schreef Cameron Simpson:
On 02Jun2015 18:13, Cecil Westerhof wrote:
I am thinking about using ipython3 instead of bash. When I want to
find a file I can do the following:
!find ~ -iname '*python*.pdf'
but is there a
Op Thursday 4 Jun 2015 04:54 CEST schreef Cameron Simpson:
> On 02Jun2015 18:13, Cecil Westerhof wrote:
>> I am thinking about using ipython3 instead of bash. When I want to
>> find a file I can do the following:
>> !find ~ -iname '*python*.pdf'
>> but is there a python way?
>
> That succinct? No
On 02Jun2015 18:13, Cecil Westerhof wrote:
I am thinking about using ipython3 instead of bash. When I want to
find a file I can do the following:
!find ~ -iname '*python*.pdf'
but is there a python way?
That succinct? Not out of the box, but something can easily be built on top of
the os.w
I am thinking about using ipython3 instead of bash. When I want to
find a file I can do the following:
!find ~ -iname '*python*.pdf'
but is there a python way?
--
Cecil Westerhof
Senior Software Engineer
LinkedIn: http://www.linkedin.com/in/cecilwesterhof
--
https://mail.python.org/mailman/l
27 matches
Mail list logo