FAQ
Hi,

Is there a way to erase/delete/clear memory before a piece of code is
run?

Otherwise, the objects of the previous run are re-usable, and may
bring confusion to the tester.

Thank you

Search Discussions

  • Steve Holden at Mar 21, 2010 at 3:13 pm

    vsoler wrote:
    Hi,

    Is there a way to erase/delete/clear memory before a piece of code is
    run?

    Otherwise, the objects of the previous run are re-usable, and may
    bring confusion to the tester.

    Thank you
    You mean clear a *namespace*?

    That might be possible if you have access to the specific module whose
    namespace you want to clear.

    I presume this is related to earlier questions about reloading modules?
    This is yet another reason why you might want to consider running each
    module in its own process each time the user submits it.

    regards
    Steve
    --
    Steve Holden +1 571 484 6266 +1 800 494 3119
    See PyCon Talks from Atlanta 2010 http://pycon.blip.tv/
    Holden Web LLC http://www.holdenweb.com/
    UPCOMING EVENTS: http://holdenweb.eventbrite.com/
  • Jon Clements at Mar 21, 2010 at 3:18 pm

    On 21 Mar, 15:02, vsoler wrote:
    Hi,

    Is there a way to erase/delete/clear memory before a piece of code is
    run?

    Otherwise, the objects of the previous run are re-usable, and may
    bring confusion to the tester.

    Thank you
    I'm guessing you're using some sort of IDE?

    For instance, in IDLE if the [Python Shell] window is not closed, the
    session is kept. However, there is a menu option 'Shell' which has
    'Restart Shell'. If you don't see a 'Shell' menu option, then make
    sure IDLE isn't being started with the -n option.

    However I would have thought the 'tester' would be running from a
    terminal/command line/double click jobby, so that a single Python
    session is executed and just runs -- rather than want to use it
    interactively afterwards.

    hth

    Jon.
  • Vsoler at Apr 10, 2010 at 2:33 pm

    On Mar 21, 5:18?pm, Jon Clements wrote:
    On 21 Mar, 15:02, vsoler wrote:

    Hi,
    Is there a way to erase/delete/clear memory before a piece of code is
    run?
    Otherwise, the objects of the previous run are re-usable, and may
    bring confusion to the tester.
    Thank you
    I'm guessing you're using some sort of IDE?

    For instance, in IDLE if the [Python Shell] window is not closed, the
    session is kept. However, there is a menu option 'Shell' which has
    'Restart Shell'. If you don't see a 'Shell' menu option, then make
    sure IDLE isn't being started with the -n option.

    However I would have thought the 'tester' would be running from a
    terminal/command line/double click jobby, so that a single Python
    session is executed and just runs -- rather than want to use it
    interactively afterwards.

    hth

    Jon.
    Hello Jon,

    I'm using PythonWin and there is no Shell menu option. And yes, I am
    using python interactively.

    Perhaps it is simply impossible to delete all the attributes of a
    namespace in a single shot?

Related Discussions

Discussion Navigation
viewthread | post
Discussion Overview
grouppython-list @
categoriespython
postedMar 21, '10 at 3:02p
activeApr 10, '10 at 2:33p
posts4
users3
websitepython.org

People

Translate

site design / logo © 2022 Grokbase