Re: "High water" Memory fragmentation still a thing?

2014-10-03 Thread dieter
Croepha writes: > Does python in general terms (apart from extensions or gc manipulation), > exhibit a "high water" type leak of allocated memory in recent python > versions (2.7+)? Likely because it is very difficult to avoid. Would you need to definitely prevent it is "memory compaction": not o

Re: "High water" Memory fragmentation still a thing?

2014-10-03 Thread Chris Angelico
On Sat, Oct 4, 2014 at 3:48 PM, Steven D'Aprano wrote: > I think that you're conflating a couple of different issues, although I > welcome correction. > > I don't think that removing the GIL is a requirement for a memory compactor, > or vice versa. I think that PyPy is capable of plugging in vario

Re: Python 3.4.1 installer on Mac links Python to old Tcl/Tk

2014-10-03 Thread Ned Deily
In article , Kevin Walzer wrote: > On 10/3/14, 3:55 PM, Ned Deily wrote: > > Even if there were no incompatibilities, on OS X with Tcl and Tk (and > > other) frameworks, the version number is embedded in the path to the > > shared library and the linker normally creates an absolute path at that.

Re: "High water" Memory fragmentation still a thing?

2014-10-03 Thread Steven D'Aprano
Chris Angelico wrote: > On Sat, Oct 4, 2014 at 11:02 AM, Steven D'Aprano > wrote: >> Chris Angelico wrote: >> >>> In theory, a high >>> level language like Python would be allowed to move objects around to >>> compact memory, but CPython doesn't do this, and there's no proof that >>> it'd really

Re: Returning a List

2014-10-03 Thread Larry Hudson
On 10/03/2014 04:35 AM, Shiva wrote: Hi All, I might be doing something really silly here, but I can't seem to spot it: def front_x(words): b=[] c=[] for a in words: if a[0] == 'x': b.append(a) else: c.append(a) b = sorted(b) c = sorted(c) d= b

Re: Python Basics

2014-10-03 Thread Chris Angelico
On Sat, Oct 4, 2014 at 11:09 AM, Steven D'Aprano wrote: > In fairness to Seymour, at this extremely basic level, it's really hard to > explain to somebody how to solve a problem without giving them the answer. > > While I don't condone mindless parroting of work that others have done, > remember t

Re: "High water" Memory fragmentation still a thing?

2014-10-03 Thread Chris Angelico
On Sat, Oct 4, 2014 at 11:02 AM, Steven D'Aprano wrote: > Chris Angelico wrote: > >> In theory, a high >> level language like Python would be allowed to move objects around to >> compact memory, but CPython doesn't do this, and there's no proof that >> it'd really help anything anyway. > > I welco

Re: Python Basics

2014-10-03 Thread Steven D'Aprano
Chris Angelico wrote: > On Sat, Oct 4, 2014 at 8:54 AM, Seymore4Head > wrote: >> for i in range(1,10): >> print (str(i)*i) > > Seymour, please don't do this. When you "help" someone by just giving > him the answer to a homework problem, you get him past his immediate > issue of "I need to s

Re: "High water" Memory fragmentation still a thing?

2014-10-03 Thread Steven D'Aprano
Chris Angelico wrote: > In theory, a high > level language like Python would be allowed to move objects around to > compact memory, but CPython doesn't do this, and there's no proof that > it'd really help anything anyway. I welcome correction, but I understand that both the JVM and the CLR memor

Re: "High water" Memory fragmentation still a thing?

2014-10-03 Thread Chris Angelico
On Sat, Oct 4, 2014 at 4:36 AM, Croepha wrote: > What this means is that processes that do need to use a lot of memory will > exhibit a "high water" behavior, where they remain forever at the level of > memory usage that they required at their peak. This is almost never true. What you will see, t

Re:Python Basics

2014-10-03 Thread Dave Angel
diarmuid.higg...@mycit.ie Wrote in message: > Hi > > I have just started an introductory course on Python. I have never even seen > a programming language before so I am struggling a bit. Our lecturer has > given us a number of excercises to complete and I am stuck on the one I have > listed be

Re: Python Basics

2014-10-03 Thread Chris Angelico
On Sat, Oct 4, 2014 at 8:54 AM, Seymore4Head wrote: >>Q2. Implement a function called printNumTriangle. The function should ask the >>user to enter a single integer. It should then print a triangle of that size >>specified by the integer so that each row in the triangle is made up of the >>inte

Re: Python Basics

2014-10-03 Thread Seymore4Head
On Fri, 3 Oct 2014 10:35:38 -0700 (PDT), diarmuid.higg...@mycit.ie wrote: >Hi > >I have just started an introductory course on Python. I have never even seen a >programming language before so I am struggling a bit. Our lecturer has given >us a number of excercises to complete and I am stuck on t

Re: How to set the global variable so that it can be accessed and released inside other methods

2014-10-03 Thread Mark Lawrence
On 03/10/2014 22:43, Milson Munakami wrote: Hi Chris, I want to remove that CreateNet() part from the test class so that it will not create network every time in setup() because all the test cases are run and tested in same network! But the test class method also need to access the net object

Re: How to set the global variable so that it can be accessed and released inside other methods

2014-10-03 Thread Milson Munakami
Hi Chris, I want to remove that CreateNet() part from the test class so that it will not create network every time in setup() because all the test cases are run and tested in same network! But the test class method also need to access the net object How can I do that? Please Help. Thanks, Mil

Re: Recommended hosting

2014-10-03 Thread David Hutto
The best thing, and yes this is self promotion, is to find a "digital dealer". The server can be modularized locally, or across the server because you can work your way up with others. Just state the service(s) directly that you need, and an account can be individually modified just for you. On F

Re: Python 3.4.1 installer on Mac links Python to old Tcl/Tk

2014-10-03 Thread Kevin Walzer
On 10/3/14, 3:55 PM, Ned Deily wrote: Even if there were no incompatibilities, on OS X with Tcl and Tk (and other) frameworks, the version number is embedded in the path to the shared library and the linker normally creates an absolute path at that. Is this because Python lacks the concept of s

Re: "High water" Memory fragmentation still a thing?

2014-10-03 Thread Skip Montanaro
On Fri, Oct 3, 2014 at 1:36 PM, Croepha wrote: > Long running Python jobs that consume a lot of memory while > running may not return that memory to the operating system > until the process actually terminates, even if everything is > garbage collected properly. (I see Antoine replied that this

Re: Python 3.4.1 installer on Mac links Python to old Tcl/Tk

2014-10-03 Thread Ned Deily
In article , Christian Gollwitzer wrote: > Hmm, I'm not sure that the other projects would need an update. In Tcl > world, there is the concept of stub libraries, an extra level of > indirect linking provided by both the Tcl and Tk core. If the extensions > link to the stub library (the standa

Re: "High water" Memory fragmentation still a thing?

2014-10-03 Thread Christian Heimes
On 03.10.2014 21:16, Antoine Pitrou wrote: > It is not a leak. It is a quite common pattern of memory fragmentation. > The article is wrong in assuming that Python doesn't return the memory to > the OS. Python does return its empty memory pools to the OS, however the OS > itself may not be able to

Re: "High water" Memory fragmentation still a thing?

2014-10-03 Thread Antoine Pitrou
Hello, Croepha gmail.com> writes: > > Question: > > Does python in general terms (apart from extensions or gc manipulation), exhibit a "high water" type leak of allocated memory in recent python versions (2.7+)? It is not a leak. It is a quite common pattern of memory fragmentation. The artic

Re: Returning a List

2014-10-03 Thread Terry Reedy
On 10/3/2014 7:35 AM, Shiva wrote: Hi All, I might be doing something really silly here, but I can't seem to spot it: def front_x(words): b=[] c=[] for a in words: if a[0] == 'x': b.append(a) else: c.append(a) b = sorted(b) c = sorted(c) Just so

"High water" Memory fragmentation still a thing?

2014-10-03 Thread Croepha
Question: Does python in general terms (apart from extensions or gc manipulation), exhibit a "high water" type leak of allocated memory in recent python versions (2.7+)? Background: >From the post: http://chase-seibert.github.io/blog/2013/08/03/diagnosing-memory-leaks-python.html Begin quote:

Re: Python Basics

2014-10-03 Thread Tobiah
Hi Chris I can't get the code to display the output as it should. I can get it to display like this: 1223335 or I can get it to display like this: 1 2 2 3 3 3 4 4 4 4 5 5 5 5 5 but not as has been asked in the question. Cheers Diarmuid Hint: 'a' * 4 '' -- https://mail.python

Re: Python Basics

2014-10-03 Thread Chris Angelico
On Sat, Oct 4, 2014 at 3:54 AM, wrote: > Hi Chris > I can't get the code to display the output as it should. > I can get it to display like this: > 1223335 or I can get it to display like this: > 1 > 2 > 2 > 3 > 3 > 3 > 4 > 4 > 4 > 4 > 5 > 5 > 5 > 5 > 5 > but not as has been asked in the

Re: Python Basics

2014-10-03 Thread diarmuid . higgins
On Friday, October 3, 2014 6:47:54 PM UTC+1, Chris Angelico wrote: > On Sat, Oct 4, 2014 at 3:44 AM, wrote: > > > def printNumTriangle(): > > >num = input("Please enter an integer for triangle size:") > > >for i in range(1,num+1): > > > for j in range (i): > > > print

Re: Python Basics

2014-10-03 Thread Chris Angelico
On Sat, Oct 4, 2014 at 3:44 AM, wrote: > def printNumTriangle(): >num = input("Please enter an integer for triangle size:") >for i in range(1,num+1): > for j in range (i): > print i > > Cheers Okay! You're very close, and I can see what's going on there. But I'd like y

Re: Python Basics

2014-10-03 Thread diarmuid . higgins
def printNumTriangle(): num = input("Please enter an integer for triangle size:") for i in range(1,num+1): for j in range (i): print i Cheers On Friday, October 3, 2014 6:42:46 PM UTC+1, Chris Angelico wrote: > On Sat, Oct 4, 2014 at 3:35 AM, wrote: > > > Our lecturer

Re: Python Basics

2014-10-03 Thread Chris Angelico
On Sat, Oct 4, 2014 at 3:35 AM, wrote: > Our lecturer has given us a number of excercises to complete and I am stuck > on the one I have listed below. Please help Sure! Show us the code you have so far, and explain what it is you're stuck on. Then we can help you. But we're not going to write t

Python Basics

2014-10-03 Thread diarmuid . higgins
Hi I have just started an introductory course on Python. I have never even seen a programming language before so I am struggling a bit. Our lecturer has given us a number of excercises to complete and I am stuck on the one I have listed below. Please help Q2. Implement a function called print

Re: Recommended hosting

2014-10-03 Thread Miki Tebeka
Greetings, > I'd like to build a web site for myself, essentially a "vanity" web site to > show off whatever web development skills I have, and perhaps do some > blogging. I'm a Python developer, so I'd like to develop the site with the > following stack: > web applications written with Python

Egg help wanted

2014-10-03 Thread cl
I have installed (using easy_install) a little utility, it seems to have installed just the top-level python script in /usr/local/bin which in turn uses load_entry_point() to run the actual code. As far as I can see the code and support files remain in the .egg file in /usr/local/lib/python2.7/dis

Re: Recommended hosting

2014-10-03 Thread marco . nawijn
On Thursday, October 2, 2014 3:30:38 PM UTC+2, writeson wrote: > Hi all, > > > > I'd like to build a web site for myself, essentially a "vanity" web site to > show off whatever web development skills I have, and perhaps do some > blogging. I'm a Python developer, so I'd like to develop the sit

Re: Is there a way to display source code for Python function?

2014-10-03 Thread Mark Lawrence
On 03/10/2014 09:16, Viet Nguyen wrote: [snip normal google stuff] Would you please access this list via https://mail.python.org/mailman/listinfo/python-list or read and action this https://wiki.python.org/moin/GoogleGroupsPython to prevent us seeing double line spacing and single line paragr

Re: Returning a List

2014-10-03 Thread Shiva
Chris Angelico gmail.com> writes: > > On Fri, Oct 3, 2014 at 9:35 PM, Shiva > yahoo.com.dmarc.invalid> wrote: > > Why is return d or return b+c not returning anything?? > > > > On what basis do you believe it's not returning anything? When you > call it, down below, you're ignoring its return

Re: Returning a List

2014-10-03 Thread Chris Angelico
On Fri, Oct 3, 2014 at 9:35 PM, Shiva wrote: > Why is return d or return b+c not returning anything?? > On what basis do you believe it's not returning anything? When you call it, down below, you're ignoring its return value. I expect it's returning just fine, but you then do nothing with it. Ch

Returning a List

2014-10-03 Thread Shiva
Hi All, I might be doing something really silly here, but I can't seem to spot it: def front_x(words): b=[] c=[] for a in words: if a[0] == 'x': b.append(a) else: c.append(a) b = sorted(b) c = sorted(c) d= b+c print('d = ',d) #return b+c return d f

Re: Is there a way to display source code for Python function?

2014-10-03 Thread Viet Nguyen
On Friday, October 3, 2014 12:48:08 AM UTC-7, Peter Otten wrote: > Viet Nguyen wrote: > > > > > On Thursday, October 2, 2014 10:34:15 PM UTC-7, Viet Nguyen wrote: > > >> Hi, > > >> > > >> > > >> > > >> When I am debug mode, is there some command which will help display the > > >> source

Re: How to show a dictionary sorted on a value within its data?

2014-10-03 Thread Chris Angelico
On Fri, Oct 3, 2014 at 5:55 PM, Steven D'Aprano wrote: >> which return non-list iterables. There's no really convenient equivalent >> to the map() usage of "call this function with each of these args, and >> discard the return values", as it looks very odd to do a list comp for >> nothing: > > map

Re: How to show a dictionary sorted on a value within its data?

2014-10-03 Thread Steven D'Aprano
On Fri, 03 Oct 2014 12:44:32 +1000, Chris Angelico wrote: > On Fri, Oct 3, 2014 at 9:16 AM, Steven D'Aprano > wrote: >>> Anyway, pylint doesn't complain about a bare use of lambda, but it >>> does complain about a map applied to a lambda or a filter applied to a >>> lambda. Pylint says they coul

Re: Is there a way to display source code for Python function?

2014-10-03 Thread Peter Otten
Viet Nguyen wrote: > On Thursday, October 2, 2014 10:34:15 PM UTC-7, Viet Nguyen wrote: >> Hi, >> >> >> >> When I am debug mode, is there some command which will help display the >> source code for a Python function of interest? Much like you'd use "info >> proc" to display contents of Tcl pro

Re: Python 3.4.1 installer on Mac links Python to old Tcl/Tk

2014-10-03 Thread Christian Gollwitzer
Am 03.10.14 00:08, schrieb Ned Deily: So, to really support Tk 8.6, the only viable option at the moment would be for us to ship our own versions of Tk, like the Windows installer does. But it wouldn't be acceptable, IMO, to force other projects and users to migrate to 8.6 in the middle of a rel