|
Re: clear a variable: msg#00037python.numeric.general
At 4:54 PM -0400 2004-08-12, Andrew Wilson wrote: Hello, I can't seem to find this in the documentation, is there a way to clear a variable. For example I have an application that opens displays a bunch of images, they can be big memory hogs. When I'm not showing them I'd like to clear out those variables, instead of having to close down my program and start over. I know matlab has a command "clear var" which will do exactly that. del(obj) If you are the only user of "obj", this'll do the trick. (del tries to be polite and not pull the rug out from under other users). obj can be nearly anything, such as an array or any other object you created. del can also be used to delete specific elements of lists and dictionaries, i.e.: del(adict[akey]) del(alist[ind1:ind2]) I hope this help. -- Russell ------------------------------------------------------- SF.Net email is sponsored by Shop4tech.com-Lowest price on Blank Media 100pk Sonic DVD-R 4x for only $29 -100pk Sonic DVD+R for only $33 Save 50% off Retail on Ink & Toner - Free Shipping and Free Gift. http://www.shop4tech.com/z/Inkjet_Cartridges/9_108_r285 |
|
| <Prev in Thread] | Current Thread | [Next in Thread> |
|---|---|---|
| Previous by Date: | clear a variable: 00037, Andrew Wilson |
|---|---|
| Next by Date: | invalid numeric result(s) in divide: 00037, Curzio Basso |
| Previous by Thread: | clear a variablei: 00037, Andrew Wilson |
| Next by Thread: | invalid numeric result(s) in divide: 00037, Curzio Basso |
| Indexes: | [Date] [Thread] [Top] [All Lists] |
| News | FAQ | advertise |