Re: How do you debug in Python? Coming from a Matlab and R user. I'm already aware of pdb.

2021-01-27 Thread Antoon Pardon
Op 27/01/21 om 05:17 schreef Dan Stromberg: On Tue, Jan 26, 2021 at 8:13 PM Dan Stromberg wrote: On Tue, Jan 26, 2021 at 4:01 PM C W wrote: Hello everyone, I'm a long time Matlab and R user working on data science. How do you troubleshooting/debugging in Python? I frequently read

Re: How do you debug in Python? Coming from a Matlab and R user. I'm already aware of pdb.

2021-01-27 Thread Grant Edwards
On 2021-01-27, C W wrote: > My main takeaway from the discussion so far is that: you can't troubleshoot > Python without some kind of breakpoint or debugger. How odd. I do it all the time. -- Grant -- https://mail.python.org/mailman/listinfo/python-list

Re: How do you debug in Python? Coming from a Matlab and R user. I'm already aware of pdb.

2021-01-27 Thread Alan Gauld via Python-list
On 27/01/2021 23:04, 2qdxy4rzwzuui...@potatochowder.com wrote: > systems are more painful than others, but yes, some debugging > environments are more painful than others, too. Very true! but a good debugger is a godsend. Howevder... > A well placed call to print (they're not "print statements"

Re: How do you debug in Python? Coming from a Matlab and R user. I'm already aware of pdb.

2021-01-27 Thread Alan Gauld via Python-list
On 27/01/2021 18:42, C W wrote: > I'd like to know how the experts on here are approaching and debugging > this. > > Bonus if no debugger or breakpoint. Just the good ol' run the function and > evaluate/print output for problems. One option you may like and nobody seems to have mentioned yet is

Re: How do you debug in Python? Coming from a Matlab and R user. I'm already aware of pdb.

2021-01-27 Thread Michael Torrie
On 1/27/21 11:42 AM, C W wrote: > For learning purposes, here's the files: > https://www.dropbox.com/sh/a3iy40rcvib4uvj/AAADmlM2i6NquWC1SV0nZfnDa?dl=0 > > Yes, you are correct about "employee" and "person" discrepancies. For now, > the list comprehension is where I get stuck. > > I'd like to

Re: How do you debug in Python? Coming from a Matlab and R user. I'm already aware of pdb.

2021-01-27 Thread J. Pic
Also - https://github.com/cool-RR/pysnooper - https://github.com/andy-landy/traceback_with_variables -- https://mail.python.org/mailman/listinfo/python-list

Re: How do you debug in Python? Coming from a Matlab and R user. I'm already aware of pdb.

2021-01-27 Thread duncan smith
On 27/01/2021 22:41, C W wrote: > Great tutorial Irv, very simple with if-else example, gets the point > across. > > My main takeaway from the discussion so far is that: you can't troubleshoot > Python without some kind of breakpoint or debugger. > [snip] Really? Duncan --

Re: How do you debug in Python? Coming from a Matlab and R user. I'm already aware of pdb.

2021-01-27 Thread 2QdxY4RzWzUUiLuE
On 2021-01-27 at 17:41:52 -0500, C W wrote: > Great tutorial Irv, very simple with if-else example, gets the point > across. Disclaimer: I did not watch the video. > My main takeaway from the discussion so far is that: you can't > troubleshoot Python without some kind of breakpoint or

Re: How do you debug in Python? Coming from a Matlab and R user. I'm already aware of pdb.

2021-01-27 Thread C W
Great tutorial Irv, very simple with if-else example, gets the point across. My main takeaway from the discussion so far is that: you can't troubleshoot Python without some kind of breakpoint or debugger. I suppose I can't take the functional programming debugger style like C, Matlab, or R, and

Re: How do you debug in Python? Coming from a Matlab and R user. I'm already aware of pdb.

2021-01-27 Thread Irv Kalb
On Jan 26, 2021, at 5:28 PM, William Ray Wing via Python-list wrote: > > > >> On Jan 26, 2021, at 2:00 PM, C W wrote: >> >> Hello everyone, >> >> I'm a long time Matlab and R user working on data science. How do you >> troubleshooting/debugging in Python? >> > > Another approach is to

Re: How do you debug in Python? Coming from a Matlab and R user. I'm already aware of pdb.

2021-01-27 Thread Dietmar Schwertberger
On 27.01.2021 01:52, Skip Montanaro wrote: Agree with Grant on these points. I certainly use gdb to debug C code (like the interpreter), but for Python code, tracebacks and print statements pretty much take care of things. I thought so for the first 12 year of using Python. For the last 12

Re: How do you debug in Python? Coming from a Matlab and R user. I'm already aware of pdb.

2021-01-27 Thread C W
For learning purposes, here's the files: https://www.dropbox.com/sh/a3iy40rcvib4uvj/AAADmlM2i6NquWC1SV0nZfnDa?dl=0 Yes, you are correct about "employee" and "person" discrepancies. For now, the list comprehension is where I get stuck. I'd like to know how the experts on here are approaching and

Re: How do you debug in Python? Coming from a Matlab and R user. I'm already aware of pdb.

2021-01-27 Thread C W
Hi Cameron, Yes, you are correct in all above. There's a mistake in my copy paste. Thanks for pointing that out! On Wed, Jan 27, 2021 at 12:58 AM Cameron Simpson wrote: > On 27Jan2021 00:19, C W wrote: > >Here's the code again, class should be called PERSONDatabase, > >misspelled > >earlier: >

Re: How do you debug in Python? Coming from a Matlab and R user. I'm already aware of pdb.

2021-01-27 Thread Michael Torrie
On 1/26/21 10:19 PM, C W wrote: > Traceback (most recent call last): >File "/Users/Mike/Documents/Mike/main.py", line 95, in > main() >File "/Users/Mike/Documents/Mike/main.py", line 86, in main > args = get_feed() >File "/Users/Mike/DocumentsMike/main.py", line 32, in

RE: How do you debug in Python? Coming from a Matlab and R user. I'm already aware of pdb.

2021-01-27 Thread David Raymond
In regards to the various comments about adding in print() calls what I've found myself doing is to basically always use the logging module, and use logging.debug() for those. Somewhere at the top of the script I'll have a line like... DEBUG = False ...and when initializing the handler to

Re: How do you debug in Python? Coming from a Matlab and R user. I'm already aware of pdb.

2021-01-27 Thread Chris Angelico
On Wed, Jan 27, 2021 at 8:21 PM Chris Green wrote: > > Skip Montanaro wrote: > > CW> How do you troubleshooting/debugging in Python? > > > > GE> Mostly I read exception trace and read the code and think about it. > > GE> If that doesn't work, I add some print() or syslog() calls. > > > > CW> I

Re: How do you debug in Python? Coming from a Matlab and R user. I'm already aware of pdb.

2021-01-27 Thread Chris Green
Skip Montanaro wrote: > CW> How do you troubleshooting/debugging in Python? > > GE> Mostly I read exception trace and read the code and think about it. > GE> If that doesn't work, I add some print() or syslog() calls. > > CW> I know hardcore computer scientists would tell me about Python

Re: How do you debug in Python? Coming from a Matlab and R user. I'm already aware of pdb.

2021-01-26 Thread Cameron Simpson
On 27Jan2021 00:19, C W wrote: >Here's the code again, class should be called PERSONDatabase, >misspelled >earlier: >class PERSONDatabase: > def __init__(self, id, created_at, name, attend_date, distance): > self._id = id > self.created_at = created_at > self.name= name >

Re: How do you debug in Python? Coming from a Matlab and R user. I'm already aware of pdb.

2021-01-26 Thread joseph pareti
To debug python code I use spyder from the anaconda distribution Am Mittwoch, 27. Januar 2021 schrieb C W : > Hi Michael, > Here's the code again, class should be called PERSONDatabase, misspelled > earlier: > class PERSONDatabase: >def __init__(self, id, created_at, name, attend_date,

Re: How do you debug in Python? Coming from a Matlab and R user. I'm already aware of pdb.

2021-01-26 Thread C W
Hi Michael, Here's the code again, class should be called PERSONDatabase, misspelled earlier: class PERSONDatabase: def __init__(self, id, created_at, name, attend_date, distance): self._id = id self.created_at = created_at self.name= name self.attend_date = attend_date

Re: How do you debug in Python? Coming from a Matlab and R user. I'm already aware of pdb.

2021-01-26 Thread Michael Torrie
On 1/26/21 8:30 PM, Grant Edwards wrote: > Me too (MS in CSci), but I can't remember the last time I used a > debugger. I use a debugger frequency in C++, and sometimes C. Even running a debugger on an attached device like an Arduino is sometimes very useful. Good debuggers let you do things

Re: How do you debug in Python? Coming from a Matlab and R user. I'm already aware of pdb.

2021-01-26 Thread Michael Torrie
On 1/26/21 8:37 PM, C W wrote: > I have a naive question. How do I use traceback or trace the stack? In > particular, I'm using VS Code with Python interactive console. Show us the traceback here and we can help you interpret it. Copy and paste it from the VS Code console. > Say, I want to

Re: How do you debug in Python? Coming from a Matlab and R user. I'm already aware of pdb.

2021-01-26 Thread Dan Stromberg
On Tue, Jan 26, 2021 at 8:13 PM Dan Stromberg wrote: > > On Tue, Jan 26, 2021 at 4:01 PM C W wrote: > >> Hello everyone, >> >> I'm a long time Matlab and R user working on data science. How do you >> troubleshooting/debugging in Python? >> > > I frequently read tracebacks and think about what's

Re: How do you debug in Python? Coming from a Matlab and R user. I'm already aware of pdb.

2021-01-26 Thread Dan Stromberg
On Tue, Jan 26, 2021 at 4:01 PM C W wrote: > Hello everyone, > > I'm a long time Matlab and R user working on data science. How do you > troubleshooting/debugging in Python? > I frequently read tracebacks and think about what's up in the code. I also often add print functions or logging -

Re: How do you debug in Python? Coming from a Matlab and R user. I'm already aware of pdb.

2021-01-26 Thread Grant Edwards
On 2021-01-27, Cameron Simpson wrote: > Me either. Like grant, i fall into the "look at the stack trace and > think a bit, then put in print() calls or similar to show me whether > things are what I expect them to be when the code runs". > > I actually have a Computer Science degree, but I

Re: How do you debug in Python? Coming from a Matlab and R user. I'm already aware of pdb.

2021-01-26 Thread C W
Thanks for your replies. My apologies for the poor indent. I'm rewriting the code below. class NEODatabase: def __init__(self, id, created_at, name, attend_date, distance): self._id = id self.created_at = created_at self.name = name self.attend_date = attend_date self.distance = distance

Re: How do you debug in Python? Coming from a Matlab and R user. I'm already aware of pdb.

2021-01-26 Thread Ed Leafe
On Jan 26, 2021, at 18:16, Grant Edwards wrote: > >> How do you troubleshooting/debugging in Python? > > Mostly I read exception trace and read the code and think about it. > > If that doesn't work, I add some print() or syslog() calls. > > If I really get stuck, I try to write as small a

Re: How do you debug in Python? Coming from a Matlab and R user. I'm already aware of pdb.

2021-01-26 Thread William Ray Wing via Python-list
> On Jan 26, 2021, at 2:00 PM, C W wrote: > > Hello everyone, > > I'm a long time Matlab and R user working on data science. How do you > troubleshooting/debugging in Python? > Another approach is to run the code in an IDE. I happen to use Wing, but that is a coincidence. But almost ANY

Re: How do you debug in Python? Coming from a Matlab and R user. I'm already aware of pdb.

2021-01-26 Thread Cameron Simpson
On 26Jan2021 14:00, C W wrote: >I'm a long time Matlab and R user working on data science. How do you >troubleshooting/debugging in Python? > >I ran into this impossible situation to debug: >class person: >def __init__(self, id, created_at, name, attend_date, distance): >"""Create a new `person`.

Re: How do you debug in Python? Coming from a Matlab and R user. I'm already aware of pdb.

2021-01-26 Thread Skip Montanaro
CW> How do you troubleshooting/debugging in Python? GE> Mostly I read exception trace and read the code and think about it. GE> If that doesn't work, I add some print() or syslog() calls. CW> I know hardcore computer scientists would tell me about Python debugger. GE> I've been writing Python

Re: How do you debug in Python? Coming from a Matlab and R user. I'm already aware of pdb.

2021-01-26 Thread Grant Edwards
On 2021-01-26, C W wrote: > How do you troubleshooting/debugging in Python? Mostly I read exception trace and read the code and think about it. If that doesn't work, I add some print() or syslog() calls. If I really get stuck, I try to write as small a program as possible that demonstrates