Re: clear memory? how?

2006-05-10 Thread Ben C
On 2006-05-10, Gr�goire Dooms <[EMAIL PROTECTED]> wrote: > Ben C wrote: >> On 2006-05-09, Ben C <[EMAIL PROTECTED]> wrote: >>> def clearall(): >>> all = [var for var in globals() if "__" not in (var[:2], var[-2:])] >>> for var in all: >>> del globals()[var] >>> >>> since I think mag

Re: clear memory? how?

2006-05-10 Thread Grégoire Dooms
Ben C wrote: > On 2006-05-09, Ben C <[EMAIL PROTECTED]> wrote: >> def clearall(): >> all = [var for var in globals() if "__" not in (var[:2], var[-2:])] >> for var in all: >> del globals()[var] >> >> since I think magic things always start and end with __. > > Oops, got that wrong

Re: clear memory? how?

2006-05-09 Thread Ben C
On 2006-05-09, Ben C <[EMAIL PROTECTED]> wrote: > def clearall(): > all = [var for var in globals() if "__" not in (var[:2], var[-2:])] > for var in all: > del globals()[var] > > since I think magic things always start and end with __. Oops, got that wrong anyway: should be:

Re: clear memory? how?

2006-05-09 Thread Terry Reedy
"Diez B. Roggisch" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > You don't - python does it for you. It is called garbage collection. All > you > have to to is get into granny-mode(tm): forget about things. In general, especially for beginners, this is good advice. Forget about

Re: clear memory? how?

2006-05-09 Thread Ben C
On 2006-05-09, Diez B. Roggisch <[EMAIL PROTECTED]> wrote: > N/A wrote: > >> Hi all, >> I am learning Python. Just wondering how to clear saved memory in >> Python? Like in Matlab I can simply use "clear all" to clear all saved >> memory. > > You don't - python does it for you. It is called garbage

Re: clear memory? how?

2006-05-09 Thread Andrew Gwozdziewycz
Glad to see you're trying Python instead of Matlab. Python was never meant to be a replacement for Matlab. It's a general purpose programming language like Java, or C#. Though it has very little in common with either of those languages. Since Python is a general purpose language, if you wan

Re: clear memory? how?

2006-05-09 Thread Diez B. Roggisch
N/A wrote: > Hi all, > I am learning Python. Just wondering how to clear saved memory in > Python? Like in Matlab I can simply use "clear all" to clear all saved > memory. You don't - python does it for you. It is called garbage collection. All you have to to is get into granny-mode(tm): forget a

clear memory? how?

2006-05-09 Thread N/A
Hi all, I am learning Python. Just wondering how to clear saved memory in Python? Like in Matlab I can simply use "clear all" to clear all saved memory. Thank u! -- http://mail.python.org/mailman/listinfo/python-list