On 08/01/2014 04:41, Keith Winston wrote:
Iirc, Python periodically cleans memory of bits & pieces that are no
longer being used. I periodically do something stupid -- I mean
experimental -- and end up with a semi-locked up system. Sometimes it
comes back, sometimes everything after that point r
On 08/01/2014 03:36, Keith Winston wrote:
Hey Steven,
That's a cool primes module, I'm going to look that over more carefully.
I can see that you've thought through this stuff before ;)
And yeah, I'd like to see your Stopwatch code... I haven't looked at
"with" yet, that's interesting. As usual
Danny Yoo wrote:
> One of the common cases for split() is to break a line into a list of
> words, for example.
>
> #
'hello this is a test'.split()
> ['hello', 'this', 'is', 'a', 'test']
> #
>
> The Standard Library can
well, fair enough. Generally, the issue involves instances when Python will
come back, but it might take several minutes or much longer. And weird
behaviour ensues: like timers I put on the program don't actually time the
amount of time it's busy (by a very, very large margin). Also, often
several
On 08/01/2014 09:30, Keith Winston wrote:
well, fair enough. Generally, the issue involves instances when Python
will come back, but it might take several minutes or much longer. And
weird behaviour ensues: like timers I put on the program don't actually
time the amount of time it's busy (by a ve
Yes, I did read the context manager stuff, but I can only absorb a bit of
it, I just don't have the background. It's getting better though. Plus I
think most things will come only after I play with them, and I haven't
really played much with wrappers, decorators and the like. Which is fine,
the yea
On 08/01/14 08:15, Mark Lawrence wrote:
I just saw where I could do os.system('python'), but in restarting the
interpreter I'd lose everything currently loaded: my real question
involves merely pushing the garbage collector into action, I think.
Don't do that!
You are not restarting the interp
On 08/01/2014 10:41, Alan Gauld wrote:
On 08/01/14 08:15, Mark Lawrence wrote:
Did I? :)
I just saw where I could do os.system('python'), but in restarting the
interpreter I'd lose everything currently loaded: my real question
involves merely pushing the garbage collector into action, I thi
On Tue, Jan 07, 2014 at 11:41:53PM -0500, Keith Winston wrote:
> Iirc, Python periodically cleans memory of bits & pieces that are no longer
> being used. I periodically do something stupid -- I mean experimental --
> and end up with a semi-locked up system. Sometimes it comes back,
> sometimes eve
On 08/01/14 10:50, Mark Lawrence wrote:
On 08/01/2014 10:41, Alan Gauld wrote:
On 08/01/14 08:15, Mark Lawrence wrote:
Did I? :)
Oops, one too many lines deleted.
Sorry Mark.
--
Alan G
Author of the Learn to Program web site
http://www.alan-g.me.uk/
http://www.flickr.com/photos/alangauldph
On Tue, Jan 07, 2014 at 10:36:56PM -0500, Keith Winston wrote:
> And yeah, I'd like to see your Stopwatch code... I haven't looked at "with"
> yet, that's interesting. As usual, I don't totally get it...
Okay, let's talk about a common pattern in Python code:
try:
do some stuff
finally:
c
On 01/08/2014 10:30 AM, Keith Winston wrote:
well, fair enough. Generally, the issue involves instances when Python will
come back, but it might take several minutes or much longer. And weird
behaviour ensues: like timers I put on the program don't actually time the
amount of time it's busy (by a
On Wed, Jan 08, 2014 at 12:43:06PM +0100, spir wrote:
> [Just wildly guessing, don't know your app & code. Can you reduce it to a
> minimal still manifesting similar bug?]
Try (or rather, *don't* try):
import sys
list(range(sys.maxsize))
That ought to do it :-)
(Note: depending on your opera
Well, thanks everyone. I get the picture. And there's nothing subtle going
on here: I'm playing around, trying to factor million-digit numbers and the
like. No biggie, this was interesting.
___
Tutor maillist - Tutor@python.org
To unsubscribe or change
need help how to run it on python 3.3, or change it to python 3.3 when i run it
says syntax error if i run it on python 2.7 it works.
# Import statements
import random
import datetime
#Arrays to store the definitions and keywords read from the file
keywords=[];
definition=[];
correctAnswer=[];
I've been playing with recursion, it's very satisfying.
However, it appears that even if I sys.setrecursionlimit(10), it blows
up at about 24,000 (appears to reset IDLE). I guess there must be a lot of
overhead with recursion, if only 24k times are killing my memory?
I'm playing with a challe
On Jan 8, 2014 5:51 PM, "Keith Winston" wrote:
>
> Well, thanks everyone. I get the picture. And there's nothing subtle
going on here: I'm playing around, trying to factor million-digit numbers
and the like. No biggie, this was interesting.
Million digit numbers will use up some memory. Perhaps a
On 08/01/2014 18:19, S Tareq wrote:
need help how to run it on python 3.3, or change it to python 3.3 when i
run it says syntax error if i run it on python 2.7 it works.
if(counter%2==0):
Please remove those unneeded brackets, this is a Python list, not C :)
print "Please Se
On 1/8/2014 12:25 PM, Keith Winston wrote:
I've been playing with recursion, it's very satisfying.
However, it appears that even if I sys.setrecursionlimit(10), it
blows up at about 24,000 (appears to reset IDLE). I guess there must be
a lot of overhead with recursion, if only 24k times are
Hi S Tareq,
You probably want to review the "What's new in Python 3" document,
with close attention to the "Common Stumbing Blocks" section:
http://docs.python.org/3.0/whatsnew/3.0.html#common-stumbling-blocks
Have you read this document already?
On Wed, Jan 8, 2014 at 3:30 PM, Oscar Benjamin
wrote:
> The garbage collector has nothing to do with the memory usage of immutable
> types like ints. There are deallocated instantly when the last reference
> you hold is cleared (in CPython). So if you run out of memory because of
> them then it is
On Wed, Jan 8, 2014 at 3:42 PM, Emile van Sebille wrote:
>
> Without seeing your code it's hard to be specific, but it's obvious you'll
> need to rethink your approach. :)
Yes, it's clear I need to do the bulk of it without recusion, I haven't
really thought about how to do that. I may or may
On Jan 8, 2014 9:11 PM, "Keith Winston" wrote:
>
>
> On Wed, Jan 8, 2014 at 3:30 PM, Oscar Benjamin
wrote:
>>
>> The garbage collector has nothing to do with the memory usage of
immutable types like ints. There are deallocated instantly when the last
reference you hold is cleared (in CPython). So
On Wed, Jan 8, 2014 at 3:25 PM, Keith Winston wrote:
> I've been playing with recursion, it's very satisfying.
>
> However, it appears that even if I sys.setrecursionlimit(10), it blows
> up at about 24,000 (appears to reset IDLE). I guess there must be a lot of
> overhead with recursion, if o
You might want to check out the '2to3' program to convert Python 2.x
code to Python 3.x code.
The following command worked to change your code to runnable Python 3.x
code:
2to3 -w
--
Steve Mayer
smaye...@me.com
On 8 Jan 2014, at 10:19, S Tareq wrote:
need help how to run it on python
Hi S Tareq,
If you can, next time please just copy and paste the error message as
plain text. Please avoid screenshots unless they really are relevant
to the problem at hand.
There are good reasons why you should prefer plain text when asking
questions on a mailing list like this one. (1) Scree
On 01/08/2014 10:11 PM, Keith Winston wrote:
On Wed, Jan 8, 2014 at 3:42 PM, Emile van Sebille wrote:
Without seeing your code it's hard to be specific, but it's obvious you'll
need to rethink your approach. :)
Yes, it's clear I need to do the bulk of it without recusion, I haven't
reall
On Wed, Jan 8, 2014 at 4:23 PM, eryksun wrote:
> You can create a worker thread with a larger stack using the threading
> module. On Windows the upper limit is 256 MiB, so give this a try:
>
quite excellent, mwahaha... another shovel to help me excavate out the
bottom of my hole... I'll play wi
On Wed, Jan 8, 2014 at 5:15 PM, spir wrote:
> Funny and useful exercise in recursion: write a func that builds str and
> repr expressions of any object, whatever its attributes, inductively. Eg
> with
>
Hmm, can't say I get the joke. I haven't really played with repr, though I
think I understand
On 08/01/2014 20:54, S Tareq wrote:
On Wednesday, 8 January 2014, 20:46, Danny Yoo
wrote:
Hi S Tareq,
You probably want to review the "What's new in Python 3" document,
with close attention to the "Common Stumbing Blocks" section:
http://docs.python.org/3.0/whatsnew/3.0.html#common-stumbling-
On Wed, 8 Jan 2014 16:23:06 -0500, eryksun wrote:
On Wed, Jan 8, 2014 at 3:25 PM, Keith Winston
wrote:
> I've been playing with recursion, it's very satisfying.
>
> However, it appears that even if I sys.setrecursionlimit(10),
it blows
> up at about 24,000 (appears to reset IDLE). I gue
On Wed, 8 Jan 2014 20:54:09 + (GMT), S Tareq
wrote:
___
Tutor maillist - Tutor@python.org
To unsubscribe or change subscription options:
https://mail.python.org/mailman/listinfo/tutor
This is a text newsgroup. Html messages and attachments of
On Wed, Jan 8, 2014 at 6:16 PM, Dave Angel wrote:
> I can't see the bodies of any of your messages (are you perchance posting
> in html? ), but I think there's a good chance you're abusing recursion and
> therefore hitting the limit much sooner than necessary. I've seen some code
> samples here
On Wed, Jan 8, 2014 at 3:30 PM, Oscar Benjamin
wrote:
> The garbage collector has nothing to do with the memory usage of immutable
> types like ints. There are deallocated instantly when the last reference you
> hold is cleared (in CPython). So if you run out of memory because of them
> then it is
On Thu, Jan 9, 2014 at 12:27 AM, eryksun wrote:
> The old float freelist was the same design as the one for 2.x int
> (PyInt, not PyLong), which grows without bound. The design also
> allocates objects in 1 KiB blocks (approx. size). glibc's malloc will
> use the heap for a block that's this smal
35 matches
Mail list logo