Author: tlinnet Date: Fri Feb 14 12:13:05 2014 New Revision: 22187 URL: http://svn.gna.org/viewcvs/relax?rev=22187&view=rev Log: Finished implementing the functionality of interacting with variables after executing a script. Fix for sr #3117, (https://gna.org/support/?3117) - Functionality to inspect interactively after running script - The equivalence to python -i For getting access to variables after executing a script, the variable should be saved under: cdp.X, where X define a container. The name space issue is discussed in: http://thread.gmane.org/gmane.science.nmr.relax.devel/5012 Modified: trunk/prompt/interpreter.py Modified: trunk/prompt/interpreter.py URL: http://svn.gna.org/viewcvs/relax/trunk/prompt/interpreter.py?rev=22187&r1=22186&r2=22187&view=diff ============================================================================== --- trunk/prompt/interpreter.py (original) +++ trunk/prompt/interpreter.py Fri Feb 14 12:13:05 2014 @@ -266,12 +266,17 @@ readline.parse_and_bind("tab: complete") # Execute the script file if given. - if script_file: + if script_file and not status.prompt: # Turn on the user function intro flag. status.uf_intro = True # Run the script. return run_script(intro=self.__intro_string, local=locals(), script_file=script_file, show_script=self.__show_script, raise_relax_error=self.__raise_relax_error) + + # Execute the script and go into prompt if the interactive flag -p --prompt is given at startup. + if script_file and status.prompt: + run_script(intro=self.__intro_string, local=locals(), script_file=script_file, show_script=self.__show_script, raise_relax_error=self.__raise_relax_error) + prompt(intro=None, local=locals()) # Go to the prompt. else: