RE: How to find files with a string ++

2019-01-09 Thread Avi Gross
s forum, if someone asks for what to use to get a job done rapidly and accurately, I might be happy to chime in with what little I know. -Original Message- From: Python-list On Behalf Of Dennis Lee Bieber Sent: Wednesday, January 9, 2019 2:02 PM To: python-list@python.org Subject: Re: Ho

Re: How to find files with a string

2019-01-09 Thread Terry Reedy
On 1/9/2019 11:29 AM, anton.gridus...@gmail.com wrote: I need to find a file, that contains a string TeNum IDLE's 'Find in Files' is a mid-level grep with GUI interface. The code is in idlelib/grep.py if you want to copy code. -- Terry Jan Reedy -- https://mail.python.org/mailman/listinf

RE: How to find files with a string

2019-01-09 Thread Avi Gross
: How to find files with a string Hello everyone! I need to find a file, that contains a string TeNum I try to import os import sys def find_value(fname): value = 0 with open(fname, encoding='cp866') as fn: try: for i in fn: if &#

Re: How to find files with a string

2019-01-09 Thread Brian Oney via Python-list
On Wed, 2019-01-09 at 08:29 -0800, anton.gridus...@gmail.com wrote: > Hello everyone! > > I need to find a file, that contains a string TeNum > > I try to > > import os > import sys > def find_value(fname): > value = 0 > with open(fname, encoding='cp866') as fn: > try: >

Re: How to find files with a string

2019-01-09 Thread Peter Otten
anton.gridus...@gmail.com wrote: > Hello everyone! > > I need to find a file, that contains a string TeNum > > I try to > > import os > import sys > def find_value(fname): > value = 0 > with open(fname, encoding='cp866') as fn: > try: > for i in fn: >

How to find files with a string

2019-01-09 Thread anton . gridushko
Hello everyone! I need to find a file, that contains a string TeNum I try to import os import sys def find_value(fname): value = 0 with open(fname, encoding='cp866') as fn: try: for i in fn: if 'TeNam' in i: print(fname) ex