r/Python • • Aug 05 '19

Python's response to MATLAB

Post image
4.3k Upvotes

372 comments sorted by

View all comments

125

u/[deleted] Aug 05 '19

Why would matlab feel bad for python?

405

u/Alexanderdaawesome Aug 05 '19

Because Python needs to type

import numpy as np

Before doing anything MATLAB can do.

17

u/stoirtap Aug 05 '19

Hi, Engineering newb here.

I've got some experience with Python and MATLAB (through my school). Being the newb that I am, my favorite part of MATLAB is that it shows me all the variables and what's in them on the side, so if the wrong thing is going to the wrong place, I'll know at once.

Does Python have something like that?

3

u/Salyangoz Aug 06 '19

you technically dont even need an IDE to do what youre describing.

In your script place import pdb; pdb.set_trace() at any point to pause execution and drop you down into a python shell. Then use break /foo/bar.py:55 to place an additional breakpoint at line 55 in the file /foo/bar.py if need be, then do print(locals())or better yet pp locals() (pretty print) to look at all your variables.