27;t top post, this is usenet, we don't top post, comments go
after the text they comment on soi we can read down the page and it makes
sense.
2. You gave the thread the title of "regex python help".
3. Your initial comment was "I am creating a tool to search a filesystem
for
On 3/25/2015 7:10 PM, Steven D'Aprano wrote:
Does Windows shell have grep? How about Powershell?
No. I just use Idle's grep (Find in Files). And I generally would even
if Command Prompt did have grep. Idle's has the nice feature that
output goes in an Output Window, with each line found p
On 25/03/2015 23:10, Steven D'Aprano wrote:
On Thu, 26 Mar 2015 08:19 am, Gregg Dotoli wrote:
Grep is regular expressions. If I'm using Python, I'll use the Python
modules. Silly
It very well may be silly.
You're using Python regular expressions because you're using Python. Why are
you using
On Thu, 26 Mar 2015 08:19 am, Gregg Dotoli wrote:
> Grep is regular expressions. If I'm using Python, I'll use the Python
> modules. Silly
It very well may be silly.
You're using Python regular expressions because you're using Python. Why are
you using Python? Early in this thread you said
"H
On 25/03/2015 21:19, Gregg Dotoli wrote:
Grep is regular expressions. If I'm using Python, I'll use the Python modules.
Silly
Gregg
Clear as mud, and please don't top post.
--
My fellow Pythonistas, ask not what our language can do for you, ask
what you can do for our language.
Mark Lawrenc
Grep is regular expressions. If I'm using Python, I'll use the Python modules.
Silly
Gregg
On Wednesday, March 25, 2015 at 4:36:01 PM UTC-4, Denis McMahon wrote:
> On Tue, 24 Mar 2015 11:13:41 -0700, gdotoli wrote:
>
> > I am creating a tool to search a filesystem for one simple string.
>
> man
On Tue, 24 Mar 2015 11:13:41 -0700, gdotoli wrote:
> I am creating a tool to search a filesystem for one simple string.
man grep
STOP! REINVENTING! THE! WHEEL!
Your new wheel will invariably be slower and less efficient than the old
one.
--
Denis McMahon, denismfmcma...@gmail.com
--
https:/
No worries Steven,
Thanks to ALL on this thread.
Gregg
On Tuesday, March 24, 2015 at 9:43:58 PM UTC-4, Steven D'Aprano wrote:
> On Wed, 25 Mar 2015 05:13 am, gdot...@gmail.com wrote:
>
> > The error is:
> >
> > SyntaxError: Missing parentheses in call to 'print'
>
>
> I cannot imagine how
On Wed, 25 Mar 2015 05:13 am, gdot...@gmail.com wrote:
> The error is:
>
> SyntaxError: Missing parentheses in call to 'print'
I cannot imagine how the message could be more explicit: the call to print
is missing parentheses. If you're not going to read the error messages you
are given, you are
Here you go. Windows shell was easier!!!
for /f %a in (c:\gonow) do echo %a | c:\Python34\python c:\python34\unopy.py %a
Now I can use any regex pattern, I need.
On Tuesday, March 24, 2015 at 3:54:25 PM UTC-4, Rob Gaddi wrote:
> On Tue, 24 Mar 2015 12:43:38 -0700, Gregg Dotoli wrote:
>
> > [c
On 3/24/2015 2:13 PM, gdot...@gmail.com wrote:
I am creating a tool to search a filesystem for one simple string.
I cannot get the syntax correct.
Thank you in advance for your help.
import sys
import re
import os
path='/'
viewfiles=os.listdir(path)
listdir is not recursive, so this code will
On Tue, 24 Mar 2015 12:43:38 -0700, Gregg Dotoli wrote:
> [context snipped due to top posting]
>
> All I need is a loop, should I bag Python and use a simple shell for
loop?
Honestly, yes. You're not even using a regular expression, just a fixed
string you're trying to search for. You can do
Le 24/03/2015 20:22, Gregg Dotoli a écrit :
Thank you! But
The print error is gone, but now the script quickly finishes and doesnt walk
the OS tree or search.
Gregg
On Tuesday, March 24, 2015 at 2:14:32 PM UTC-4, Gregg Dotoli wrote:
I am creating a tool to search a filesystem for one simple
This works fine , but I have to pipe the filename to the script python stool
I am creating a tool to search a filesystem for one simple string.
> I cannot get the syntax correct.
> Thank you in advance for your help.
>
> import sys
> import re
> import os
> path='/'
> viewfiles=os.listdir(path)
On Tue, 24 Mar 2015 12:10:24 -0700, Gregg Dotoli wrote:
>
> Thank you Gary, that got rid of the error, but now there is no tree
> walk, it runs and immediatley finishes. I just need to grep each file. I
> have this working with the windows "for /r %a and redirecting that to
> Python, but want to u
On Tue, Mar 24, 2015 at 2:22 PM, Gregg Dotoli wrote:
> The print error is gone, but now the script quickly finishes and doesnt
> walk
> the OS tree or search.
>
You need to walk the directory tree recursively. Take a look at os.walk().
Skip
--
https://mail.python.org/mailman/listinfo/python-li
Le 24/03/2015 20:38, Vincent Vande Vyvre a écrit :
Le 24/03/2015 20:22, Gregg Dotoli a écrit :
Thank you! But
The print error is gone, but now the script quickly finishes and
doesnt walk
the OS tree or search.
Gregg
On Tuesday, March 24, 2015 at 2:14:32 PM UTC-4, Gregg Dotoli wrote:
I am
Thank you! But
The print error is gone, but now the script quickly finishes and doesnt walk
the OS tree or search.
Gregg
On Tuesday, March 24, 2015 at 2:14:32 PM UTC-4, Gregg Dotoli wrote:
> I am creating a tool to search a filesystem for one simple string.
> I cannot get the syntax correct.
Thank you Gary, that got rid of the error, but now there is no tree walk, it
runs and immediatley finishes. I just need to grep each file. I have this
working with the windows "for /r %a and redirecting that to Python, but want to
use Python only. I do have dummy files with the regex string.
Th
On 03/24/2015 11:13 AM, gdot...@gmail.com wrote:
I am creating a tool to search a filesystem for one simple string.
I cannot get the syntax correct.
Thank you in advance for your help.
import sys
import re
import os
path='/'
viewfiles=os.listdir(path)
for allfiles in viewfiles:
file= os.pat
On Tue, Mar 24, 2015 at 1:13 PM, wrote:
> SyntaxError: Missing parentheses in call to 'print'
It appears you are attempting to use a Python 2.x print statement with
Python 3.x Try changing the last line to
print(line.rstrip())
Skip
--
https://mail.python.org/mailman/listinfo/python-list
I am creating a tool to search a filesystem for one simple string.
I cannot get the syntax correct.
Thank you in advance for your help.
import sys
import re
import os
path='/'
viewfiles=os.listdir(path)
for allfiles in viewfiles:
file= os.path.join(path, allfiles)
text=open(file, "r")
for line
22 matches
Mail list logo