Skip to main content

Questions tagged [python]

use for Python programming language in Emacs. Emacs supports several versions of the language implementation, versions, and coding styles. Python questions should augment with additional tags as appropriate as described in the description below.

Filter by
Sorted by
Tagged with
1 vote
1 answer
55 views

I use pyvenv to create new environments and activate them. I, sometimes, use libs that are not in standard lib, and I usually have to install them with pip3 module/command. For example, to install ...
david's user avatar
  • 285
1 vote
1 answer
93 views

This worked seamlessly, but at some point, I lost the ability to pass string-type variable values between code blocks in Org Babel. Let’s take the following example: #+begin_src python :session *PY* :...
martinoidar's user avatar
0 votes
0 answers
37 views

I'm running python 3.12 at work on windows using emacs as IDE. At home I'm running linux where my setup works without any issue. However, at work with windows I struggle to get it properly run. I have ...
swissy's user avatar
  • 107
0 votes
1 answer
284 views

I want to configure Emacs to indent multiline argument lists in Python like Black or Ruff (4 spaces before each argument), but Emacs is very insistent on following PEP-8 (8 spaces). Even if I manually ...
goodmami's user avatar
  • 133
1 vote
0 answers
55 views

I'm trying to run a python script using selenium (that should call the executable geckodriver, installed) but, while the script runs in term, it errors in eshell (and in the python console). A minimal ...
Piripuz's user avatar
  • 11
1 vote
0 answers
27 views

After switching to Mac from Windows, the output of my python org-mode code blocks are not working properly. It keeps printing what seems to be the backend python call instead of the code output. And ...
Chris's user avatar
  • 11
0 votes
0 answers
121 views

I have following in my init.el file: (use-package dumb-jump :straight t :init ) (add-hook 'xref-backend-functions #'dumb-jump-xref-activate) (setq xref-show-definitions-function #'xref-show-...
Kabira  K's user avatar
  • 105
1 vote
1 answer
168 views

I'm trying to use org-mode to knit a document with some text and plots produced with python. However, when I export the org file to html or pdf, it doesn't output the plots, only the text and code. I ...
PavoDive's user avatar
  • 123
0 votes
0 answers
80 views

Say I'm in foo.py and I want to paste something into the docstr of function f: something: foo bar def f(): """ """ My current workflow (evil normal mode, ...
jjk's user avatar
  • 786
2 votes
1 answer
255 views

I have the following settings on for org-babel #+PROPERTY: header-args:python :python ~/env/pt/bin/python :session a :results drawer output replace When I evaluate a code block, the results are some ...
Eric Auld's user avatar
  • 205
3 votes
0 answers
379 views

I am using eglot (have tried both pyright and pylsp). Jumping to definition at point works, but when I select a variable imported from a different package, or the package itself, nothing happens. For ...
guibor's user avatar
  • 173
0 votes
0 answers
38 views

hello I am trying to run python application on Emacs as an IDE I installed pyel and pyright from pip and package installer but now some time the result is showing and sometime it is not trying to push ...
islam's user avatar
  • 1
0 votes
1 answer
34 views

My emacs is 29.2 in linux. I try below code to use output from first python block, but the output in second block is None after press C- C-c. #+name: testblock #+begin_src python print("hello&...
beetlej's user avatar
  • 1,100
0 votes
0 answers
57 views

I'm trying to use sessions within an org file to keep the code workspace as I need something similar in style to the Jupyter Notebooks. The issue I'm having is this isn't restricting the session to ...
ADS_Fibonacci's user avatar
0 votes
1 answer
69 views

I am trying to fill a region within a Python docstring. The function find-docstring-limits returns the limits of the docstring. Here is the function: (defun indent-docstring-paragraph () "...
olivaw's user avatar
  • 151
0 votes
1 answer
173 views

When I make an Org Babel shell code block with for instance a :session a header argument, it automatically makes a buffer a with the shell for this session, so I can explore it interactively. This is ...
Eric Auld's user avatar
  • 205
0 votes
1 answer
81 views

Python buffers support comint-delete-output, but if I forget to do it before entering another command, I have a big hunk of text I can't easily erase. In shell mode, I can set the mark and run comint-...
Eric Auld's user avatar
  • 205
0 votes
1 answer
187 views

OS: Windows 11 (64 bit) Python version: 3.12.0 (64 bit) Emacs version: 29.1 I use LSP mode in Emacs for Python programming and I have in my Emacs init.el file the following: (custom-set-variables ...
user17911's user avatar
  • 163
0 votes
1 answer
155 views

Load up Emacs in the default modes, i.e. emacs -Q. After this, make a new .Org file with the following contents and run the Emacs Lisp code. (setq org-babel-python-command "python3") (setq ...
J. Mini's user avatar
  • 265
4 votes
2 answers
361 views

I have a python code block in an org-file that when executed results in some error. I was expecting to see that error in the #+RESULTS: block, but it doesn't show up. I have to navigate to the python ...
skittish's user avatar
0 votes
3 answers
157 views

when python code block gets larger, it's hard to find the right indentation level def foo(): for a in l: # l1 # l1-1 for b in k: # l2 print(a) # (2) print(b) ...
eugene's user avatar
  • 539
0 votes
0 answers
73 views

I am getting the wrong indentation for closing braces when I use electric-pair mode in python. For example, if I place the cursor (|) like so : for i in range(10): foo = [|] and hit return, then ...
SLesslyTall's user avatar
0 votes
0 answers
54 views

Company mode suggests the right completions, but when I press RET I get weird characters, probably denoting the position, I was expecting to be able to cycle between each of these spots with tab or at ...
geckos's user avatar
  • 151
0 votes
0 answers
66 views

Am doing the following for org files. (add-to-list 'auto-mode-alist '("\\.org\\'" . org-mode)) What should I do for python ?
Dilna's user avatar
  • 1,473
0 votes
1 answer
102 views

According to the NEWS for Emacs 28.1 (Ctrl-f "OSC 8, for hyperlinks"), the comint-mode supports the OSC 8 styled links. But when I compile (interpret) a file "test.py" with ...
scribe's user avatar
  • 1,160

1
2 3 4 5
13