Sublime Forum

Sublime Input Help

#1

I want to write Python programs in Sublime but need to be able to utilize the input() command which doesn’t seem possible with base Sublime.

I read this: Build broken? - Python 3 - input()
which led me to try to learn how to use Terminus to accept user inputs.

I am trying to make a new build system that uses Terminus to do this.
The text I have written in my build system is:

{
“target”: “terminus_open”,
“cmd”: [“python”, “-u”, “$file”],
“auto_close”: false,

“selector”: “source.python3”,
}

but the majority of it gets highlighted in red and when I save and use it, nothing happens.
Can anyone help me out?

I fear it might have something to do with my Python being installed on an external hard drive, so I normally have to specify the path to it, but I don’t know where to put that in this text because I don’t really understand how the whole build system thing works (despite watching tutorials)

Thanks

0 Likes

Sublime not executing my py files
#2

Your quotes are not normal double quotes. (don’t know what to call it :man_shrugging:)

0 Likes

#3

Ok so I fixed my quotes and now when I use the build system an empty command prompt comes up. Is there any way to make it so that this command prompt can display and take inputs from my code?
My build system is now: (the quotes are fixed even if it doesn’t seem like it aha)

{
“target”: “terminus_open”,
“cmd”: [“python”, “-u”, “$file”],
“auto_close”: false,

“selector”: “source.python3”,
}

0 Likes

#4

Well, your build system is at least working on my end (not withstanding those “quotes”). Maybe you defined your input as input() without any string to indicate what is it you want to input (hence the empty command prompt with a single blinking cursor) ? Try input("Enter a name: ") or something along those lines and see if that’s what you want.
Here’s what I have tried: (same as yours but the selector should be source.python)

{
	"target": "terminus_open",
	"cmd": ["python", "-u", "${file}"],
	"auto_close": false,
	"selector": "source.python",
}
0 Likes