Hacker News new | past | comments | ask | show | jobs | submit login

I notice that "globals" is on the "you won't use this much" pile. I am wondering, when using Python interactively from Emacs, I often do this kind of thing:

    if 'myvar' not in globals():
        myvar = ...
That way I can just execute the whole buffer instead of having to carefully be picky-choosy about what I send to the interpreter. It's especially helpful if the line involves loading a large file, calculating something that takes a while, or downloading something. Is there a better way to handle this in an interactive context? Like an automatic globals cache of some kind?

(Note, it's helpful to be able to dirty the variable when necessary by simply,

    del myvar

)



Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: