# Subprocess call in Python interpreter results in memory corruption

**URL:** https://discourse.slicer.org/t/subprocess-call-in-python-interpreter-results-in-memory-corruption/919
**Category:** Support
**Tags:** python
**Created:** [August 22, 2017, 1:03pm UTC](https://discourse.slicer.org/t/subprocess-call-in-python-interpreter-results-in-memory-corruption/919 "2017-08-22T13:03:10Z")
**Posts on this page:** 1
**Showing post:** 11

<div class="post-metadata">

### Author: ![jcfr](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/jcfr/32/17825_2.png) [@jcfr](https://discourse.slicer.org/u/jcfr)
#### Post date: [September 4, 2017, 9:08pm UTC](https://discourse.slicer.org/t/subprocess-call-in-python-interpreter-results-in-memory-corruption/919/11 "2017-09-04T21:08:59Z")

</div>

Then, as soon as we are done implementing a more general solution, you would be able to do:

```python
from subprocess import check_output
check_output(
    ["/path/to/program", "arg1", ...],
    env=slicer.util.startupEnvironment())

```

similarly, it will be possible to start CLI excluding the slicer environment. (edit: This last part is **NOT** yet implemented.)

---

_[View the full topic](https://discourse.slicer.org/t/subprocess-call-in-python-interpreter-results-in-memory-corruption/919)._
