# Running experiments sequentially

**URL:** <https://discourse.psychopy.org/t/running-experiments-sequentially/8413>\
**Category:** Coding\
**Created:** [July 9, 2019, 10:46am UTC](https://discourse.psychopy.org/t/running-experiments-sequentially/8413 "2019-07-09T10:46:34Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![Kaveh\_Heshmati](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.psychopy.org/kaveh_heshmati/32/5333_2.png) [@Kaveh\_Heshmati](https://discourse.psychopy.org/u/Kaveh_Heshmati)\
**Post date:** [July 9, 2019, 10:46am UTC](https://discourse.psychopy.org/t/running-experiments-sequentially/8413/1 "2019-07-09T10:46:34Z")

</div>

Hi Everyone,  
I am the new user of PsychoPy and I will use it to run cognitive tests. I want to put experiments in a row and run them sequentially.  
Do you know how can I do that?

Thanks

---

<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:** [July 9, 2019, 10:55am UTC](https://discourse.psychopy.org/t/running-experiments-sequentially/8413/2 "2019-07-09T10:55:05Z")

</div>

Hi @Kaveh_Heshmati, see the link below for two methods to do this. One involves merging your two experiments into one, the other involves running your two experiments from a .bat file (Windows).

> [@Merging two experiments](https://discourse.psychopy.org/t/merging-two-experiments/6489/4):
>
> Sure, you could do this, where you have two separate loops, one for each experiment, separated by a rest routine, so participants have a chance to rest. Each experiment could use its own routines, or can share them if they follow the same pattern. Alternatively, you could use a batch file (in Windows) where you would run the batch file to load the experiment Python scripts consecutively, such that when one closes, the other one opens. To do this, open a notepad file, enter the following command…

---

<div class="post-metadata">

**Author:** ![Kaveh\_Heshmati](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.psychopy.org/kaveh_heshmati/32/5333_2.png) [@Kaveh\_Heshmati](https://discourse.psychopy.org/u/Kaveh_Heshmati)\
**Post date:** [July 9, 2019, 11:07am UTC](https://discourse.psychopy.org/t/running-experiments-sequentially/8413/3 "2019-07-09T11:07:15Z")

</div>

Thank you very much.  
Much appreciated.

---

<div class="post-metadata">

**Author:** ![Kaveh\_Heshmati](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.psychopy.org/kaveh_heshmati/32/5333_2.png) [@Kaveh\_Heshmati](https://discourse.psychopy.org/u/Kaveh_Heshmati)\
**Post date:** [July 9, 2019, 1:45pm UTC](https://discourse.psychopy.org/t/running-experiments-sequentially/8413/4 "2019-07-09T13:45:09Z")

</div>

Hi @dvbridges  
I tried to use batch file, but It was unsuccessful. I created the batch file,opened Python files of both experiments (.py) and double clicked on the batch file afterwards which is saved on the same folder of experiments.  
I will be really thankful if you tell me what should I do next?

Many thanks

---

<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:** [July 9, 2019, 1:51pm UTC](https://discourse.psychopy.org/t/running-experiments-sequentially/8413/5 "2019-07-09T13:51:59Z")

</div>

Would you mind sharing the bat file?

---

<div class="post-metadata">

**Author:** ![Kaveh\_Heshmati](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.psychopy.org/kaveh_heshmati/32/5333_2.png) [@Kaveh\_Heshmati](https://discourse.psychopy.org/u/Kaveh_Heshmati)\
**Post date:** [July 9, 2019, 2:23pm UTC](https://discourse.psychopy.org/t/running-experiments-sequentially/8413/6 "2019-07-09T14:23:59Z")

</div>

Hi @dvbridges  
I solved the problem. Actually, I did not write the file path correctly.

Thanks a lot again.

---

<div class="post-metadata">

**Author:** ![Roma\_Siugzdaite](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.psychopy.org/roma_siugzdaite/32/39822_2.png) [@Roma\_Siugzdaite](https://discourse.psychopy.org/u/Roma_Siugzdaite)\
**Post date:** [October 30, 2023, 10:29am UTC](https://discourse.psychopy.org/t/running-experiments-sequentially/8413/7 "2023-10-30T10:29:29Z")

</div>

could you share the .bat file, please?

and how to save results into two separate files in this case, in case it crashes after the first one?
