a little help

Andres Soto soto_andres at yahoo.com
Wed Jan 4 19:29:42 EST 2012


my mistake is because I have no problem to do that using Prolog which use an interpreter as Python. I thought that the variables in the main global memory space (associated with the command line environment) were kept, although the code that use it could change.
As you explain me, Python behave like a compiled language: any time I make a change in the code, I have to "compile" it again, and re-run (and re-load the data). There is nothing to do.
Thank you!
Regards
 
Prof. Dr. Andrés Soto
DES DACI
UNACAR



>________________________________
> From: Chris Angelico <rosuav at gmail.com>
>To: python-list at python.org 
>Sent: Wednesday, January 4, 2012 6:02 PM
>Subject: Re: a little help
> 
>I think you meant to send that to the list; hope you don't mind my
>replying on-list.
>
>On Thu, Jan 5, 2012 at 10:56 AM, Andres Soto <soto_andres at yahoo.com> wrote:
>> the problem is that if I re-run the program, every time I change some
>> instructions, I have to read (load) again the data and that is what I want
>> to avoid. Is it possible?
>
>That's normal with Python, yes. Usually you'll find that it's more
>hassle than it's worth to try to modify code "live" like that; even in
>languages specifically designed with this feature in mind, there's a
>lot to keep track of.
>
>It may be worth writing your program to take a "snapshot" of current
>state (eg with the pickle module); this might be easier than
>re-parsing a complicated input data set. But that can be a lot of
>bother too, and usually in the end it's just not worthwhile.
>
>ChrisA
>-- 
>http://mail.python.org/mailman/listinfo/python-list
>
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-list/attachments/20120104/ce5491cb/attachment-0001.html>


More information about the Python-list mailing list