Questions tagged [python]
The python tag has no usage guidance.
27
questions with no upvoted or accepted answers
2
votes
0
answers
814
views
Neovim - How do you call Python from Lua and store the results as a Lua variable?
I am trying to improve a GitHub repository for Neovim called
quangnguyen30192/cmp-nvim-ultisnips
It's a Lua repository that calls another Vim plugin repository, SirVer/ultisnips , a primarily Python-...
2
votes
0
answers
242
views
How to select a python interpreter in vim
I have multiple versions of python on my ubuntu system, python2.7 which is default one and i have installed python3.8. I have a python module installed in python3.8 which is not installed in python2.7....
1
vote
1
answer
50
views
Handle star imports in Python
I'm currently developing a lot with Python. I use projects like pwntools and sometimes I'm contributing to repositories that use star imports in their source code. I know that star imports are not ...
1
vote
1
answer
61
views
Build a custom vim binary with python syntax highlighting
Background
The Debian 11 vim package doesn't include python3 support. See the section titled "No python support in Debian 11 vim - evidence" below
I need vim with python3 support for the ...
1
vote
0
answers
235
views
Pyright LSP flagging errors in class using pandas method
Using the following code example:
import pandas as pd
from typing import Dict
class Test:
def __init__(self, df : pd.DataFrame) -> None:
self.df = df
def example(self, ...
1
vote
0
answers
16
views
I am developing my own python package, but Omnicomplete won't recognize it
I have my package in a local folder (say C:/Users/Myself/PythonStuff/MyPackage).
Next, I created a new file in C:/Users/Myself/PythonStuff where I import my package, i.e. on top of my new file I have
...
1
vote
0
answers
62
views
Accessing python dataframe columns in vim editor upon pressure of a key
I have the following situation
import pandas as pd
T = read_csv("MyFile")
I would like to have a list of the dataframe T columns when I type T[" and then I hit a key like <tab> ...
1
vote
0
answers
30
views
How can I create a key combination that sends the content of a markdown code cell to a tmux pane with slime?
I am a happy user of nvim-R, which enables to send R markdown chunks to an R console with <localleader>ca. R cells code blocks look like this in R markdown files:
```{r}
head(faithful)
```
When ...
1
vote
0
answers
443
views
ALE project root for Python
I use ALE to run linters while editing Python code in vim. When working on code in a package, I can't get ALE to respect the pylint configuration in the project root. I've had it in .pylintrc as well ...
1
vote
0
answers
39
views
Keep matched filename, line number and column number in the error message
I'm currently trying to create some errorformat rules to parse the output of the black formatter. The output of this formatter is as follows:
would reformat /home/ricks/Development/personal/...
1
vote
0
answers
48
views
UnicodeDecodeError caused by the key <bs>
To simplify the problem, run following command will get the same error
:py3 print(vim.eval('"\\<bs>"'))
And the real situation is
while 1:
vimcmd("let nr = getchar()")
...
1
vote
0
answers
129
views
Starting an interpreter and dumping the output to a new buffer
I am working on some Python code, and I would like to call an IPython interpreter from within a script. I have no problem doing this, however, I would then like to dump all of the output from both the ...
1
vote
0
answers
101
views
How to set the Bash python env and vim python env paths the same?
When I check for python version in vim file, it displays 3.6 whereas it shows python 3.7 when I check from the bash terminal. As a result, when I pip install from the terminal, it installs in the ...
1
vote
0
answers
93
views
Why does Gvim treat ansi escape codes differently than Vim in python code?
The following python code uses ansi escape sequences to clear the terminal screen and change the text color to red. It then prints "Hello from Vim."
print ('\033c\033[31m Hello from Vim.')
In Vim I ...
0
votes
0
answers
10
views
coc-pyright is using buffers irresponsibly
I've been noticing that my buffer number increases really fast without me even using them. I rely on buffers quite a lot to switch between files, and it's really annoying when I open a second file and ...
0
votes
1
answer
53
views
How do I use the Vim code for Google's python style?
I found interesting code on GitHub at https://github.com/google/styleguide/blob/gh-pages/google_python_style.vim
I would like to use it, but when I just dropped it in my .vimrc, it interfered with ...
0
votes
0
answers
69
views
nvim-dap debugging with Ipython instead of the default REPL
I wanted to ask if it is possible to combine nvim-dap with ipython for debugging purposes in a reasonable way.
Now I am using the repl that is being opened by nvim-dap-ui. But it is not the most ...
0
votes
0
answers
12
views
neovim: pwntools process automatically stops when trying to invoke interactive shell
I'm using python pwntools.
I'm using python 3.10.x
This line of code should open a shell for me:
io.interactive()
But while running this file from vim using
!./% it doesn't open the shell doesn't ...
0
votes
0
answers
45
views
Display lint info in vim ruler
I've installed the vim-flake8 plugin and it works correctly to lint Python in vim.
When I am on a particular line, I can use :call flake8#Flake8ShowError() and it will display the error in the vim ...
0
votes
0
answers
13
views
Browse all symbols of a python project
I want to browse symbols for an entire python project (directories / git files).
Usually, LSP providers write this to lsp_workspace_symbols.
Unfortunately, I couldn't make jedi_language_server ...
0
votes
0
answers
103
views
Vimspector using debugpy despite setting adaptor to debugpy-python2
I am facing an issue where i am trying to use debug-python2, however in configuration it always uses debugpy
Below is my json file configuration
{
"configurations": {
"run - ...
0
votes
1
answer
475
views
LSP with pyright and poetry
I want LSP to allow me to use pyright with peotry projects. The problem is, that the venv of a poetry project is kind of arbitrary and can change. So I can not configure it in the pyright config file.
...
0
votes
0
answers
64
views
Vim don't recognize python310.dll in Miniconda virtual environment
If I use the following
set pythonthreehome=C:\\Users\\myname\\Miniconda3
set pythonthreedll=C:\\Users\\myname\\Miniconda3\\python39.dll
I have no problems, but if I set the following
set ...
0
votes
0
answers
35
views
Vim and env for python
I have Vim v. 8.2 with huge feature, installed using Brew, mostly used for Python dev. I also use Pipenv for python, having the .venv dir in the project's folder.
For Vim, I'm using the vim-pipenv ...
0
votes
0
answers
28
views
Why is Ctrl-f and o not using the same definition of the indentation level for Python?
Vim is automatically indenting Python code quite well.
For the following code everything works well:
1 while True:
2 |
If the cursor is at line 1 and the user hit o in normal mode a new ...
0
votes
0
answers
104
views
Empty line indentation for Python
Whenever I press o or O, VIM starts the line with the desired indentation. At work, people have decided that they want empty lines to be indented as if it contained code, such that code can be copied ...
0
votes
0
answers
198
views
Suppress Deprecation Warning from Python
I am using gVim on Windows, and when I enter insert mode for the first time on a fresh document I am hit with a deprecation warning from Python regarding the imp package.
This is quite jarring and I ...