# Run through python script.

**URL:** <https://support.prodi.gy/t/run-through-python-script/339>\
**Category:** Uncategorized\
**Tags:** usage, solved\
**Created:** [February 25, 2018, 2:58pm UTC](https://support.prodi.gy/t/run-through-python-script/339 "2018-02-25T14:58:06Z")\
**Posts on this page:** 1\
**Showing post:** 12

<div class="post-metadata">

**Author:** ![ines](https://sea2.discourse-cdn.com/flex020/user_avatar/support.prodi.gy/ines/32/3_2.png) [@ines](https://support.prodi.gy/u/ines)\
**Post date:** [October 5, 2018, 9:24am UTC](https://support.prodi.gy/t/run-through-python-script/339/12 "2018-10-05T09:24:08Z")

</div>

By “the rest of the script”, you mean other code placed after `prodigy.serve`? You could probably catch `KeyboardInterrupt`, then execute your other logic and then [terminate the process manually](https://support.prodi.gy/t/alternative-exit-to-quit-in-terminal/569). Or you could just write your own logic that serves the app and includes hooks for starting and stopping – if you look at the `app.py`, you’ll see that it’s really pretty straightforward and doesn’t need a lot of code.

---

_[View the full topic](https://support.prodi.gy/t/run-through-python-script/339)._
