Foro de elhacker.net

Programación => Programación General => Mensaje iniciado por: HBN en 7 Septiembre 2017, 23:37 pm



Título: como instalar python 3 en sublime text 3,Linux Debian
Publicado por: HBN en 7 Septiembre 2017, 23:37 pm
Hola amigos,bueno queria decirles como instalar el python 3 en sublime text,si tienen linux,a mi me costo  bastante instalarlo,por ello queria compartirlo ya que todos los foros de este tema los encontre en ingles:


Como instalar python 3 en sublime text

1 instalar sublime text y python 3
2 instalar sublimeREPL:
ir a tools y luego a SNIPPETS
despues escribir install package
instalar sublimeREPL
3 ir a tools,build system,new build system
4 copiar el siguiente codigo :
Código:
 { "cmd": ["python3", "-i", "-u", "$file"], "file_regex": "^[ ]File \"(...?)\", line ([0-9]*)", "selector": "source.python" } </code>
5 guarda el archivo,pueden ponerle por ejemplo python3.sublime-build
6 van a file,open file y buscan el siguiente directorio:

root/.config/sublime-text-3/packages/sublimeREPL/config/python/Main.sublime-menu
7 ahora deben hacer algunos cambios aqui les dejo el codigo completo:

Código:
[
     {
        "id": "tools",
        "children":
        [{
            "caption": "SublimeREPL",
            "mnemonic": "r",
            "id": "SublimeREPL",
            "children":
            [
                {"caption": "Python",
                "id": "Python",
 
                 "children":[
                    {"command": "repl_open",
                     "caption": "Python",
                     "id": "repl_python",
                     "mnemonic": "p",
                     "args": {
                        "type": "subprocess",
                        "encoding": "utf8",
                        "cmd": ["python3", "-i", "-u"],
                        "cwd": "$file_path",
                        "syntax": "Packages/Python/Python.tmLanguage",
                        "external_id": "python",
                        "extend_env": {"PYTHONIOENCODING": "utf-8"}
                        }
                    },
                    {"command": "python_virtualenv_repl",
                     "id": "python_virtualenv_repl",
                     "caption": "Python - virtualenv"},
                    {"command": "repl_open",
                     "caption": "Python - PDB current file",
                     "id": "repl_python_pdb",
                     "mnemonic": "d",
                     "args": {
                        "type": "subprocess",
                        "encoding": "utf8",
                        "cmd": ["python3", "-i", "-u", "-m", "pdb", "$file_basename"],
                        "cwd": "$file_path",
                        "syntax": "Packages/Python/Python.tmLanguage",
                        "external_id": "python",
                        "extend_env": {"PYTHONIOENCODING": "utf-8"}
                        }
                    },
                    {"command": "repl_open",
                     "caption": "Python - RUN current file",
                     "id": "repl_python_run",
                     "mnemonic": "d",
                     "args": {
                        "type": "subprocess",
                        "encoding": "utf8",
                        "cmd": ["python3", "-u", "$file_basename"],
                        "cwd": "$file_path",
                        "syntax": "Packages/Python/Python.tmLanguage",
                        "external_id": "python",
                        "extend_env": {"PYTHONIOENCODING": "utf-8"}
                        }
                    },
                    {"command": "repl_open",
                     "caption": "Python - IPython",
                     "id": "repl_python_ipython",
                     "mnemonic": "p",
                     "args": {
                        "type": "subprocess",
                        "encoding": "utf8",
                        "autocomplete_server": true,
                        "cmd": {
                            "osx": ["python", "-u", "${packages}/SublimeREPL/config/Python/ipy_repl.py"],
                            "linux": ["python3", "-u", "${packages}/SublimeREPL/config/Python/ipy_repl.py"],
                            "windows": ["python", "-u", "${packages}/SublimeREPL/config/Python/ipy_repl.py"]
                        },
                        "cwd": "$file_path",
                        "syntax": "Packages/Python/Python.tmLanguage",
                        "external_id": "python",
                        "extend_env": {
                            "PYTHONIOENCODING": "utf-8",
                            "SUBLIMEREPL_EDITOR": "$editor"
                        }
                    }
                    }
                ]}
            ]
        }]



    }
]









hecho por HBN





VON  ;-)


Título: Re: como instalar python 3 en sublime text 3,Linux Debian
Publicado por: Reim000n en 29 Mayo 2018, 08:17 am
muchas gracias !! me costo monton tambien jajaj cree una cuenta solo para agradecer ya que estoy hace una hora intentando instalarlo


Título: Re: como instalar python 3 en sublime text 3,Linux Debian
Publicado por: osiris95 en 27 Octubre 2018, 07:15 am
muy bueno muchas gracias ,


Título: Re: como instalar python 3 en sublime text 3,Linux Debian
Publicado por: jebm en 27 Enero 2019, 21:56 pm
muchas gracias, muy claro y resulto tal como se esperaba. ;-) ;-) ;-)


Título: Re: como instalar python 3 en sublime text 3,Linux Debian
Publicado por: tycho en 20 Marzo 2019, 17:56 pm
Muy bueno!! pero el problema es que mi sistema (Ubuntu 14.04 LTS) tiene cofigurado a python2 como default, y entonces python3.sublime-build no activa python3 pero si python2. Probe muchos cambios en en el file python3.sublime-build (entre esos, poner el complete path de python3 -/usr/bin/python3-) pero no funciono. Y cambiar en Ubuntu el default de python, se recomienda que no porque, hay en los repositorios muchos software que requieren a python2. Que hacer? No encuentro solucion. Gracias