<html><body><div style="color:#000; background-color:#fff; font-family:arial, helvetica, sans-serif;font-size:10pt"><div><span>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.</span></div><div><span>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.</span></div><div><span>Thank you!</span></div><div><span>Regards</span></div><div> </div><div>Prof. Dr. Andrés Soto</div><div>DES DACI</div><div>UNACAR</div><div><br><blockquote style="border-left: 2px solid rgb(16, 16, 255); margin-left: 5px; margin-top: 5px; padding-left: 5px;"> <div style="font-size: 10pt; font-family: arial, helvetica, sans-serif; ">
<div style="font-size: 12pt; font-family: 'times new roman', 'new york', times, serif; "> <font size="2" face="Arial"> <hr size="1"> <b><span style="font-weight:bold;">From:</span></b> Chris Angelico <rosuav@gmail.com><br> <b><span style="font-weight: bold;">To:</span></b> python-list@python.org <br> <b><span style="font-weight: bold;">Sent:</span></b> Wednesday, January 4, 2012 6:02 PM<br> <b><span style="font-weight: bold;">Subject:</span></b> Re: a little help<br> </font> <br>
I think you meant to send that to the list; hope you don't mind my<br>replying on-list.<br><br>On Thu, Jan 5, 2012 at 10:56 AM, Andres Soto <<a ymailto="mailto:soto_andres@yahoo.com" href="mailto:soto_andres@yahoo.com">soto_andres@yahoo.com</a>> wrote:<br>> the problem is that if I re-run the program, every time I change some<br>> instructions, I have to read (load) again the data and that is what I want<br>> to avoid. Is it possible?<br><br>That's normal with Python, yes. Usually you'll find that it's more<br>hassle than it's worth to try to modify code "live" like that; even in<br>languages specifically designed with this feature in mind, there's a<br>lot to keep track of.<br><br>It may be worth writing your program to take a "snapshot" of current<br>state (eg with the pickle module); this might be easier than<br>re-parsing a complicated input data set. But that can be a lot of<br>bother too, and usually in the end it's just not
worthwhile.<br><br>ChrisA<br>-- <br>http://mail.python.org/mailman/listinfo/python-list<br><br><br> </div> </div> </blockquote></div> </div></body></html>