# Problems with Python console tab completion

**URL:** https://discourse.slicer.org/t/problems-with-python-console-tab-completion/25965
**Category:** Support
**Created:** [October 29, 2022, 5:05pm UTC](https://discourse.slicer.org/t/problems-with-python-console-tab-completion/25965 "2022-10-29T17:05:43Z")
**Posts on this page:** 4
**Page:** 1

<div class="post-metadata">

### Author: ![jamesobutler](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/jamesobutler/32/7511_2.png) [@jamesobutler](https://discourse.slicer.org/u/jamesobutler)
#### Post date: [October 29, 2022, 5:05pm UTC](https://discourse.slicer.org/t/problems-with-python-console-tab-completion/25965/1 "2022-10-29T17:05:44Z")

</div>

With recent python console changes I’m having difficulties using [TAB] to inspect available methods from the python console. I’m getting output upon pressing [TAB] which then breaks things up that I’m trying to type. It constantly prints out this error output when I type a new letter in the example below.

I’m using Slicer as of [COMP: Fix Qt dependencies for application update · Slicer/Slicer@9a56f64 · GitHub](https://github.com/Slicer/Slicer/commit/9a56f644406357394f42004133c6ee13ae7e3ad3).

 ![image](https://us1.discourse-cdn.com/flex002/uploads/slicer/original/3X/d/0/d0f5381ca741357baeeebd815f45e8b16cbccc10.png)

---

<div class="post-metadata">

### Author: ![lassoan](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/lassoan/32/13_2.png) [@lassoan](https://discourse.slicer.org/u/lassoan)
#### Post date: [October 29, 2022, 8:33pm UTC](https://discourse.slicer.org/t/problems-with-python-console-tab-completion/25965/2 "2022-10-29T20:33:45Z")

</div>

Auto-complete works by evaluating the expression. It has been always having side-effects but now that we display errors in the Python console, this side effect is more visible.

Maybe the simplest would be to suppress all outputs during these auto-completion evaluations. Please submit a Slicer issue and set its target to 5.2.

---

<div class="post-metadata">

### Author: ![jamesobutler](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/jamesobutler/32/7511_2.png) [@jamesobutler](https://discourse.slicer.org/u/jamesobutler)
#### Post date: [October 29, 2022, 9:10pm UTC](https://discourse.slicer.org/t/problems-with-python-console-tab-completion/25965/3 "2022-10-29T21:10:40Z")

</div>

> <https://github.com/Slicer/Slicer/issues/6630>
>
> \## Summary
> 
> As originally discussed in https://discourse.slicer.org/t/problems…-with-python-console-tab-completion/25965
> 
> \## Steps to reproduce
> 
> Use \`slicer.app.layoutManager().threeDWidget(index).\[TAB\]\` as shown in the video below:
> 
> https://user-images.githubusercontent.com/15837524/198852374-3f19cd0b-f310-48e3-b9bf-f08a4c2d1e4a.mp4
> 
> From @lassoan 
> 
> \> Maybe the simplest would be to suppress all outputs during these auto-completion evaluations. 
> 
> 
> \## Environment
> \- Slicer version: Slicer-5.1.0-2022-10-27
> \- Operating system: Windows

---

<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: [November 2, 2022, 3:13am UTC](https://discourse.slicer.org/t/problems-with-python-console-tab-completion/25965/4 "2022-11-02T03:13:08Z")

</div>

Following the integration of the [Slicer pull request #6638](https://github.com/Slicer/Slicer/pull/6638) integrating CTK changes from @lassoan and tested by @jamesobutler , the autocomplete behavior has been revisited:

| Before | After |
| --- | --- |
| ![image](https://user-images.githubusercontent.com/219043/199385422-d7917607-eec8-4416-90d2-71119d468fd7.png) | ![image](https://user-images.githubusercontent.com/219043/199386361-bfa23e84-706b-4692-8d85-2b53f5278e92.png) |
