Re: Convert namedtuple to dictionary

2013-09-25 Thread Peter Otten
trip...@gmail.com wrote: > Need suggestions. > > Say, I have a namedtuple like this: > > {'a': brucelee(x=123, y=321), 'b': brucelee('x'=123, 'y'=321) > > I need to convert it to: > > {'a': {'x':123, 'y': 321},'b': {'x':123, 'y': 321}} > > Follow-up question -- > > Which would be easier to w

Re: Newline interpretation issue with MIMEApplication with binary data, Python 3.3.2

2013-09-25 Thread Chris Angelico
On Thu, Sep 26, 2013 at 2:23 PM, Nils Bunger wrote: > Yes, it's email.mime.MIMEApplication. I've pasted a snippet with the imports > below. > > I'm trying to use this to build a multi-part MIME message, with this as one > part. > > I really can't figure out any way to attach a binary part like t

Re: Newline interpretation issue with MIMEApplication with binary data, Python 3.3.2

2013-09-25 Thread Nils Bunger
Chris, Thanks for answering. Yes, it's email.mime.MIMEApplication. I've pasted a snippet with the imports below. I'm trying to use this to build a multi-part MIME message, with this as one part. I really can't figure out any way to attach a binary part like this to a multi-part MIME messa

Re: Newline interpretation issue with MIMEApplication with binary data, Python 3.3.2

2013-09-25 Thread Chris Angelico
On Thu, Sep 26, 2013 at 2:38 AM, wrote: > app = MIMEApplication(b'Q\x0dQ', _encoder=encode_noop) What is MIMEApplication? It's not a builtin, so your test case is missing an import, at least. Is this email.mime.MIMEApplication? ChrisA -- https://mail.python.org/mailman/listinfo/python-list

Re: Understanding how is a function evaluated using recursion

2013-09-25 Thread rusi
On Thursday, September 26, 2013 4:54:22 AM UTC+5:30, Arturo B wrote: > So I know what recursion is, but I don't know how is > >flatten(i) > > evaluated, what value does it returns? When you are a noob, who do you ask? The gurus. When you are a guru who do you ask? The co

Re: Nosetests

2013-09-25 Thread Roy Smith
In article <32f7bdcb-97e5-4a1c-a2c8-ab91e4052...@googlegroups.com>, melw...@gmail.com wrote: > Not sure How to proceed on with writing a few more tests with if statement to > test if the value is low or high. I was told to try a command line switch > like optparse to pass the number but not sur

Re: Convert namedtuple to dictionary

2013-09-25 Thread Steven D'Aprano
On Wed, 25 Sep 2013 15:45:49 -0700, tripsvt wrote: > Need suggestions. > > Say, I have a namedtuple like this: > > {'a': brucelee(x=123, y=321), 'b': brucelee('x'=123, 'y'=321) That's not a namedtuple, that's a dict containing two namedtuples. > I need to convert it to: > > {'a': {'x':123,

Re: Referrer key missing form os.environ dictionary?

2013-09-25 Thread Chris Angelico
On Thu, Sep 26, 2013 at 11:32 AM, Terry Reedy wrote: > Since CGI uses stdout for the finished product, it could have used stdin for > the input. Haven't used CGI in years, but I thought POST data came on stdin? ChrisA -- https://mail.python.org/mailman/listinfo/python-list

Nosetests

2013-09-25 Thread melwin9
Hello, I am trying to write a few tests for a random input number game but not too sure how to proceed on. I am following the Python Game from http://inventwithpython.com/chapter4.html Started the tests with a file test_guess.py from unittest import TestCase import pexpect as pe import guess

Re: Convert namedtuple to dictionary

2013-09-25 Thread Terry Reedy
On 9/25/2013 9:15 PM, MRAB wrote: On 26/09/2013 02:08, Steven D'Aprano wrote: On Wed, 25 Sep 2013 18:41:25 -0500, Tim Chase wrote about namedtuple: While it uses the "private" member-variable "_fields", you can do It's not actually private! namedtuple is documented as an exception to the ru

Re: Referrer key missing form os.environ dictionary?

2013-09-25 Thread Terry Reedy
On 9/25/2013 8:11 PM, Steven D'Aprano wrote: On Wed, 25 Sep 2013 15:18:41 +, Grant Edwards wrote: The Referer is not an environment variable. It is when you're writing a CGI app. How would your shell know what URL you were just browsing? Because the HTTP server sets those environment

Re: Convert namedtuple to dictionary

2013-09-25 Thread MRAB
On 26/09/2013 02:08, Steven D'Aprano wrote: On Wed, 25 Sep 2013 18:41:25 -0500, Tim Chase wrote about namedtuple: While it uses the "private" member-variable "_fields", you can do It's not actually private! namedtuple is documented as an exception to the rule that methods starting with a sin

Re: Understanding how is a function evaluated using recursion

2013-09-25 Thread Terry Reedy
On 9/25/2013 7:24 PM, Arturo B wrote: Hi, I'm doing Python exercises and I need to write a function to flat nested lists as this one: [[1,2,3],4,5,[6,[7,8]]] To the result: [1,2,3,4,5,6,7,8] So I searched for example code and I found this one that uses recursion (that I don't understand):

Re: Convert namedtuple to dictionary

2013-09-25 Thread Steven D'Aprano
On Wed, 25 Sep 2013 18:41:25 -0500, Tim Chase wrote about namedtuple: > While it uses the "private" member-variable "_fields", you can do It's not actually private! namedtuple is documented as an exception to the rule that methods starting with a single leading underscore are private. Named tup

Re: Understanding how is a function evaluated using recursion

2013-09-25 Thread Dave Angel
On 25/9/2013 19:24, Arturo B wrote: > Hi, I'm doing Python exercises and I need to write a function to flat nested > lists > as this one: > > [[1,2,3],4,5,[6,[7,8]]] > > To the result: > > [1,2,3,4,5,6,7,8] > > So I searched for example code and I found this one that uses recursion (that > I do

Re: Convert namedtuple to dictionary

2013-09-25 Thread Ned Batchelder
On 9/25/13 6:45 PM, trip...@gmail.com wrote: Need suggestions. Say, I have a namedtuple like this: {'a': brucelee(x=123, y=321), 'b': brucelee('x'=123, 'y'=321) I need to convert it to: {'a': {'x':123, 'y': 321},'b': {'x':123, 'y': 321}} Namedtuples have a ._asdict() method. You can convert

Re: Referrer key missing form os.environ dictionary?

2013-09-25 Thread Steven D'Aprano
On Wed, 25 Sep 2013 15:18:41 +, Grant Edwards wrote: >> The Referer is not an environment variable. > > It is when you're writing a CGI app. > >> How would your shell know what URL you were just browsing? > > Because the HTTP server sets those environment variables before invoking > the CGI

Re: Understanding how is a function evaluated using recursion

2013-09-25 Thread Steven D'Aprano
On Wed, 25 Sep 2013 16:24:22 -0700, Arturo B wrote: > Hi, I'm doing Python exercises and I need to write a function to flat > nested lists as this one: > > [[1,2,3],4,5,[6,[7,8]]] > > To the result: > > [1,2,3,4,5,6,7,8] > > So I searched for example code and I found this one that uses recursi

Re: Understanding how is a function evaluated using recursion

2013-09-25 Thread MRAB
On 26/09/2013 00:24, Arturo B wrote: Hi, I'm doing Python exercises and I need to write a function to flat nested lists as this one: [[1,2,3],4,5,[6,[7,8]]] To the result: [1,2,3,4,5,6,7,8] So I searched for example code and I found this one that uses recursion (that I don't understand): d

Re: Understanding how is a function evaluated using recursion

2013-09-25 Thread Josh English
On Wednesday, September 25, 2013 4:24:22 PM UTC-7, Arturo B wrote: > Hi, I'm doing Python exercises and I need to write a function to flat nested > lists > So I know what recursion is, but I don't know how is > >flatten(i) > > evaluated, what value does it returns? >

Re: Convert namedtuple to dictionary

2013-09-25 Thread MRAB
On 25/09/2013 23:45, trip...@gmail.com wrote: Need suggestions. Say, I have a namedtuple like this: {'a': brucelee(x=123, y=321), 'b': brucelee('x'=123, 'y'=321) I assume you mean: {'a': brucelee(x=123, y=321), 'b': brucelee(x=123, y=321)} I need to convert it to: {'a': {'x':123, 'y': 32

Re: Convert namedtuple to dictionary

2013-09-25 Thread Tim Chase
On 2013-09-25 15:45, trip...@gmail.com wrote: > Say, I have a namedtuple like this: > > {'a': brucelee(x=123, y=321), 'b': brucelee('x'=123, 'y'=321) > > I need to convert it to: > > {'a': {'x':123, 'y': 321},'b': {'x':123, 'y': 321}} While it uses the "private" member-variable "_fields", you c

Understanding how is a function evaluated using recursion

2013-09-25 Thread Arturo B
Hi, I'm doing Python exercises and I need to write a function to flat nested lists as this one: [[1,2,3],4,5,[6,[7,8]]] To the result: [1,2,3,4,5,6,7,8] So I searched for example code and I found this one that uses recursion (that I don't understand): def flatten(l): ret = [] for i

Convert namedtuple to dictionary

2013-09-25 Thread tripsvt
Need suggestions. Say, I have a namedtuple like this: {'a': brucelee(x=123, y=321), 'b': brucelee('x'=123, 'y'=321) I need to convert it to: {'a': {'x':123, 'y': 321},'b': {'x':123, 'y': 321}} Follow-up question -- Which would be easier to work with if I had to later extract/manipulate the

Re: Extracting lines from text files - script with a couple of 'side effects'

2013-09-25 Thread MRAB
On 25/09/2013 21:06, mstagliamonte wrote: Dear All, Here I am, with another newbie question. I am trying to extract some lines from a fasta (text) file which match the headers in another file. i.e: Fasta file: header1|info1:info2_info3 general text header2|info1:info2_info3 general text he

Re: Referrer key missing form os.environ dictionary?

2013-09-25 Thread Denis McMahon
On Wed, 25 Sep 2013 18:16:39 +0300, Νίκος wrote: > how caom the http_referer thing works ok now but when i just print all > the key listing of .os.environ ket the http_referer key isnt inside? That you do not understand this is caused by your failure to understand the HTTP protocol. You have bee

Re: Extracting lines from text files - script with a couple of 'side effects'

2013-09-25 Thread Dave Angel
On 25/9/2013 16:06, mstagliamonte wrote: > Dear All, > > Here I am, with another newbie question. I am trying to extract some lines > from a fasta (text) file which match the headers in another file. i.e: > Fasta file: >>header1|info1:info2_info3 > general text >>header2|info1:info2_info3 > gener

Extracting lines from text files - script with a couple of 'side effects'

2013-09-25 Thread mstagliamonte
Dear All, Here I am, with another newbie question. I am trying to extract some lines from a fasta (text) file which match the headers in another file. i.e: Fasta file: >header1|info1:info2_info3 general text >header2|info1:info2_info3 general text headers file: header1|info1:info2_info3 header2|

Re: Referrer key missing form os.environ dictionary?

2013-09-25 Thread Piet van Oostrum
Νίκος writes: > Στις 25/9/2013 5:01 μμ, ο/η Chris “Kwpolska” Warrick έγραψε: >> On Wed, Sep 25, 2013 at 2:45 PM, Νίκος wrote: >>> Hello, i decided am ong other os.environ variables to also grab the >>> 'HTTP_REFERER' fiel but when i try to run my script i was seeing a KeyError >>> complaining th

Re: Referrer key missing form os.environ dictionary?

2013-09-25 Thread Grant Edwards
On 2013-09-25, ?? wrote: > 25/9/2013 6:18 , ??/?? Grant Edwards : >>> The Referer is not an environment variable. >> >> It is when you're writing a CGI app. >> >>> How would your shell know what URL you were just browsing? >> >> Because the HTTP server sets those

Newline interpretation issue with MIMEApplication with binary data, Python 3.3.2

2013-09-25 Thread nilsbunger
Hi, I'm having trouble encoding a MIME message with a binary file. Newline characters are being interpreted even though the content is supposed to be binary. This is using Python 3.3.2 Small test case: app = MIMEApplication(b'Q\x0dQ', _encoder=encode_noop) b = io.BytesIO() g = BytesGenerator

Re: Referrer key missing form os.environ dictionary?

2013-09-25 Thread John Gordon
In =?UTF-8?B?zp3Or866zr/Pgg==?= writes: > So you mean that even if i run it via shell this stement will also work > because it happens to be in the same enviroment with the HTTP server? No. Each process has its own environment. Your shell's environment knows nothing about the web server's

Re: Referrer key missing form os.environ dictionary?

2013-09-25 Thread Νίκος
Στις 25/9/2013 6:18 μμ, ο/η Grant Edwards έγραψε: On 2013-09-25, Steven D'Aprano wrote: On Wed, 25 Sep 2013 17:04:55 +0300, ?? wrote: I would like to check for its existence and retrieve it if possible, if its not there then default to the string "UnKnown Ref". I try to do this with:

Re: Referrer key missing form os.environ dictionary?

2013-09-25 Thread Tim Chase
On 2013-09-25 18:16, Νίκος wrote: > how caom the http_referer thing works ok now but when i just print > all the key listing of .os.environ ket the http_referer key isnt > inside? Well, first off, it's entirely possible (based on reading that paragraph) that you typed something wrong. That said,

Re: Referrer key missing form os.environ dictionary?

2013-09-25 Thread Νίκος
Στις 25/9/2013 6:14 μμ, ο/η Tim Chase έγραψε: On 2013-09-25 18:02, Νίκος wrote: This indeed works now: ref = os.environ.get('HTTP_REFERER', 'Άγνωστο Ref') but iam wondering why this doesnt work also: ref = os.environ('HTTP_REFERER') Shouldnt both work? No...that calls os.environ. You like

Re: Referrer key missing form os.environ dictionary?

2013-09-25 Thread Grant Edwards
On 2013-09-25, Steven D'Aprano wrote: > On Wed, 25 Sep 2013 17:04:55 +0300, ?? wrote: > >> I would like to check for its existence and retrieve it if possible, if >> its not there then default to the string "UnKnown Ref". >> >> I try to do this with: >> >> referer = os.environ.get('HTTP_

Re: Referrer key missing form os.environ dictionary?

2013-09-25 Thread Νίκος
Στις 25/9/2013 6:04 μμ, ο/η Steven D'Aprano έγραψε: On Wed, 25 Sep 2013 14:26:23 +, John Gordon wrote: You could try this: try: referer = os.environ.get('HTTP_REFERER', 'UnknownRef') except KeyError: referer = None if not referer: referer = 'Unknow

Re: Referrer key missing form os.environ dictionary?

2013-09-25 Thread Tim Chase
On 2013-09-25 18:02, Νίκος wrote: > This indeed works now: > > ref = os.environ.get('HTTP_REFERER', 'Άγνωστο Ref') > > but iam wondering why this doesnt work also: > > ref = os.environ('HTTP_REFERER') > > Shouldnt both work? No...that calls os.environ. You likely *mean* ref = os.environ['H

Re: Referrer key missing form os.environ dictionary?

2013-09-25 Thread Xaxa Urtiz
Le mercredi 25 septembre 2013 17:02:45 UTC+2, Ferrous Cranus a écrit : > Στις 25/9/2013 5:52 μμ, ο/η Steven D'Aprano έγραψε: > > > On Wed, 25 Sep 2013 17:04:55 +0300, Νίκος wrote: > > > > > >> I would like to check for its existence and retrieve it if possible, if > > >> its not there then defa

Re: Referrer key missing form os.environ dictionary?

2013-09-25 Thread Ned Batchelder
On 9/25/13 10:26 AM, John Gordon wrote: You could try this: try: referer = os.environ.get('HTTP_REFERER', 'UnknownRef') except KeyError: referer = None if not referer: referer = 'UnknownRef' There's no need for the "except KeyError" clause. dict.get ne

Re: Referrer key missing form os.environ dictionary?

2013-09-25 Thread Steven D'Aprano
On Wed, 25 Sep 2013 14:26:23 +, John Gordon wrote: > You could try this: > > try: > referer = os.environ.get('HTTP_REFERER', 'UnknownRef') > except KeyError: > referer = None > if not referer: > referer = 'UnknownRef' The get method will not raise KeyError

Re: Referrer key missing form os.environ dictionary?

2013-09-25 Thread Νίκος
Στις 25/9/2013 5:52 μμ, ο/η Steven D'Aprano έγραψε: On Wed, 25 Sep 2013 17:04:55 +0300, Νίκος wrote: I would like to check for its existence and retrieve it if possible, if its not there then default to the string "UnKnown Ref". I try to do this with: referer = os.environ.get('HTTP_REFERER',

Re: Referrer key missing form os.environ dictionary?

2013-09-25 Thread Tim Chase
On 2013-09-25 14:18, John Gordon wrote: > However, if the user did not arrive from another page, then > HTTP_REFERER will be missing. This happens when the user types the > web address directly into their browser, or clicks on a bookmark, > or many other ways. > > Also, obviously, it's up to the

Re: Referrer key missing form os.environ dictionary?

2013-09-25 Thread Steven D'Aprano
On Wed, 25 Sep 2013 17:04:55 +0300, Νίκος wrote: > I would like to check for its existence and retrieve it if possible, if > its not there then default to the string "UnKnown Ref". > > I try to do this with: > > referer = os.environ.get('HTTP_REFERER', 'UnknownRef') > > but that doesn't return

Re: Referrer key missing form os.environ dictionary?

2013-09-25 Thread Steven D'Aprano
On Wed, 25 Sep 2013 17:07:38 +0300, Νίκος wrote: > ni...@superhost.gr [~/www/cgi-bin]# python metrites.py >File "metrites.py", line 27 > host = socket.gethostbyaddr( os.environ['REMOTE_ADDR'] )[0] or > 'UnKnown Host' > ^ > SyntaxError: invalid syntax > > > i dont see anything wr

Re: Referrer key missing form os.environ dictionary?

2013-09-25 Thread John Gordon
In =?UTF-8?B?zp3Or866zr/Pgg==?= writes: > But one other problem appeared too: > ni...@superhost.gr [~/www/cgi-bin]# python metrites.py >File "metrites.py", line 27 > host = socket.gethostbyaddr( os.environ['REMOTE_ADDR'] )[0] or > 'UnKnown Host' > ^ > SyntaxError: invalid syn

Re: Referrer key missing form os.environ dictionary?

2013-09-25 Thread John Gordon
In =?UTF-8?B?zp3Or866zr/Pgg==?= writes: > referer = os.environ.get('HTTP_REFERER', 'UnknownRef') > but that doesn't return anything either. When you say it "doesn't return anything", what exactly do you mean? Does it return None? Does it raise KeyError? Something else? In any case, I'm su

Re: Referrer key missing form os.environ dictionary?

2013-09-25 Thread Robert Kern
On 2013-09-25 15:07, Νίκος wrote: Στις 25/9/2013 5:01 μμ, ο/η Chris “Kwpolska” Warrick έγραψε: On Wed, Sep 25, 2013 at 2:45 PM, Νίκος wrote: Hello, i decided am ong other os.environ variables to also grab the 'HTTP_REFERER' fiel but when i try to run my script i was seeing a KeyError complaini

Re: Referrer key missing form os.environ dictionary?

2013-09-25 Thread John Gordon
In =?UTF-8?B?zp3Or866zr/Pgg==?= writes: > referrer = os.environ['HTTP_REFERER'] > Do i miss something? its a suprise to me that the environ dictioanry has > almost anythign but a referrer key. HTTP_REFERER is used to indicate the URL containing the link that led the user to the current URL.

Re: Referrer key missing form os.environ dictionary?

2013-09-25 Thread Νίκος
Στις 25/9/2013 5:01 μμ, ο/η Chris “Kwpolska” Warrick έγραψε: On Wed, Sep 25, 2013 at 2:45 PM, Νίκος wrote: Hello, i decided am ong other os.environ variables to also grab the 'HTTP_REFERER' fiel but when i try to run my script i was seeing a KeyError complaining that 'HTTP_REFERER' didnt exist.

Re: Referrer key missing form os.environ dictionary?

2013-09-25 Thread Νίκος
Στις 25/9/2013 5:01 μμ, ο/η Chris “Kwpolska” Warrick έγραψε: On Wed, Sep 25, 2013 at 2:45 PM, Νίκος wrote: Hello, i decided am ong other os.environ variables to also grab the 'HTTP_REFERER' fiel but when i try to run my script i was seeing a KeyError complaining that 'HTTP_REFERER' didnt exist.

Re: Referrer key missing form os.environ dictionary?

2013-09-25 Thread Chris “Kwpolska” Warrick
On Wed, Sep 25, 2013 at 2:45 PM, Νίκος wrote: > Hello, i decided am ong other os.environ variables to also grab the > 'HTTP_REFERER' fiel but when i try to run my script i was seeing a KeyError > complaining that 'HTTP_REFERER' didnt exist. > > So, to see what existed in the os.environ dictionary

Re: How to login to a website using Python 3.x?

2013-09-25 Thread Chris “Kwpolska” Warrick
On Tue, Sep 24, 2013 at 10:39 AM, Mark Lawrence wrote: > On 24/09/2013 09:09, Osumo Clement wrote: >> >> Hi. I am new to Python. I am making a script where logging in to a >> website is the first step.. I am using Python 3.3 All of the help I have >> seen online uses urllib2 which in Python 3 ai

Re: Referrer key missing form os.environ dictionary?

2013-09-25 Thread Νίκος
Στις 25/9/2013 3:45 μμ, ο/η Νίκος έγραψε: Hello, i decided am ong other os.environ variables to also grab the 'HTTP_REFERER' fiel but when i try to run my script i was seeing a KeyError complaining that 'HTTP_REFERER' didnt exist. So, to see what existed in the os.environ dictionary i issues a p

Referrer key missing form os.environ dictionary?

2013-09-25 Thread Νίκος
Hello, i decided am ong other os.environ variables to also grab the 'HTTP_REFERER' fiel but when i try to run my script i was seeing a KeyError complaining that 'HTTP_REFERER' didnt exist. So, to see what existed in the os.environ dictionary i issues a print( os.environ ) to see all available

Re: How to quickly search over a large number of files using python?

2013-09-25 Thread Roy Smith
In article <60f36178-b584-4fcb-8ad9-2dac6052e...@googlegroups.com>, dwivedi.dev...@gmail.com wrote: > Hi all, > > I am a newbie to python. > > I have about 500 search queries, and about 52000 files in which I have to > find all matches for each of the 500 queries. Before anybody can even begi

nexec on Android is ready for Python.

2013-09-25 Thread Tomohiko Sumi
I announce that nexec[1] is ready for Python. nexec is a system to transfer system call requests. You can use applications in an nexec server as same as those in your local machine. nexec is ready for Python now. Furthermore, nexec client for Android is available. These mean that you can use

Re: Possibilities of Building "Stacked Neural Networks"

2013-09-25 Thread William Ray Wing
On Sep 25, 2013, at 5:43 AM, Robert Kern wrote: > On 2013-09-24 19:03, Michael Lamport Commons wrote: >> Dear Members of this list-serve: >> >>Would it be possible to build “stacked neural networks” like the one >> shown in the attached document? >> >>You may have a few questio

Re: removing BOM prepended by codecs?

2013-09-25 Thread Dave Angel
On 25/9/2013 06:38, J. Bagg wrote: > So it is just a random sequence of "junk". > > It will be a matter of finding the real start of the record (in this > case a %) and throwing the "junk" away. Please join the list. Your present habit of starting a new thread for each of your messages is getti

removing BOM prepended by codecs?

2013-09-25 Thread J. Bagg
So it is just a random sequence of "junk". It will be a matter of finding the real start of the record (in this case a %) and throwing the "junk" away. I was misled by the note in the codecs class that BOMs were being prepended. Should have looked more carefully. Mea culpa. -- https://mail.

Re: How to quickly search over a large number of files using python?

2013-09-25 Thread Dave Angel
On 25/9/2013 04:41, dwivedi.dev...@gmail.com wrote: > Hi all, > > I am a newbie to python. > > I have about 500 search queries, and about 52000 files in which I have to > find all matches for each of the 500 queries. > > How should I approach this? Seems like the straightforward way to do it woul

Re: How to quickly search over a large number of files using python?

2013-09-25 Thread Oscar Benjamin
On 25 September 2013 09:41, wrote: > I am a newbie to python. > > I have about 500 search queries, and about 52000 files in which I have to > find all matches for each of the 500 queries. > > How should I approach this? Seems like the straightforward way to do it would > be to loop through each

Re: Possibilities of Building "Stacked Neural Networks"

2013-09-25 Thread Robert Kern
On 2013-09-24 19:03, Michael Lamport Commons wrote: Dear Members of this list-serve: Would it be possible to build “stacked neural networks” like the one shown in the attached document? You may have a few questions about the stacked neural network. For example, what is a stack

How to quickly search over a large number of files using python?

2013-09-25 Thread dwivedi . devika
Hi all, I am a newbie to python. I have about 500 search queries, and about 52000 files in which I have to find all matches for each of the 500 queries. How should I approach this? Seems like the straightforward way to do it would be to loop through each of the files and go line by line compar