[IPython-dev] What's the easiest way to open an IPython Notebook server in a particular directory on Windows?
Mon Feb 24 14:04:47 CST 2014
I had this exact problem. I found two solutions that I liked:
Use batch file scripts! A batch file is, after all, just a terminal command
that you run by double clicking it. My co-workers liked this method a lot
better than opening a new command prompt, navigating to where they wanted
to work, and then running the ipython notebook command.
To make a batch file script that opens an ipython notebook in whatever
directory it's run from:
1. Create a simple .txt file: Right Click -> New -> Text Document
2. Re-name it "Start IPython Notebook Here.bat" (don't forget to change the
3. Open it with notepad: Right Click on it -> Edit
4. Add the text "ipython notebook" to the file -- it should look just like
you would type it in a command prompt.
5. Save & close.
Now when you double click on the .bat file, a notebook server will spawn in
that directory. You can move the .bat file to wherever you want your
IPython notebook's working directory to be. You can make copies of the .bat
file, and stash one in all the directories you frequently use. You can give
a copy of the file to people that you're training, and they can just
double-click and go. No need to teach them the command prompt.
I work with the IPython notebooks daily in different directories all over
my filesystem, so I got tired of copying the .bat script to every directory
I worked in. I added an option to start a notebook in a directory to my
right-click context menu by adding a few registry keys.
This option is good for anyone who uses IPython frequently, doesn't mind an
extra option in their right-click menu, and is comfortable editing their
You should be able to create a text document, copy in the text above,
change the extension to .reg, and then run it(just once) to add the context
menu entry. Put the following 5 lines in the file:
Windows Registry Editor Version 5.00
@="Open IPython Notebook"
Once the registry key has been added, whenever you right-click in a folder
(or on your desktop) you'll have the option to "Open IPython Notebook".
Selecting that option will spawn a powershell instance, and call "ipython
notebook" as if you'd typed it on the command line -- just like the batch
file method, but without the extra file in the directory.
Note: if you ever want to remove the registry keys, you'll have to open up
regedit.exe and delete them manually. Some users might become frustrated
with the extra option if they rarely use the notebook, and they might have
trouble getting rid of it, so I wouldn't offer this option unless you know
they will use it all the time.
Another Note: Neither of these methods starts the notebook with the
"--pylab inline" flag. You can get similar functionality with the "%pylab"
or "%matplotlib inline" magics.
Let me know if you have any questions. I'll do what I can to answer.
On Sun, Feb 23, 2014 at 3:09 PM, Jason Moore <firstname.lastname@example.org> wrote:
> Thanks, I already have asked the Anaconda mailing list too. Just haven't
> gotten a response yet.
> Maybe I should just include the Windows shortcut in the directory full of
> notebooks. That would work.
> +01 530-601-9791
> On Sun, Feb 23, 2014 at 6:06 PM, Aron Ahmadia <email@example.com> wrote:
>> It might be better to direct this question to the Anaconda mailing list
>> You could distribute a shortcut for them that does the right thing when
>> you're packaging your repository. If you come up with something better or
>> that works for you, please add it to the Software Carpentry "configuration
>> problems" Wiki
>> Right now Software Carpentry instructors usually get around this by
>> teaching the command line *before* Git :)
>> On Sun, Feb 23, 2014 at 6:00 PM, Jason Moore <firstname.lastname@example.org>wrote:
>>> The IPython Notebook shortcut installed by Anaconda defaults to
>>> opening in the "IPython Notebooks" directory. Is there an easier (point and
>>> click?) method to opening the server in another directory besides (1) open
>>> a CMD prompt and cd'ing to the directory or (2) changing the "start in"
>>> properties of the shortcut?
>>> I'm giving a tutorial to command line novices and was hoping for
>>> something very simple for them to open up the notebook server in the
>>> correct directory.
>>> +01 530-601-9791
>>> IPython-dev mailing list
>> IPython-dev mailing list
> IPython-dev mailing list
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the IPython-dev