I added this to my startup script:

if os.environ.get('ATOM_FILE'):
    sys.path.insert(0, os.path.dirname(os.environ['ATOM_FILE']))
    module_name = os.path.splitext(os.path.basename(os.environ['ATOM_
FILE']))[0]
    atom_module = __import__(module_name)

So far it seems to work. Thank you very much.

On 29 August 2017 at 23:21, Thomas Kluyver <[email protected]> wrote:

> I think the simplest way to do this would be to write an IPython startup
> script:
> http://ipython.readthedocs.io/en/stable/interactive/tutorial
> .html#startup-files
>
> IPython is the kernel Jupyter uses to run Python code. Make the script
> check for an environment variable, and if it is set, run the file it points
> to. Then configure Atom to run a command like:
>
> MY_FILE_TO_RUN=foo.py jupyter qtconsole
>
> --
> You received this message because you are subscribed to a topic in the
> Google Groups "Project Jupyter" group.
> To unsubscribe from this topic, visit https://groups.google.com/d/to
> pic/jupyter/rnVwI2m63cw/unsubscribe.
> To unsubscribe from this group and all its topics, send an email to
> [email protected].
> To post to this group, send email to [email protected].
> To view this discussion on the web visit https://groups.google.com/d/ms
> gid/jupyter/CAOvn4qh17D%3DR9Nb5sA16%2BYa4UXjK6w_MTpkOiD1iAFG
> dHL1erw%40mail.gmail.com
> <https://groups.google.com/d/msgid/jupyter/CAOvn4qh17D%3DR9Nb5sA16%2BYa4UXjK6w_MTpkOiD1iAFGdHL1erw%40mail.gmail.com?utm_medium=email&utm_source=footer>
> .
>
> For more options, visit https://groups.google.com/d/optout.
>

-- 
You received this message because you are subscribed to the Google Groups 
"Project Jupyter" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/jupyter/CAJW3ry6RoCUsLvyH8Z8qpDMG403z6LOHJc4Xgbom_auv1mQkyA%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to