Re: What happens when you 'break' a generator?

2014-07-29 Thread Johannes Schneider
happens to it? My guess is that normal scoping rules apply. Using my example, the generator is referenced by 'x', so when 'x' goes out of scope, the generator is garbage collected, even though it never completed. Is this correct? Frank Millman -- Johannes Schneider Webentwicklung

Re: The possibility integration in Python without an equation, just an array-like file

2014-05-16 Thread Johannes Schneider
@student.kuleuven.be; enlong@biotech.tu-dresden.de mailto:enlong@biotech.tu-dresden.de Mobile Phone: +4917666191322 Mailing Address: Zi. 0108R, Budapester Straße 24, 01069, Dresden, Germany -- Johannes Schneider Webentwicklung johannes.schnei...@galileo-press.de Tel.: +49.228.42150.xxx Galileo

Re: The “does Python have variables?” debate

2014-05-08 Thread Johannes Schneider
, it's not calling by reference, because g(l1) l1 [1, 'foo', 3] does not change l1. Once again, if I pass an object it behaves like calling by reference: class A: ... a = 0 ... a = A() a.a 0 def h(a1): ... a1.a = 1 ... h(a) a.a 1 bg, Johannes -- Johannes Schneider Webentwicklung

Re: why i have the output of [None, None, None]

2014-04-10 Thread Johannes Schneider
have the output of [None, None, None] -- Johannes Schneider Webentwicklung johannes.schnei...@galileo-press.de Tel.: +49.228.42150.xxx Galileo Press GmbH Rheinwerkallee 4 - 53227 Bonn - Germany Tel.: +49.228.42.150.0 (Zentrale) .77 (Fax) http://www.galileo-press.de/ Geschäftsführer: Tomas

Re: The sum of numbers in a line from a file

2014-02-21 Thread Johannes Schneider
two columns. I want to do this for every name. All I've got is sum([int(s.strip()) for s in open('file').readlines()]) -- Johannes Schneider Webentwicklung johannes.schnei...@galileo-press.de Tel.: +49.228.42150.xxx Galileo Press GmbH Rheinwerkallee 4 - 53227 Bonn - Germany Tel

Re: SSH/Telnet program to Router/switch

2014-02-19 Thread Johannes Schneider
I'm using paramiko to access some routers and firewalls from python and it works very well. bg, Johannes -- Johannes Schneider Webentwicklung johannes.schnei...@galileo-press.de Tel.: +49.228.42150.xxx Galileo Press GmbH Rheinwerkallee 4 - 53227 Bonn - Germany Tel.: +49.228.42.150.0

Re: SIngleton from __defaults__

2014-01-24 Thread Johannes Schneider
thnx guys. On 24.01.2014 01:10, Terry Reedy wrote: Johannes Schneider johannes.schnei...@galileo-press.de Wrote in message: On 22.01.2014 20:18, Ned Batchelder wrote: On 1/22/14 11:37 AM, Asaf Las wrote: Chris is right here, too: modules are themselves singletons, no matter how many times

Re: SIngleton from __defaults__

2014-01-23 Thread Johannes Schneider
namespace. But the value differs in stuff() and before/after the import statement. So the instance of the module differs - it cannot be a singelton. bg, Johannes -- Johannes Schneider Webentwicklung johannes.schnei...@galileo-press.de Tel.: +49.228.42150.xxx Galileo Press GmbH Rheinwerkallee 4

Imports in Python

2014-01-21 Thread Johannes Schneider
? bg, Johannes -- Johannes Schneider Webentwicklung johannes.schnei...@galileo-press.de Tel.: +49.228.42150.xxx Galileo Press GmbH Rheinwerkallee 4 - 53227 Bonn - Germany Tel.: +49.228.42.150.0 (Zentrale) .77 (Fax) http://www.galileo-press.de/ Geschäftsführer: Tomas Wehren, Ralf Kaulisch, Rainer

Re: matlabFunction Equivalent?

2014-01-21 Thread Johannes Schneider
and supporting most (all?) of the python syntax and moduls bg, Johannes -- Johannes Schneider Webentwicklung johannes.schnei...@galileo-press.de Tel.: +49.228.42150.xxx Galileo Press GmbH Rheinwerkallee 4 - 53227 Bonn - Germany Tel.: +49.228.42.150.0 (Zentrale) .77 (Fax) http://www.galileo

Re: Brython (Python in the browser)

2013-12-27 Thread Johannes Schneider
-- Johannes Schneider Webentwicklung johannes.schnei...@galileo-press.de Tel.: +49.228.42150.xxx Galileo Press GmbH Rheinwerkallee 4 - 53227 Bonn - Germany Tel.: +49.228.42.150.0 (Zentrale) .77 (Fax) http://www.galileo-press.de/ Geschäftsführer: Tomas Wehren, Ralf Kaulisch, Rainer Kaltenecker HRB 8363

Differences between obj.attribute and getattr(obj, attribute)

2013-12-11 Thread Johannes Schneider
Hi list, can somebody explain me the difference between accessing attributes via obj.attribute and getattr(obj, attribute)? Is there a special reason or advantage when using getattr? bg, Johannes -- Johannes Schneider Webentwicklung johannes.schnei...@galileo-press.de Tel.: +49.228.42150.xxx

Re: Differences between obj.attribute and getattr(obj, attribute)

2013-12-11 Thread Johannes Schneider
thank you guys. On 11.12.2013 10:36, Chris Angelico wrote: 2013/12/11 Johannes Schneider johannes.schnei...@galileo-press.de: can somebody explain me the difference between accessing attributes via obj.attribute and getattr(obj, attribute)? Is there a special reason or advantage when using