How to compile Python code in Sublime Text 3 running on Linux operating system? [closed]

1

I'm editing the question to better explain what my question was.

I'm a linux user and I'm starting web projects in Python. So I made use of the text editor, Sublime text 3, but it has a problem to execute code in Python, getting paralyzed or just compiling the first part of the code.

I believe this problem has happened to many users, so I ask the question:

How to run or compile Python code in Sublime Text 3?

But the question was still confusing, since I wanted to emulate the Python code on the console that exists within Sublime

.

However, I did not succeed until I did some foreign site searches and really understood that this is a failure of the editor that presents itself in different ways, be it in Windows, Linux or MacOS.

    
asked by anonymous 17.08.2017 / 02:10

2 answers

0

After a few hours of intense searching, I discovered one and more ways to solve this problem. Although it was not the solution that he preferred, but he solved the problem and added new features. Follow the youtube link:

"Sublime Text 3 for python developers" 1

"Configuring Terminal python in sublime text 3" 2

Good luck to those who need it!

    
17.08.2017 / 16:19
0

You need to indicate the location of your Python for Sublime Text 3, since Sublime Text is an editor and does not have the strength to compile or interpret programs.

Go to the Sublime Text menu and perform the following steps:

Tools<Build System<New Build System

You will open an edit space within your Sublime Text 3, then paste the following code:

{
    "cmd": ["/home/maquiavel/anaconda3/bin/python27", "-u", "$file"],
    "file_regex": "^[ ]*File \"(...*?)\", line ([0-9]*)",
    "selector": "source.python"
}

Then save as the name you want - this name will appear in your build system .

This part /home/maquiavel/anaconda3/bin/python3 varies from user to user, if you are using Windows it may be C:\python27\python.exe

Getting:

{
        "cmd": ["C:\python27\python.exe", "-u", "$file"],
        "file_regex": "^[ ]*File \"(...*?)\", line ([0-9]*)",
        "selector": "source.python"
    }

So, find the directory of your python and paste the path inside cmd

    
18.08.2017 / 17:25