Run python file(by terminal) by Sublime Text 3

Asked

Viewed 70 times

1

I currently use Atom to write my programs in Python. However, I want to migrate to sublime text for convenience and for being a lighter program. I use a plugin in Atom called: Atom-python-run. He allows me to squeeze F5 he runs the file .py in an external terminal. I would like to do the same with Sublime Text, I have tried plugins in it as: Terminal(So opens the terminal in the file folder), Terminality(nothing worked), Sublimerepl(This works, but, n opens in a terminal the part). How could I fix it? adjusting the settings of the Terminal plugin (I tried to edit, but it didn’t result in what I wanted)?

Archive: Terminal.sublime-Settings

{
//The command to execute for the terminal, leave blank for the OS default
// See https://github.com/wbond/sublime_terminal#examples for examples
"terminal": "C:\\windows\\system32\\cmd.exe",

// A list of default parameters to pass to the terminal, this can be
// overridden by passing the "parameters" key with a list value to the args
// dict when calling the "open_terminal" or "open_terminal_project_folder"
// commands
"parameters": ["python","-u" ,"$file"],

// An environment variables changeset. Default environment variables used for the
// terminal are inherited from sublime. Use this mapping to overwrite/unset. Use
// null value to indicate that the environment variable should be unset.
"env": {}
}

File: Default(Windows). sublime-keymap

[
    { "keys": ["ctrl+shift+t"], "command": "open_terminal",},
    { "keys": ["ctrl+shift+alt+t"], "command": "open_terminal_project_folder" }
]
  • 1

    Out of curiosity, did you just try to give a Control + B? I think you’re even ready for . py in Sublime, you don’t even have to do anything. Make sure you have it on the menu: Tools -> Build System -> Python - and then Control B - Don’t forget to check if python.exe (or equivalent depending on OS) is in your path

  • 1

    I believe that what you want is collateral solved here: Sublime problem to run python code

  • 2

    Or here http://answall.com/questions/175788/70

  • 1

    the second link worked! Thank you very much!!

No answers

Browser other questions tagged

You are not signed in. Login or sign up in order to post.