# Make PsychoPy output copiable?

**URL:** <https://discourse.psychopy.org/t/make-psychopy-output-copiable/5442>\
**Category:** Development\
**Created:** [October 1, 2018, 12:27pm UTC](https://discourse.psychopy.org/t/make-psychopy-output-copiable/5442 "2018-10-01T12:27:25Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![TorgeMS](https://avatars.discourse-cdn.com/v4/letter/t/e68b1a/32.png) [@TorgeMS](https://discourse.psychopy.org/u/TorgeMS)\
**Post date:** [October 1, 2018, 12:27pm UTC](https://discourse.psychopy.org/t/make-psychopy-output-copiable/5442/1 "2018-10-01T12:27:25Z")

</div>

Hi,

in this great and very helpful forum I’ve seen many topics in which error messages from the PsychoPy output windows were posted as screenshots. This is probably due to the fact that the output text is (as far as I know and in version 1.90.2) not easily copiable, neither by the missing Edit menu nor by using Ctrl+A / Ctrl+C etc.  
However, topics including error messages in text form would make them much easier to find for search engines.

Therefore, I was wondering if it would be possible to allow copying in the PsychoPy output window in future versions.

Best regards  
Torge

---

<div class="post-metadata">

**Author:** ![jon](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.psychopy.org/jon/32/22_2.png) [@jon](https://discourse.psychopy.org/u/jon)\
**Post date:** [October 1, 2018, 1:19pm UTC](https://discourse.psychopy.org/t/make-psychopy-output-copiable/5442/2 "2018-10-01T13:19:56Z")

</div>

It is already possible using right-click on the mouse, but you’re right that I think the current set up doesn’t handle Ctrl-C properly (due to confusion about what the current view is active?). Happy to take a pull request on this

---

<div class="post-metadata">

**Author:** ![TorgeMS](https://avatars.discourse-cdn.com/v4/letter/t/e68b1a/32.png) [@TorgeMS](https://discourse.psychopy.org/u/TorgeMS)\
**Post date:** [October 1, 2018, 1:27pm UTC](https://discourse.psychopy.org/t/make-psychopy-output-copiable/5442/3 "2018-10-01T13:27:56Z")

</div>

Thanks for your reply! I tried right-clicking, too, but on my setup (1.90.2 on Windows 7), it doesn’t have any effect. There is no menu and I can’t even mark the text. Is that a known issue?

---

<div class="post-metadata">

**Author:** ![jon](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.psychopy.org/jon/32/22_2.png) [@jon](https://discourse.psychopy.org/u/jon)\
**Post date:** [October 1, 2018, 1:43pm UTC](https://discourse.psychopy.org/t/make-psychopy-output-copiable/5442/4 "2018-10-01T13:43:37Z")

</div>

Oh, no I wasn’t aware of that. Is this the output window from Builder or in the botom of Coder?

---

<div class="post-metadata">

**Author:** ![TorgeMS](https://avatars.discourse-cdn.com/v4/letter/t/e68b1a/32.png) [@TorgeMS](https://discourse.psychopy.org/u/TorgeMS)\
**Post date:** [October 1, 2018, 1:45pm UTC](https://discourse.psychopy.org/t/make-psychopy-output-copiable/5442/5 "2018-10-01T13:45:45Z")

</div>

The Builder output. In the coder output, the right-click menu and all shortcuts work well.

---

<div class="post-metadata">

**Author:** ![jon](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.psychopy.org/jon/32/22_2.png) [@jon](https://discourse.psychopy.org/u/jon)\
**Post date:** [October 1, 2018, 1:47pm UTC](https://discourse.psychopy.org/t/make-psychopy-output-copiable/5442/6 "2018-10-01T13:47:43Z")

</div>

Ah, OK, I never noticed that. We could explore why it doesn’t work there and/or add a copy button to the dialog if it can’t be fixed

---

<div class="post-metadata">

**Author:** ![TorgeMS](https://avatars.discourse-cdn.com/v4/letter/t/e68b1a/32.png) [@TorgeMS](https://discourse.psychopy.org/u/TorgeMS)\
**Post date:** [October 1, 2018, 1:52pm UTC](https://discourse.psychopy.org/t/make-psychopy-output-copiable/5442/7 "2018-10-01T13:52:00Z")

</div>

That would be great. Let me know if you need any tests on my system.

Speaking about right-clicks in Builder: if a file has been selected in the conditions field of the loop property window, a right-click doesn’t have any effect either even though the tooltip says it’s supposed to preview the file contents.

---

<div class="post-metadata">

**Author:** ![Ryan\_Blything](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.psychopy.org/ryan_blything/32/4204_2.png) [@Ryan\_Blything](https://discourse.psychopy.org/u/Ryan_Blything)\
**Post date:** [November 21, 2019, 1:48pm UTC](https://discourse.psychopy.org/t/make-psychopy-output-copiable/5442/8 "2019-11-21T13:48:10Z")

</div>

I can copy the text from the output window of builder BUT only the text that is visible.  
For example, in this screenshot, I’ve highlighted/copied the text that is visible, but there is more hidden text (if I were to scroll upwards) that cannot be copied. Ideally, I could just click and drag so that I can highlight/copy text as I scroll upwards, but this is not possible. Enlarging the window doesn’t work either because it just gives you a larger grey border around the output (see screenshot). Any solutions?

 ![PsycOutput](https://us1.discourse-cdn.com/flex002/uploads/psychopy/original/3X/f/7/f7ca20d8854f93367ffb8b042128302a69d1aa4b.png)

---

<div class="post-metadata">

**Author:** ![dvbridges](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.psychopy.org/dvbridges/32/1918_2.png) [@dvbridges](https://discourse.psychopy.org/u/dvbridges)\
**Post date:** [November 25, 2019, 11:48am UTC](https://discourse.psychopy.org/t/make-psychopy-output-copiable/5442/9 "2019-11-25T11:48:39Z")

</div>

Hi @Ryan_Blything, one thing you could do is save the text being printed in an in-memory text stream using the python `io` module. E.g., in a code component, and relevant tabs:

```auto
# Begin Experiment
import io
output = io.StringIO()
output.write('Starting experiment...\n')
counter = 0

# Each Routine
# In your print statement, make your output stream the target for print
print('trial: {}'.format(counter), file=output)  
counter+=1 

# End Experiment
with open('outputTextFile.txt', 'w', encoding='utf8') as f:
    f.write(output.getvalue())

output.close()

```
