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
0 votes
0 answers
815 views

I am running Emasc 26.2 on Windows 10 and have installed black via pip and installed blacken via melpa but when I enable blacken-mode it doesn't change any of the formatting even when I intentionally ...
user29896's user avatar
2 votes
1 answer
69 views

The title might be slightly confusing. What I mean is this. Let's say I have a code block which has some error checking code. If there is an error, the (tangled) program should not continue past that ...
Samvid Mistry's user avatar
0 votes
1 answer
2k views

I deleted my old Python installation, so the only Python installation remaining is the one inside Anaconda. when I start Spyder I get: Python 3.7.4 (default, Aug 9 2019, 18:34:13) [MSC v.1915 64 bit ...
Stephen's user avatar
  • 101
2 votes
0 answers
96 views

I am attempting to navigate methods in a file. Typically these are javascript or python files, which have a classes at the "top level", which in turn have methods nested within those ...
cammil's user avatar
  • 519
4 votes
1 answer
4k views

I am using pyvenv with doom and am trying to have my python virtual environments automatically loaded when I enter a certain project. I saw this relevant issue on pyvenv and have added the following ...
Jacob Pavlock's user avatar
5 votes
0 answers
343 views

Is there a way to automatically add imports to python code within emacs? def f(x: str) -> List[str]: I want to be able to have my guess over "List" press a key binding and magically add ...
Att Righ's user avatar
  • 837
1 vote
1 answer
269 views

Here's how emacs indents e.g. Python code: a = myfun(b, c) I'd like it to be this way: a = myfun(b, c) Reasoning? If I later replace myfun with myfunction, in the first case it becomes:...
x-yuri's user avatar
  • 291
1 vote
2 answers
637 views

I'm enjoying learning org-babel to write literate documents and am trying to include summary tables produced by Pandas describe(). I found an old thread with some answers but none of the provided ...
slackline's user avatar
  • 377
0 votes
0 answers
934 views

So as you can see, in my terminal, I was able to execute the file without error, but once I tried from the python shell, whether in the terminal or the one integrated in Emacs, there is an error, it ...
sinekonata's user avatar
0 votes
0 answers
190 views

My Emacs's python-indent-offset is fixed at 2, even though I have the below code in my init.el to set it to 4. I used C-h v to describe the variable, it says its value is 2 and default is 4. I removed ...
vy007vikas's user avatar
0 votes
0 answers
28 views

I have a number of virtualenvs, currently 40, but when I try to select one via the drop-down menu in emacs, it shows only the first 30 or so. Is there a way to get a scrollbar attached to that menu, ...
user29402's user avatar
0 votes
0 answers
458 views

I followed instructions here: https://github.com/leoliu/ggtags I've enabled the following: (add-hook 'c-mode-common-hook (lambda () (when (derived-mode-p 'c-mode 'c++-mode '...
Mittenchops's user avatar
2 votes
1 answer
393 views

When I press C-c C-c(python-shell-send-buffer), I get output shown below. Afterwards when I do the same operation (C-c C-c) I always see Sent: #!/usr/bin/env python3... in the echo area. I just want ...
alper's user avatar
  • 1,570
0 votes
0 answers
51 views

Problem I don't know why my Jupyter console sometimes doesn't output anything. An example is this: Notice that only the first line gets its output. I use C-enter to execute each line. Line 2, 3, 4, ...
Yuchen Zhang's user avatar
2 votes
1 answer
2k views

I think that this is a newbie question, but here it goes: I have installed Flycheck just as in the official page. Therefore, in my .emacs file I added the following lines (after installing): (package-...
José Joaquim's user avatar
1 vote
1 answer
182 views

How could I disable all python shell interaction in emacs on python-mode? Such as: C-c C-z open a python shell C-c C-c run the content of the buffer in the opened python shell C-c C-r ...
alper's user avatar
  • 1,570
0 votes
1 answer
290 views

I am trying to pass the value of an octave/matlab array into a python code block in org-mode. But I can't get the python-end to receive the value. With the answers in this question, I can generate an ...
tinlyx's user avatar
  • 1,454
1 vote
0 answers
125 views

Take for example I have the following project tree. repo | +-root | +-__init__.py +-__main__.py +-packageA | +-__init__.py +-__main__.py My buffer is currently at root.packageA....
Tian's user avatar
  • 298
1 vote
1 answer
978 views

https://github.com/prettier/prettier-emacs does formatting for javascript wonder if there's an equivalent for python code?
eugene's user avatar
  • 539
4 votes
2 answers
5k views

So I am trying to create a Data Science workflow using org-mode source-blocks. Basically, I need to emulate the jupyter notebook functionality where you create a plot and it shows the figure. Now, ...
user avatar
3 votes
1 answer
165 views

There is a strange icon appearing in place of colons (:) in my Python buffers. I cannot identify it easily using C-x = or any other command to inspect the character at the point because the icon ...
Metropolis's user avatar
0 votes
1 answer
764 views

So going to the declaration is great. However I want frequently to go the other way. There used to be a way to do this with one of the older ada-modes, but I've not seen anything in the python support ...
David Boshton's user avatar
2 votes
0 answers
598 views

I try to use virtualenvwrapper.el with the build-in python.el and my virtual environments in a ./.venv directory inside each project. Because all virtual envs have the same name .venv I cannot make a ...
halloleo's user avatar
  • 1,445
0 votes
1 answer
1k views

It's been really frustrating trying to get spacemacs to work so far. I've grown to really love it - coming from vim - for its capabilities in manipulating and navigating text, but it's just been so ...
Jonathan's user avatar
1 vote
0 answers
89 views

Ubuntu 19.10 emacs 26.3 from system repos I do use elpy and evil-mode In general when I am editing python code, indentation works just fine. However, when I am editing doc-strings, when I type enter ...
Vince W.'s user avatar
  • 445
2 votes
2 answers
108 views

Since default value for :result header is value print statement will only show with :result output #+BEGIN_SRC python :results output print(' hello') #+END_SRC #+RESULTS: : hello but same ...
rho's user avatar
  • 253
0 votes
1 answer
563 views

I'm struggling to workaround the problem discussed in this post. I'm working through the accepted solution (which also references this post, and getting what I think is close, but not quite there. The ...
HaPsantran's user avatar
1 vote
1 answer
2k views

I can enable python-pylint for a opened Python file doing: M-x flycheck-select-checker and enter python-pylint It think it says C-c ! s to enable it on all Python files.(the message hides itself so ...
alper's user avatar
  • 1,570
1 vote
0 answers
261 views

I want to use something like pdbpp or ipdb to debug a flask application. I've tried but not understood how to set a breakpoint in a python file that's part of a wider application and see it hit. There ...
David Boshton's user avatar
2 votes
1 answer
2k views

pyvenv and virtualenvwrapper emacs packages work well with virtualenv, but neither appears to support the core venv module which is now packaged with releases of Python. Are there any actively ...
Phil's user avatar
  • 545
2 votes
0 answers
507 views

I have set up Emacs (on Mac Catalina) with Elpy to handle Python. I also managed to get Jupyter notebooks (.ipynb files) working with Elpy via Ein. Both .py and .ipynb compile and use Flycheck ...
alpresci's user avatar
3 votes
1 answer
664 views

I recently started using spacemacs, and have a newbie question about modifying the way run-python works. When I execute run-python, a new buffer is opened in a different window. I'd like to change it ...
lane0335's user avatar
1 vote
0 answers
364 views

Whenever elpy-mode is activated upon visiting a python file, I see a py.exe executable start, with a subtree of processes. This should be the remote procedure call (thanks @al0 for the explanation). ...
pglpm's user avatar
  • 397
1 vote
0 answers
258 views

I'm looking for a python debug debug mode in Emacs that allows me to start flask apps in debug mode and interact with them. Is there something that does this and and a step through on how to use it? I'...
David Boshton's user avatar
5 votes
1 answer
910 views

I do a lot of R coding on Emacs – on Windows – using the wonderful ESS package. What I particularly like is that I can: start an R session, and then send lines or regions of the script I'm working on ...
pglpm's user avatar
  • 397
1 vote
1 answer
174 views

In emacs, I use ipython in the inferior python mode with config: (setq python-shell-interpreter "ipython" python-shell-interpreter-args "--simple-prompt -i") When I edit my .py file, without any ...
Hao Yuan's user avatar
0 votes
1 answer
81 views

This may be a silly question, but how can I make a buffer unreachable? I have enabled live-py-mode. Every time I try to edit my python file it evaluates the code, which is a well and good but it's a ...
MaskedHero's user avatar
1 vote
0 answers
45 views

For example, I get #+BEGIN_SRC python :session sdfjkl :results output import numpy #+END_SRC #+RESULTS: : Python 3.8.0 (default, Oct 23 2019, 18:51:26) : [GCC 9.2.0] on linux : Type "help", "...
extremeaxe5's user avatar
2 votes
1 answer
131 views

Quite frequently, syntax highlighting in a given buffer is broken (i.e., a big fraction of the code is not highlighted). This is definitely not due to syntax errors, and the point at which ...
Torsten Bronger's user avatar
1 vote
2 answers
2k views

I have a bunch of python files (ie .py files), which I use Emacs to edit. However I keep having the issue where sometimes emacs will indent regions with 8 spaces instead of 4, and I can't figure out ...
Bethan's user avatar
  • 13
3 votes
1 answer
2k views

Start Edit 1 To answer questions. Emacs Versions: GNU Emacs 25.2.2 (x86_64-pc-linux-gnu, GTK+ Version 3.22.21) of 2017-09-22, modified by Debian GNU Emacs 26.3 (build 1, x86_64-w64-mingw32) of 2019-...
Gabe's user avatar
  • 51
-1 votes
1 answer
1k views

Jedi has support for auto-completion after dot (setq jedi:complete-on-dot t) => Main goal is to Finding what methods a Python object has [Q] Does company-mode has the same support (complete-on-dot)? ...
alper's user avatar
  • 1,570
0 votes
1 answer
145 views

When I'm using ein to run a python jupyter notebook, the major-mode variable is just "ein:notebook-multilang-mode" which makes it ambiguous what the current language is. I have elisp that only ...
Joseph Garvin's user avatar
1 vote
1 answer
170 views

I enabled elpy mode for python and I get hints when I type a keyword. Also I have yasnippets. Unfortunately, when I type "for" keyword, elpy gives me a useless hint, blocking <tab> key for ...
user4035's user avatar
  • 1,119
10 votes
1 answer
1k views

I am using python-mode which colors the parameters. When I concatinate strings the variable color is represented as different: On the other hand, if I use fstring, the variable is not represented as ...
alper's user avatar
  • 1,570
3 votes
3 answers
1k views

I would like to navigate quickly between classes in Python code. I'm looking for a command to go to the next / previous class so I can bind that to a key sequence. This question is not about ...
Croad Langshan's user avatar
1 vote
0 answers
313 views

Sometimes I use ctrl h i or M-x woman, though I almost always head to the web for basic queries like python find line in string. Do I need to download this[0], that[1] or something else before leaving ...
jjk's user avatar
  • 786
3 votes
1 answer
629 views

This small program runs well in Terminal : mac2011% cat bug.py print(__name__ == "__main__") #if True: if __name__ == "__main__": print("main") else: print("not main") mac2011% python bug.py ...
Pierre ALBARÈDE's user avatar
0 votes
1 answer
630 views

I would like to be able to start Python 3 and ipython from Emacs in an inferior mode buffer. Currently start interpreter C-c C-p starts 2.7. I know there must be a way to change to start another ...
Stephen's user avatar
  • 101
0 votes
2 answers
2k views

I do not prefer python-mode. I would like a generic way so that I can understand emacs. I wish the file be saved and python file command then be run as if in a shell.
Mini kute's user avatar

1
3 4
5
6 7
13