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 trac

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 to accept argparse.log_level parameter and propagate its value to all other modules

2021-01-27 Thread Zoran
Yes you are right. I changed the files: # main.py import argparse import mymodule import logging logger = logging.getLogger(__name__) def log_some_messages(): logger.debug(f'{__name__} - debug message') logger.info(f'{__name__} - info message') logger.warning(f'{__name__} - warning m

Re: For example: Question, moving a folder (T061RR7N1) containing a Specific file (ReadCMI), to folder: C:\\...\DUT0

2021-01-27 Thread Jason Friedman
> > > for path, dir, files in os.walk(myDestinationFolder): > # for path, dir, files in os.walk(destfolder): > print('The path is %s: ', path) > print(files) > os.chdir(mySourceFolder) > if not os.path.isfile(myDestinationFolder + file): > # if not os.path.isfile(destfolder + f

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: IDE tools to debug in Python?

2021-01-27 Thread Alan Gauld via Python-list
On 27/01/2021 19:27, Dietmar Schwertberger wrote: > Python is an interactive language. You can develop a lot while working > on a Python console. Then copy and paste into a program. Absolutely, the humble interactive prompt is often overlooked as a development tool. It's not as good as the "eval

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 know

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 -- https://mail.python

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 debugger

Re: IDE tools to debug in Python?

2021-01-27 Thread J. Pic
You're most welcome flaskee, however I would recommend you try them all. Thonny in particular because it distinguishes line from expression which I believe is a unique feature. Personally I have learned to love just pdb, and a whiteboard! Le mer. 27 janv. 2021 à 23:03, flaskee a écrit : > > Tha

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 a

For example: Question, moving a folder (T061RR7N1) containing a Specific file (ReadCMI), to folder: C:\\...\DUT0

2021-01-27 Thread Kevin M. Wilson via Python-list
for path, dir, files in os.walk(myDestinationFolder): # for path, dir, files in os.walk(destfolder): print('The path is %s: ', path) print(files) os.chdir(mySourceFolder) if not os.path.isfile(myDestinationFolder + file): # if not os.path.isfile(destfolder + file): prin

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 run

Re: IDE tools to debug in Python?

2021-01-27 Thread flaskee via Python-list
Thank you J. Pic. Out of everything today, (and given my priority is Python/Flask debugging) it looks like Wing IDE is something to dig into. Thanks Sent with ProtonMail Secure Email. ‐‐‐ Original Message ‐‐‐ On Wednesday, January 27, 2021 4:09 PM, J. Pic wrote: > Thonny, winpdb/win

Re: How to accept argparse.log_level parameter and propagate its value to all other modules

2021-01-27 Thread Peter Otten
On 27/01/2021 20:04, Zoran wrote: In the same folder I have three files: main.py, app_logger.py and mymodule.py with their contents: # main.py import argparse import app_logger import mymodule import logging logger = app_logger.get_logger(__name__) def log_some_messages(): logger.debug(f

Re: imalib cant get From: adresses

2021-01-27 Thread Barry Scott
Sigh you use a damaged email address for reply does not work. > On 27 Jan 2021, at 14:30, Bischoop wrote: > > > I don't have much experience with imaplib and for a few days can't > manage to get properly, I followed also some tutorial but also met few > problems. > What I want is to get email a

Re: IDE tools to debug in Python?

2021-01-27 Thread J. Pic
Thonny, winpdb/winpdb-rebord, eric4, pudb, web-pdb, vy, mu, netbeans, eclipse, pdbpp... Also see: https://wiki.python.org/moin/PythonDebuggingTools "Changing a variable" -> that's basically evaluating code ? -> supported in all debuggers I suppose -- https://mail.python.org/mailman/listinfo/pyth

Re: IDE tools to debug in Python?

2021-01-27 Thread Paul Bryan via Python-list
My experience with IntelliJ (related to PyCharm): it scans all source files in the project, compiles them, graphs all dependencies, compiles those (if necessary) or inspects their class bytecode, and so on to build a full graph in memory to support showing errors in real time (highlighting in sourc

Re: IDE tools to debug in Python?

2021-01-27 Thread C W
I meant bottom right corner, not left. opps! On Wed, Jan 27, 2021 at 3:36 PM C W wrote: > I don't know exactly, but it shows as inspection on the bottom left corner. > > I believe it's indexing in the background. > > On Wed, Jan 27, 2021 at 3:25 PM Grant Edwards > wrote: > >> On 2021-01-27, C W

Re: IDE tools to debug in Python?

2021-01-27 Thread C W
I don't know exactly, but it shows as inspection on the bottom left corner. I believe it's indexing in the background. On Wed, Jan 27, 2021 at 3:25 PM Grant Edwards wrote: > On 2021-01-27, C W wrote: > > I'm not expert in Python, but I sure tried many IDEs to kick off Python > > programming. >

Re: IDE tools to debug in Python?

2021-01-27 Thread Grant Edwards
On 2021-01-27, C W wrote: > I'm not expert in Python, but I sure tried many IDEs to kick off Python > programming. > > I started with PyCharm, but I had a problem with it constantly scanning the > background, even after I turned that feature off. What is it scanning? > My favorite (I'm using now

Re: imalib cant get From: adresses

2021-01-27 Thread Bischoop
On 2021-01-27, Bischoop wrote: Solved using IMAP4.uid. -- https://mail.python.org/mailman/listinfo/python-list

Re: IDE tools to debug in Python?

2021-01-27 Thread flaskee via Python-list
" also started background scanning, but that's generally done in 30 seconds." Do we know what PyCharm is background scanning for? Do we know what VS Code is scanning for? I've been leery of VS* things since 2013, when Microsoft (secretly) changed their VS compiler, so that every single .exe, .dl

Re: IDE tools to debug in Python?

2021-01-27 Thread Dietmar Schwertberger
On 27.01.2021 20:07, C W wrote: I'm not expert in Python, but I sure tried many IDEs to kick off Python programming. I started with PyCharm, but I had a problem with it constantly scanning the background, even after I turned that feature off. My favorite (I'm using now) is VS Code with Python e

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 years

Re: IDE tools to debug in Python?

2021-01-27 Thread C W
I'm not expert in Python, but I sure tried many IDEs to kick off Python programming. I started with PyCharm, but I had a problem with it constantly scanning the background, even after I turned that feature off. My favorite (I'm using now) is VS Code with Python extension, it's very light. Recentl

How to accept argparse.log_level parameter and propagate its value to all other modules

2021-01-27 Thread Zoran
In the same folder I have three files: main.py, app_logger.py and mymodule.py with their contents: # main.py import argparse import app_logger import mymodule import logging logger = app_logger.get_logger(__name__) def log_some_messages(): logger.debug(f'{__name__} - debug message') log

Re: IDE tools to debug in Python?

2021-01-27 Thread Michał Jaworski
PyCharm has all these debugging capabilities and there is a community edition that you can use for free. If you earn for the living with Python it is worth investing in professional edition though. Michał Jaworski > Wiadomość napisana przez flaskee via Python-list w > dniu 27.01.2021, o god

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 d

IDE tools to debug in Python?

2021-01-27 Thread flaskee via Python-list
While print() is groovy and all, if anyone runs across a non-pdb python debugger (standalone or IDE-based) please let me know. I too was blessed with IDE-based debugging (in the 90's!) * where you can set break point(s); * have the program stop right before a suspected failure point; * check

asyncio: Gather over growing list of tasks

2021-01-27 Thread Justin Paston-Cooper
Hello, Let's say I have a loop where at each iteration, a task which makes an HTTP request to some endpoint is generated, and then the loop sleeps for n seconds. These tasks may throw exceptions. I can call asyncio.gather on these tasks once the loop has finished, but I actually want to stop the

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 get_

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 stdo

imalib cant get From: adresses

2021-01-27 Thread Bischoop
I don't have much experience with imaplib and for a few days can't manage to get properly, I followed also some tutorial but also met few problems. What I want is to get email addresses from emails I do have in gmail inbox. The code below gets them but then pops an error. When I change the part "

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 kn

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 debugge

error

2021-01-27 Thread Maziar Ghasemi
Hi i`m use eric6 to python 3.9.1 . when open eric see this: Warning: translation file 'git_en_US' could not be loaded. Using default. and when i try to do repair`s python I see: "C:/user/mazya/AppData/Local/programs/python/python39/python39.dll Verify that you have access to that directory." Please