[Tutor] garbage collecting
Mark Lawrence
breamoreboy at yahoo.co.uk
Wed Jan 8 11:50:42 CET 2014
On 08/01/2014 10:41, Alan Gauld wrote:
> On 08/01/14 08:15, Mark Lawrence wrote:
Did I? :)
>
>>> I just saw where I could do os.system('python'), but in restarting the
>>> interpreter I'd lose everything currently loaded: my real question
>>> involves merely pushing the garbage collector into action, I think.
>
> Don't do that!
> You are not restarting the interpreter you are starting a brand new
> interpreter *in addition* to the one that's already running. Now you
> have even less resources to play with. It will make things worse not
> better.
>
> os.system() is really for running shell commands that hopefully don't
> take long, do a job that doesn't need any input and produces output that
> you don't need to process(or a file that you can). Printing
> a file, converting a file with lame of ffmpeg, say, that kind of thing.
> It's actually deprecated now anyway and the subprocess module is preferred.
>
--
My fellow Pythonistas, ask not what our language can do for you, ask
what you can do for our language.
Mark Lawrence
More information about the Tutor
mailing list