# Is this a bug? (python "input" not working in 'Build' or '\>\>\> console')

**URL:** <https://forum.sublimetext.com/t/is-this-a-bug-python-input-not-working-in-build-or-console/25719>\
**Category:** Technical Support\
**Created:** [January 24, 2017, 10:03pm UTC](https://forum.sublimetext.com/t/is-this-a-bug-python-input-not-working-in-build-or-console/25719 "2017-01-24T22:03:06Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![reklamchef](https://forum.sublimetext.com/user_avatar/forum.sublimetext.com/reklamchef/32/63391_2.png) [@reklamchef](https://forum.sublimetext.com/u/reklamchef)\
**Post date:** [January 24, 2017, 10:03pm UTC](https://forum.sublimetext.com/t/is-this-a-bug-python-input-not-working-in-build-or-console/25719/1 "2017-01-24T22:03:07Z")

</div>

Maybe this is already known. this code doesn’t seem to run properly in the ‘build’ window

a = input('enter text: ')  
print(a)

I also tried it using the python boilerplate stuff. neither seems to work. and if I try executing the below  
code using the \>\>\> console…

> > > > a = input('enter text ')  
> > > > Traceback (most recent call last):  
> > > > File “”, line 1, in   
> > > > RuntimeError: input(): lost sys.stdin

maybe the “build” window where the program seems to execute does not behave like a terminal or?

at any rate, the \>\>\> python console in Sublime Text ought to work like any other Python \>\>\> console right?

---

<div class="post-metadata">

**Author:** ![reklamchef](https://forum.sublimetext.com/user_avatar/forum.sublimetext.com/reklamchef/32/63391_2.png) [@reklamchef](https://forum.sublimetext.com/u/reklamchef)\
**Post date:** [January 24, 2017, 10:05pm UTC](https://forum.sublimetext.com/t/is-this-a-bug-python-input-not-working-in-build-or-console/25719/2 "2017-01-24T22:05:01Z")

</div>

something in the html has chewed up my preformatted text

```
>>> a = input('enter text ')
Traceback (most recent call last):
  File "<string>", line 1, in <module>
RuntimeError: input(): lost sys.stdin
```

---

<div class="post-metadata">

**Author:** ![OdatNurd](https://forum.sublimetext.com/user_avatar/forum.sublimetext.com/odatnurd/32/77607_2.png) [@OdatNurd](https://forum.sublimetext.com/u/OdatNurd)\
**Post date:** [January 24, 2017, 10:08pm UTC](https://forum.sublimetext.com/t/is-this-a-bug-python-input-not-working-in-build-or-console/25719/3 "2017-01-24T22:08:51Z")

</div>

When you execute code in Sublime (either via a build system or interactively in the console), there is no way to capture input. More technically, the console is connected to `stdout` and `stderr` but not `stdin`. So it’s not possible to run an interactive program from within Sublime directly.

That said, apparently [SublimeREPL](https://packagecontrol.io/packages/SublimeREPL) provides this sort of functionality, although I don’t use it myself so I don’t know much about it.

---

<div class="post-metadata">

**Author:** ![reklamchef](https://forum.sublimetext.com/user_avatar/forum.sublimetext.com/reklamchef/32/63391_2.png) [@reklamchef](https://forum.sublimetext.com/u/reklamchef)\
**Post date:** [January 24, 2017, 10:15pm UTC](https://forum.sublimetext.com/t/is-this-a-bug-python-input-not-working-in-build-or-console/25719/4 "2017-01-24T22:15:18Z")

</div>

ok thanks hehe 🙂 i guess a shallow search would have found that out. i just didn’t see it coming since there’s a console that runs in sublime.
