Re: [Tutor] reading lines from a list of files

2015-05-13 Thread Danny Yoo
> As a follow up question: > The following seems to work- > > for f_name in list_of_file_names: > for line in open(f_name, 'r'): > process(line) > > but should I be worried that the file doesn't get explicitly closed? It depends on context. Personally, I'd write it with t

Re: [Tutor] reading lines from a list of files

2015-05-13 Thread Alex Kleider
On 2015-05-11 23:48, Peter Otten wrote: Alex Kleider wrote: Is there a better (more 'Pythonic') way to do the following? for f_name in f_names: with open(f_name, 'r') as f: for line in f: There's the fileinput module

Re: [Tutor] reading lines from a list of files

2015-05-13 Thread Oscar Benjamin
On 12 May 2015 at 19:08, Peter Otten <__pete...@web.de> wrote: >> >> A generator cannot guarantee that execution continues after a yield so >> any context manager used around a yield is dependent on __del__. I >> think a good rule of thumb is "don't yield from a with block". > > Uh-oh, I am afraid

Re: [Tutor] Permissions between Apache, Python cgi scripts and Unix Sockets

2015-05-13 Thread Stewart Lawton
From: Alan Gauld To: Stewart Lawton ; tutor Sent: Tuesday, 12 May 2015, 20:01 Subject: Re: my membership and access to the Tutor list Forwarding to the list for comment. Always use Reply All9Or Reply List if your mailer supports it) when including the list members. Alan G On 12/0