Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

print function does not show output on sublime text 3 console

I have started off with Python today and stuck with a weird problem. I am using Python 3.5.1 and Sublime text 3 and have written a basic hello world program.

print('Hello World')

Saved this file with the name python1.py and pressed Ctrl+B to execute it but the only thing that shows up on the console is [Finished in XYZs] which means that the program sucessfully executes but no output shown.

NOTE: I am using Windows 8(If that's important) and Python is installed properly and I can run my programs from CMD with no problems.

enter image description here

like image 739
Parag Kadam Avatar asked Jun 04 '16 04:06

Parag Kadam


People also ask

How do I get output in Sublime Text 3?

In order for taking input and receiving output from a code, we need to manually set up our input and output files. Step 1: From the top menu, select View->Layout->Columns :3 or press Shift+Alt+3. Step 2: Now select View->Groups->Max columns: 2. Step 3: Now you can view three files simultaneously in sublime text.

Why is my print function not working?

Do a hard reset on your printer. To do this you just need to turn off your printer, unplug for a few minutes and then plug the printer again. If that still doesn't work, try turning the printer and your computer off, and then start it back up again. Try uninstalling and then reinstalling your printer driver.

What is the output of the print () function call?

The print() function prints the specified message to the screen, or other standard output device. The message can be a string, or any other object, the object will be converted into a string before written to the screen.


3 Answers

Solved it,

Press Ctrl+Shift+B after which a list pops up, select python from that list and its done. From next time just pressing Ctrl+B will work.

'Ctrl+Shift+B' Means "Build this code and then RUN it" instead of simply compile it

like image 105
Parag Kadam Avatar answered Sep 22 '22 13:09

Parag Kadam


press Shift-Ctrl-B and select python. That happens because the program only checks if your python program is correctly. The next time just pressing Ctrl+B, will work

like image 30
Reinier Hernández Avatar answered Sep 19 '22 13:09

Reinier Hernández


  1. SHIFT-CTRL-B
  2. CTRL-B ( next time onwards)
like image 31
Bharath Avatar answered Sep 23 '22 13:09

Bharath