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

2015-05-12 Thread Albert-Jan Roskam via Tutor
-- On Tue, May 12, 2015 9:54 PM CEST Peter Otten wrote: >Albert-Jan Roskam wrote: > >> It was not that long ago that I found out about the fileinput module, so I >> sometimes forget to use it. It is not specify the encoding of the files, >> is it? It'd be nice if one c

Re: [Tutor] Open a Url in new tab and tab switching in IE using python and selenium

2015-05-12 Thread shweta kaushik
Hi Laura, I have posted same question in stackoverflow.com also but no body replied till now, For timebeing I am using another approach to do my work. Thank you all for your suggestions. Regards, Shweta On Tue, May 12, 2015 at 3:06 PM, Laura Creighton wrote: > In a message of Wed, 06 May 2015

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

2015-05-12 Thread Peter Otten
Albert-Jan Roskam wrote: > It was not that long ago that I found out about the fileinput module, so I > sometimes forget to use it. It is not specify the encoding of the files, > is it? It'd be nice if one could specify a tuple of encodings, e.g. > ('utf-8-sig', 'latin1', 'cp1252'). > > input(fil

Re: [Tutor] my membership and access to the Tutor list

2015-05-12 Thread Alan Gauld
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/05/15 11:24, Stewart Lawton wrote: Hi Alan I have worked though the file permissions cogniscent of your comments to see if I can find what is fail

Re: [Tutor] Open a Url in new tab and tab switching in IE using python and selenium

2015-05-12 Thread Laura Creighton
In a message of Wed, 06 May 2015 00:15:39 +0100, Alan Gauld writes: >On 05/05/15 19:22, shweta kaushik wrote: >> Thanks Steve for the information. >> I searched but was not able to find suitable forum to shoot this question. >> So posted here if anyone can help out. >> > >As Steve suggested the mai

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

2015-05-12 Thread Albert-Jan Roskam via Tutor
-- On Tue, May 12, 2015 8:48 AM CEST 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 file

Re: [Tutor] Tutor Digest, Vol 135, Issue 12

2015-05-12 Thread Laura Creighton
In a message of Tue, 05 May 2015 09:55:32 +0100, Alan Gauld writes: >On 05/05/15 08:17, Siya 360 wrote: > >> Twice i unsubscribed to this mailing list, and i still continue to get them, >> why? > >The web page is the only way to unsubscribe. Nobody else >on the list can unsubscribe you. This is

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

2015-05-12 Thread Peter Otten
Oscar Benjamin 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 I did this quite a few times. Most instances seem

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

2015-05-12 Thread David Rock
* Alex Kleider [2015-05-12 02:33]: > 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: > > > > Th

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

2015-05-12 Thread Oscar Benjamin
On 12 May 2015 at 11:46, Peter Otten <__pete...@web.de> wrote: > > > although the reason > > for my inquiry was more to diminish levels of indentation > > than number of lines. > > You usually do that by factoring out the loops into a generator: > > def lines(files): > for file in files: >

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

2015-05-12 Thread Peter Otten
Alex Kleider wrote: > 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 modu

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

2015-05-12 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] TCP server/client application failing. Need some help with the basics!

2015-05-12 Thread Anubhav Yadav
But starting with a multi threaded server is not what I'd > call starting small. Its quite advanced. I'd start getting > non multi threaded servers running reliably first. Then > I'd try adding some threading. As in maybe a dozen > connections sharing some data source.. > > Only then would I e