You are not logged in.

#1 2012-03-17 11:20:12

Llama
Banned
From: St.-Petersburg, Russia
Registered: 2008-03-03
Posts: 1,379

Emacs: Python, Gud, Integration

Hi,

I've been trying to configure Emacs as a Python IDE. It turned out to be some quest. There's a sea of info on the subject. Something funny about the whole thing too: the available solutions are very different in nature, they lack clarity and simplicity and above all they are outdated to the point of irrelevance. One might suspect that since circa 2009 it should all work out of the box, but this obviously is not the case.

At last, mostly by luck, I stumbled on a neat and up-to-date package by Gabriele Lanaro: emacs-for-python. It's so good it would be unfair to complain about the usage to be held self-evident by the author smile .

Well, there's Gud among other goodies. It takes some fine tuning, as it turned out: running pdb under emacs . This simple yet barbarous hack involves copying pdb.py into the user directory so it can be run alongside Gud. It works all right, but I have some trouble believing my eyes. Is this really the way things are supposed to be? Predictably, it works by way of M-x pdb, but if the debugger is dropped into via pdb.set_trace() or pdb.runcall(), even the measly Gud "integration" is denied.

Believe me or not, I can find nothing useful on the Google.

Offline

#2 2012-03-17 11:37:22

Pank
Member
From: IT
Registered: 2009-06-13
Posts: 371

Re: Emacs: Python, Gud, Integration

python.el of the repo you mentiod should already suppot pdb.

PDB Tracking (it even supports ipdb!)

There are 3 different Python implementations for Emacs atm, I think, so use advice for the right one.

See https://github.com/fgallina/python.el/

Last edited by Pank (2012-03-17 11:38:06)


Arch x64 on Thinkpad X200s/W530

Offline

#3 2012-03-17 11:48:04

Llama
Banned
From: St.-Petersburg, Russia
Registered: 2008-03-03
Posts: 1,379

Re: Emacs: Python, Gud, Integration

Pank wrote:

python.el of the repo you mentiod should already suppot pdb.

I guess so. Could you be more specific?

There are 3 different Python implementations for Emacs atm, I think, so use advice for the right one.

What is it? I am not as experienced as you are.

Offline

#4 2012-03-17 12:28:27

Llama
Banned
From: St.-Petersburg, Russia
Registered: 2008-03-03
Posts: 1,379

Re: Emacs: Python, Gud, Integration

Pank wrote:

python.el of the repo you mentiod should already suppot pdb.

PDB Tracking (it even supports ipdb!)

Yes, both python.el files seem to be slightly different versions of the same file. I did M-x describe-mode on both and still have no idea what "PDB Tracking" does mean.

Offline

#5 2012-03-17 12:55:16

Pank
Member
From: IT
Registered: 2009-06-13
Posts: 371

Re: Emacs: Python, Gud, Integration

Llama wrote:
Pank wrote:

python.el of the repo you mentiod should already suppot pdb.

I guess so. Could you be more specific?

Honestly, I haven't really used pdb smile I just used my own print(.)-statments when I need to debug something.

Llama wrote:
Pank wrote:

There are 3 different Python implementations for Emacs atm, I think, so use advice for the right one.

What is it? I am not as experienced as you are.

- Fabian's new python.el, which I recommend.  This is what you are using as well, it seems.
- Python-foundation's python-mode.el, which some adhere to.
- Dave Love's python.el shipped with Emacs.

There was some talk of distributing Fabian's python.el with Emacs, but for now it is just in the package-repo (of Emacs).

The source has some hints

;; Pdb tracking: when you execute a block of code that contains some
;; call to pdb (or ipdb) it will prompt the block of code and will
;; follow the execution of pdb marking the current line with an arrow.

When I enter a .py file I have an entry called debugger (which is not assigned a key-combo), which I guess should do the trick...


Arch x64 on Thinkpad X200s/W530

Offline

#6 2012-03-17 13:41:56

Llama
Banned
From: St.-Petersburg, Russia
Registered: 2008-03-03
Posts: 1,379

Re: Emacs: Python, Gud, Integration

;; Pdb tracking: when you execute a block of code that contains some
;; call to pdb (or ipdb) it will prompt the block of code and will
;; follow the execution of pdb marking the current line with an arrow.

That's exactly what it is not doing!

So far I have found this . My problem indeed, but the thread leads nowhere.

That is, I can run a module in an "integrated" (pdbtrack) way, but I cannot drop into with pdb.set_trace() in an "integrated" way.

Last edited by Llama (2012-03-17 13:52:54)

Offline

#7 2016-05-28 05:51:03

jethronsun7
Member
Registered: 2016-04-29
Posts: 44
Website

Re: Emacs: Python, Gud, Integration

Recommend Spacemacs, or purcell's emacs.d.

Python mode I suggest proofit404 / anaconda-mode

Offline

#8 2016-05-28 11:18:04

WorMzy
Forum Moderator
From: Scotland
Registered: 2010-06-16
Posts: 11,864
Website

Re: Emacs: Python, Gud, Integration

Please don't necrobump, jethronsun7.

Closing.


Sakura:-
Mobo: MSI MAG X570S TORPEDO MAX // Processor: AMD Ryzen 9 5950X @4.9GHz // GFX: AMD Radeon RX 5700 XT // RAM: 32GB (4x 8GB) Corsair DDR4 (@ 3000MHz) // Storage: 1x 3TB HDD, 6x 1TB SSD, 2x 120GB SSD, 1x 275GB M2 SSD

Making lemonade from lemons since 2015.

Offline

Board footer

Powered by FluxBB