VS Code Keybinding Command to create a new PYTHON file - python-3.x

I had Ctrl+N Ctrl+P bound to the command Python:createNewFile but it stopped working after a recent VSCode update (I believe, not sure if it was something else).
Does anyone know the VSCode key binding command to create a new Python file?
Ctrl+N gets me a new text file and I have to select the language or save it with .py for it to be a python file, which is cumbersome since I mostly use VSCode only for python.

Related

Running sublime commands

Is there a way to run a sublimetext command (ie, the built-in commands documented here or added) without creating a keybinding or adding something to the pallette and .sublime-commands?
I've tried running sublime.run_command from the console to no avail.
Right before posting I realized I should be using the local window instance.
Opening the python console with ctrl+` and run the command using the current instance window.run_command("<command>", args=<args>) is a workable solution.
(posting anyways because I was unable to find an answer to my question)

Shortcut key to run (build) code up to the current line in SublimeText3?

I use SublimeText3 on macOS for writing my code. I would like to run/build a code up to the current line where cursor is situated.
Is there a shortcut key to do that?
A shortcut key to select all lines from the beginning to the current line will also help. I can use that followed by key binding for build.
Although the example given below is short, I intend to use it in a script containing many lines of code.
Example .py script:
print("a")
print("b") #keep cursor here and use key board shortcut to run all lines of code up to this line.
print("c")
Sublime Text has no built in debugger so there is no run-to-cursor feature.
There are various debugging plugins that can be installed using Package Control. Among these there are Python Debugger which may be of use to you since you refer to Python in your post and Sublime Debugger which attempts to match Visual Studio Code's Debugger fairly closely.

Debug in vim using pyclewn

I'm trying to find out if is possible using vim as IDE to write python/c programms. Today I've installed pyclewn as a debugger. When I open it with :Pyclewn pdb tests.py all pyclewn windows are opened inside nerdtree window, is it possible to fix this issue and place them in main window.
Ok, I've got it, what I need
let g:pyclewn_args = "--window=bottom"
Next question, how to restart python script again?
Maybe some one can suggest tutorial for pyclewn?

Run code on file open in Sublime Text

I'd like to run some code in Sublime Text every time I open a file. Is there any way of doing this?
The background, if you want more context: I recently started using Sublime Text as my main editor, and although I love having Vim mode available through the Vintageous plug-in, I just want it to be available, not forcing its way into being turned on every time I open a file.
The author does not seem open to adding an option for being turned off by default--which is entirely okay: I'm not trying to be critical of his choices, and I'm glad he's made his code available to me--so it occurred to me that Sublime Text might offer some way of running some code every time you open a file. If so, I would simply run something that sets the mode to the normal Sublime Text mode (as opposed to Vim's "normal" mode).
You can run code in response to various events by creating a plugin and subclassing sublime_plugin.EventListener. The methods you would be most interested in are on_load() and on_new(). From there, you can either run an existing command, or you can make your own in a different class (probably subclassing sublime_plugin.TextCommand).

How to run Python in komodo

I am completely new to Python and wanted to try this code from the tutorial:
istrue = 1
if istrue:
print ("be carefull!")
The code itself should be fine, but I can not find any way to execute this code inside the editor [Komodo-Edit](http://www.activestate.com/komodo-edit)
I am used to Visual Studio and QtCreator (experienced C++/Qt developer). I would expect a menu for debugging and a command such as 'start debugging' which should open a console or use a console inside the editor. I would in any case refuse to use a dos console because then the whole idea of using an IDE would be useless.
If other Python IDEs would be more useful (on windows, no costs) I could switch to another one (except for vim/emacs).
I used to use Komodo edit, but not anymore as It's more of a text editor than an IDE. I reccomend using Ninja-IDE or Eclipse with PyDev. But if you insist on using Konodo Edit, here's an option:
Go here: Toolbox > Add > New Command...
in the top field enter the name 'Run Python file' or something else. Then go to the 'command' field and enter this:
%(python) "%F"
Optionally, you could also specify key binding for fast python executing.
I tried Komodo Edit version 9 and 10. Matthias' method work for the version 9. Version 10, I couldn't see the option to choose the Interpreter.

Resources