[IPython-dev] what goes wrong with %%file

Greg Wilson gvwilson at third-bit.com
Sun May 12 17:56:19 EDT 2013


On 2013-05-12 5:33 PM, Fernando Perez wrote:
> Mmh,  %%overwrite... I didn't like it too much when I first saw it,
> but it's growing on me, and it has the advantage of being unambiguous
> about the destructive nature of the action.
>
Could we do a simple usability test in the spirit of 
http://mail.python.org/pipermail/python-dev/2000-July/006427.html and 
http://mail.python.org/pipermail/python-dev/2000-July/006098.html to 
find out what users would expect each alternative to do? I've included a 
very rough first cut below (which looks better with a monospaced font :-)
Thanks,
Greg

--------------------

You have a directory called 'data' that contains two files:

* 'fish.csv' contains 160 lines of observations in comma-separated
   values format.
* 'site.txt' contains 20 lines of text describing the site where you
   collected data (in plain English).
* 'weather.txt' contains half a dozen lines of text about the weather
   during your site visit.

You run the IPython Notebook in that directory and do the operations
described below.  What does the Notebook display when each cell
command is run (in the order shown, with all of the cell content typed
in before the cell is run), and what changes does it make inside the
'data' directory and/or the files it contains when each cell is run?

1. +----------------------------------------+
    |%%load fish.csv                         |
    +----------------------------------------+

2. +----------------------------------------+
    |%%display fish.csv                      |
    +----------------------------------------+

3. +----------------------------------------+
    |%%file site.txt                         |
    +----------------------------------------+

4. +----------------------------------------+
    |%%file weather.txt                      |
    |Generally sunny, but on the last day    |
    |we had torrential rain followed by a    |
    |meteorite shower.                       |
    +----------------------------------------+

5. +----------------------------------------+
    |%%overwrite site.txt                    |
    +----------------------------------------+

6. +----------------------------------------+
    |%%overwrite site.txt                    |
    |Typical riverbank site, some signs of   |
    |recent erosion due to road-building,    |
    |plus traces of metallic iridium left    |
    |behind by the mothership.               |
    +----------------------------------------+




More information about the IPython-dev mailing list