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
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
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:
"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
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
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
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
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