Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Open a function in Python Spyder, like I do with MATLAB

Tags:

python

spyder

In MATLAB, there I can place the cursor on a function name and press Ctrl+D, the file containing the function will automatically open. Is there any way I can do something similar with Python, within the Spyder IDE?

like image 278
Vaaal88 Avatar asked Feb 11 '23 09:02

Vaaal88


1 Answers

In Spyder you can jump to the definition of a function (or class) by holding CTRL and clicking on the function (or class) name/reference. If that definition is in an other file, that file will be opened.

Ctrl + Leftclick

EDIT as commented by @pwagner

Rightclick -> Goto Definition

and

Ctrl + G

also work

like image 197
PeterE Avatar answered Feb 16 '23 03:02

PeterE