Skip to content
Advertisement

Output without “print()” in SublimeText

Is there a way/plug-in to enable output without “print()” in SublimeText?

For example,

a = 1 + 2
print (a)

Output:

3

Wanted:

a = 1 + 2
a

Output:

3

P.s. I also tried below:

enter image description here

enter image description here

Advertisement

Answer

I am pretty sure that the answer is no. You can rename the print function to make it less noticable like this:

_ = print

a = 2

_(a)

Output is 2

Alternatively:

As a few people mentioned in the comments, what you are likely looking for is a repl, which you can get by simply running python command directly in your terminal.

like this:

$ python

that should take you to an interactive environment that gives you real time results for the python code you input. Below is an example…

>>> a = 1 + 2
>>> a
3
>>> a + 25
28
>>> a
3
>>> a = a + 25
>>> a
28
User contributions licensed under: CC BY-SA
8 People found this is helpful
Advertisement