# "Close Scene" in python

**URL:** <https://discourse.slicer.org/t/close-scene-in-python/1664>\
**Category:** Support\
**Created:** [December 15, 2017, 9:23am UTC](https://discourse.slicer.org/t/close-scene-in-python/1664 "2017-12-15T09:23:16Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Frederic](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/frederic/32/4907_2.png) [@Frederic](https://discourse.slicer.org/u/Frederic)\
**Post date:** [December 15, 2017, 9:23am UTC](https://discourse.slicer.org/t/close-scene-in-python/1664/1 "2017-12-15T09:23:16Z")

</div>

Hi,  
before it was: “Slicer.slicer.ApplicationGUI.ProcessCloseSceneCommand()”, but what is the command line now?  
Thanks in advance.

---

<div class="post-metadata">

**Author:** ![cpinter](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/cpinter/32/7995_2.png) [@cpinter](https://discourse.slicer.org/u/cpinter)\
**Post date:** [December 15, 2017, 2:52pm UTC](https://discourse.slicer.org/t/close-scene-in-python/1664/2 "2017-12-15T14:52:12Z")

</div>

The way you programmatically closed the scene is a fragile call to a handler function. This is the proper way to close the scene:

```
slicer.mrmlScene.Clear(0)
```

---

<div class="post-metadata">

**Author:** ![Frederic](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/frederic/32/4907_2.png) [@Frederic](https://discourse.slicer.org/u/Frederic)\
**Post date:** [December 15, 2017, 3:16pm UTC](https://discourse.slicer.org/t/close-scene-in-python/1664/3 "2017-12-15T15:16:49Z")

</div>

Thanks a lot Csaba!  
Best
