# Send output of show to file

**URL:** <https://discourse.julialang.org/t/send-output-of-show-to-file/37287>\
**Category:** General Usage\
**Created:** [April 9, 2020, 4:37pm UTC](https://discourse.julialang.org/t/send-output-of-show-to-file/37287 "2020-04-09T16:37:44Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![harven](https://avatars.discourse-cdn.com/v4/letter/h/3da27b/32.png) [@harven](https://discourse.julialang.org/u/harven)\
**Post date:** [April 9, 2020, 4:37pm UTC](https://discourse.julialang.org/t/send-output-of-show-to-file/37287/1 "2020-04-09T16:37:44Z")

</div>

How do I send the output of show to a file? I tried the following with several mime types without success.

```
julia> open("file.jl", "w") do io
            show(io, MIME"plain/text", [[1,2],[3,4]])
         end

```

---

<div class="post-metadata">

**Author:** ![Vasily\_Pisarev](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/vasily_pisarev/32/7929_2.png) [@Vasily\_Pisarev](https://discourse.julialang.org/u/Vasily_Pisarev)\
**Post date:** [April 9, 2020, 10:59pm UTC](https://discourse.julialang.org/t/send-output-of-show-to-file/37287/2 "2020-04-09T22:59:41Z")

</div>

The second argument of `show` must be of type `MIME`, while `MIME"type"` returns the `MIME{Symbol("type")}` type (not an instance of that type). To have an instance of `MIME`, call either `MIME("type")` or `MIME"type"()`:

```julia
show(io, MIME("text/plain"), [[1,2],[3,4]])

```

(also, not “plain/text”).
