# Questions about directly executing a Pluto notebook

**URL:** <https://discourse.julialang.org/t/questions-about-directly-executing-a-pluto-notebook/76302>\
**Category:** General Usage\
**Tags:** pluto\
**Created:** [February 12, 2022, 4:14pm UTC](https://discourse.julialang.org/t/questions-about-directly-executing-a-pluto-notebook/76302 "2022-02-12T16:14:13Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Mark\_Nahabedian](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/mark_nahabedian/32/16562_2.png) [@Mark\_Nahabedian](https://discourse.julialang.org/u/Mark_Nahabedian)\
**Post date:** [February 12, 2022, 4:14pm UTC](https://discourse.julialang.org/t/questions-about-directly-executing-a-pluto-notebook/76302/1 "2022-02-12T16:14:13Z")

</div>

I have several Pluto notebooks. Sometimes I want to execute them directly in Julia rather than through the Pluto server.

If the notebook uses the Pluto package manager, is there a single function I can call to run the notebook, or must I call Pluto.activate\_notebook\_environment first?

Also, is there a way to test whether the notebook is being run directly from Julia or through the Pluto server? For example, when running directly in Julia I want the output to go to a file.

Thanks.

---

<div class="post-metadata">

**Author:** ![rikh](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/rikh/32/204104_2.png) [@rikh](https://discourse.julialang.org/u/rikh)\
**Post date:** [February 13, 2022, 11:40am UTC](https://discourse.julialang.org/t/questions-about-directly-executing-a-pluto-notebook/76302/2 "2022-02-13T11:40:18Z")

</div>

> [@Mark\_Nahabedian](#):
>
> Also, is there a way to test whether the notebook is being run directly from Julia or through the Pluto server?

Yes. You can use `isdefined(Main, :PlutoRunner)`.

---

<div class="post-metadata">

**Author:** ![Mark\_Nahabedian](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/mark_nahabedian/32/16562_2.png) [@Mark\_Nahabedian](https://discourse.julialang.org/u/Mark_Nahabedian)\
**Post date:** [February 13, 2022, 8:11pm UTC](https://discourse.julialang.org/t/questions-about-directly-executing-a-pluto-notebook/76302/3 "2022-02-13T20:11:47Z")

</div>

> [@rikh](#):
>
> isdefined(Main, :PlutoRunner)

Excellent. That does the trick. Thanks.
