On 19 September 2013 14:21, Jason Grout <jason-s...@creativetrax.com> wrote:
> On 9/19/13 8:11 AM, John Cremona wrote:
>>
>> In IPython's %load does the whole file contents really go into the one
>> next prompt?  Or do you get the file one line at a time?  That would
>> be a useful option for demos.
>
>
> In IPython, you get the whole file contents, but it will ask you if the file
> is over 200k characters (see
> https://github.com/ipython/ipython/blob/master/IPython/core/magics/code.py#L167
> for docstring and code).  You can also apparently now load URLs or a history
> range too.
>
> That's an interesting idea to use for demos.  For the sake of discussion,
> let's call the one-line version %demo.  How would that work?  You execute
> %demo filename and get the first line in the next input, and then you
> execute %demo filename again and it remembers where it is and pulls the next
> line into the next input area?
>

If you have Magma, what I am thinking about is there called iload and
used like load.

You type
 load "myfile.py"
(or %load "myfile.py") and the first line of the file appears after a
prompt with the cursor at the end, then you hit Return and that line
is executed, followed by a new prompt with the second line in it.
etc.  You only type load and the filename once.

I googled for something like this in ipython and it seems that it can
be hacked but is not provided.

Of course, for demos one would actually use a notebook anyway, so it
is probably not worth taking time on.

John
>
> Thanks,
>
> Jason
>
>
> --
> You received this message because you are subscribed to the Google Groups
> "sage-devel" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to sage-devel+unsubscr...@googlegroups.com.
> To post to this group, send email to sage-devel@googlegroups.com.
> Visit this group at http://groups.google.com/group/sage-devel.
> For more options, visit https://groups.google.com/groups/opt_out.

-- 
You received this message because you are subscribed to the Google Groups 
"sage-devel" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sage-devel+unsubscr...@googlegroups.com.
To post to this group, send email to sage-devel@googlegroups.com.
Visit this group at http://groups.google.com/group/sage-devel.
For more options, visit https://groups.google.com/groups/opt_out.

Reply via email to