segunda-feira, 27 de agosto de 2018

How to use Sublime Text Editor to Develop in Python


After installing Python and installing Sublime Text:

To use Sublime Text with Python, it is necessary to make some settings.
To configure Sublime to run Python, do the following steps:
1 - Open Sublime Text
2 - Go to the menu, Tools> Build System> New Build System
3 - Paste the following code:
{
    "cmd": ["/ home / machiavell / anaconda3 / bin / python27", "-u", "$ file"
    "file_regex": "^ [] * File \" (... *?) \ ", line ([0-9] *)",
    "selector": "source.python"
}
4 - In the following path: "/ home / machiavell / anaconda3 / bin / python27",
replace to the directory that is installed the Phyton executable
on your machine.

5 - Inside the installation folder of the sublime, has a sub folder called: Packages,
save the file inside this folder.

XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
In case of errors after this configuration, analyze the following errors:

'python' is not recognized as an internal command
or external, an operable program or a batch file.

If the above error appears, we will have to make an adjustment on the windows environment variables
and add the path of the Python installer folder to the PATH variable.

1 - Go to the control panel or systems and click , 
Advanced System Settings (Configurações avançadas do sistema)

2 - Under Properties, under the "Advanced" tab, click "Environment Variables"
3 - In the PATH variable, click on Edit and then open another window
4 - In this new window click on "New", and place the path of the executable from where Python is installed
5 - After this configuration, open the Sublime Text program and verify execute the following command: print ('Hello Word!')

0 comentários:

Postar um comentário

# Share