How to run Python in Sublime Text 3 on Windows

preview_player
Показать описание
In this tutorial we're going to show you how to run python in sublime text 3 on windows.
Рекомендации по теме
Комментарии
Автор

In case this makes anyone's life easier :
"cmd": ["python", "-u", "$file"],
"file_regex": "^[ ]*File \"(...*?)\", line ([0-9]*)",
"selector": "source.python"

MsRhea
Автор

To save everyone time... just choose Tools > Build System > Python. Rename py.exe to python.exe in program folder. Then CTRL-B.

TheRedProject
Автор

Can’t find ‘__main__’ module in ” – Python (Sublime Text 3)

This is the easiest one, don’t panic. I think you forgot to save your file first. Just save your Python script with .py extension and run it again. It should work this time.

Gibbiceps
Автор

how do i do it with anaconda3 ? i have added python.exe in anaconda3 folder as built new system but it did not work :/

username
Автор

Great stuff! It helped me a lot! And I have been searching for a solution for more than a week!

Mauriloborges
Автор

where do you get the code snippet that you pasted

kristiankieffer
Автор

Where did you get that code snippet that you pasted

sushmavemparala
Автор

when i run a code print ('hello') and click ctrl+b its tell me [Finished in 0.1s] just this without hello

ibandr
Автор

Thanks, bro... Finally, something worked.

HarshCreatives
Автор

This only works on programs that don't need inputs, when I try to run programs that take inputs from the user it doesn't work.

thetruereality
Автор

Thank you so much, you video along with rhea dheer03 comment finally made it work after 2 hours of trying T.T

Ashanti
Автор

I had same issue of ''can't find main module'' and I realised it was not stated in the video (always state the obvious) that first we should OPEN our ''Hello World'' IDLE file with Sublime text 3, then save the python codes with .py extension and choose to open them with Sublime Text 3. Hope this works for ya folks

TheElean
Автор

Guys I need help. It shows me this message at the bottom:


'python' is not recognized as an internal or external command,
operable program or batch file.
[Finished in 0.1s]

I don't know what should I do because I have python installed and still!!. Any help!

thokozanisitwayo
Автор

The first method worked for me, but running it is a problem.
It says:

raoulkhaleb
Автор

Thanks a lot bro worked instantly .. awesome bro keep it up

_panchisaudmohammadhusai
Автор

Thank you for sharing your idea to us.. speacialy the short key ctrl+b to run a python file..

abedelbesacruz
Автор

after saving the command
"cmd": ["python", "-u", "$file"],
"file_regex": "^[ ]*File \"(...*?)\", line ([0-9]*)",
"selector": "source.python"


I still cannot see output. Only run time is showing [Finished in 0.4s]. Please help.

maimomjhanshirani
Автор

I'm entering in everything correctly but my output will only show the seconds I complete it will not show hello world. Why is that?

trae_brown
Автор

make sure you save your file (as a .py or a python file) before you try running any code after selecting your programming language a python.

cipher
Автор

useful. would be better if you can put the lines on the site for people to copy

ZZ-tweh