Re: Full stack trace in pdb.post_mortem() ?

2019-11-03 Thread dieter
John W writes: > I'm trying to understand pdb.post_mortem(), and why the backtrace > available in the debugger session seems limited. > > I posted a similar question on stackoverflow[1], but figured I'd try > here as well. > > Here's a simple program > > import pdb > > def inner(): >

Re: error with installing a package(matplotlib)

2019-11-03 Thread dieter
thodoris doultsinos writes: > I have been encountering problems with installing packages on python. I am > using windows 10, pycharm and pip install order in command prompt to > install packages.At first I had an error with installing numpy (something > with visual c++ so i downloaded them and it

Re: Issue with running programs in Python and imports, probably directories messed up

2019-11-03 Thread dieter
Vladyslav Verteletskyi writes: > I have stuck upon a problem with all of my attempts to import libraries to > Python. Find the > screenshots enclosed. This is a text only list: we (at least most of us) do not see attachments (such as attached screenshots). Use functions of your (windows) sys

Re: Trouble trying to get started with pygame

2019-11-03 Thread originallmoney
On Sunday, November 3, 2019 at 9:40:05 PM UTC-5, MRAB wrote: > On 2019-11-04 01:52, originallmo...@gmail.com wrote: > > On Friday, November 1, 2019 at 11:17:42 PM UTC-4, MRAB wrote: > >> On 2019-11-02 02:28, originallmo...@gmail.com wrote: > >> > I tried what you suggested at the command prompt and

Re: Friday finking: TDD and EAFP

2019-11-03 Thread Ethan Furman
On 10/31/2019 10:40 PM, DL Neil via Python-list wrote: Is the practice of TDD fundamentally, if not philosophically, somewhat contrary to Python's EAFP approach? Not at all. To use the maths example that's been going around: def sqrt(number): ... return some_value Your tests shou

Re: What's the difference between running a script under command box and interpreter?

2019-11-03 Thread Chris Angelico
On Mon, Nov 4, 2019 at 3:16 PM wrote: > > Chris Angelico於 2019年11月4日星期一 UTC+8上午10時19分50秒寫道: > > On Mon, Nov 4, 2019 at 1:01 PM wrote: > > > > > > Chris Angelico於 2019年11月4日星期一 UTC+8上午8時43分07秒寫道: > > > > Ah, that's a fair point. If you specifically WANT that behaviour, what > > > > you can do is i

Re: What's the difference between running a script under command box and interpreter?

2019-11-03 Thread jfong
Chris Angelico於 2019年11月4日星期一 UTC+8上午10時19分50秒寫道: > On Mon, Nov 4, 2019 at 1:01 PM wrote: > > > > Chris Angelico於 2019年11月4日星期一 UTC+8上午8時43分07秒寫道: > > > Ah, that's a fair point. If you specifically WANT that behaviour, what > > > you can do is invoke the script interactively: > > > > > > python3 -

Re: Trouble trying to get started with pygame

2019-11-03 Thread MRAB
On 2019-11-04 01:52, originallmo...@gmail.com wrote: On Friday, November 1, 2019 at 11:17:42 PM UTC-4, MRAB wrote: On 2019-11-02 02:28, originallmo...@gmail.com wrote: > I tried what you suggested at the command prompt and (Despite being able to open Python from my start menu), it tells me Pyth

Re: What's the difference between running a script under command box and interpreter?

2019-11-03 Thread Chris Angelico
On Mon, Nov 4, 2019 at 1:01 PM wrote: > > Chris Angelico於 2019年11月4日星期一 UTC+8上午8時43分07秒寫道: > > Ah, that's a fair point. If you specifically WANT that behaviour, what > > you can do is invoke the script interactively: > > > > python3 -i test.py > > > > That'll run the script as normal, and then dro

Re: What's the difference between running a script under command box and interpreter?

2019-11-03 Thread jfong
Chris Angelico於 2019年11月4日星期一 UTC+8上午8時43分07秒寫道: > On Mon, Nov 4, 2019 at 11:36 AM wrote: > > > > Peter J. Holzer於 2019年11月4日星期一 UTC+8上午3時59分36秒寫道: > > > On 2019-11-01 04:24:38 -0700, jf...@ms4.hinet.net wrote: > > > > > The globals are your current module's namespace, and functions defines > > >

Re: Trouble trying to get started with pygame

2019-11-03 Thread originallmoney
On Friday, November 1, 2019 at 11:17:42 PM UTC-4, MRAB wrote: > On 2019-11-02 02:28, originallmo...@gmail.com wrote: > > I tried what you suggested at the command prompt and (Despite being able to > > open Python from my start menu), it tells me Python isn't installed. > > > > I'm curious, and, I

Re: What's the difference between running a script under command box and interpreter?

2019-11-03 Thread Cameron Simpson
On 03Nov2019 16:34, Jach Fong wrote: Peter J. Holzer於 2019年11月4日星期一 UTC+8上午3時59分36秒寫道: It's not really "the interpreter" (I think you mean the REPL) which has it's own globals. Every module/file has its own globals. The same thing happens non-interactively: % cat test.py def main(): prin

Re: What's the difference between running a script under command box and interpreter?

2019-11-03 Thread Chris Angelico
On Mon, Nov 4, 2019 at 11:36 AM wrote: > > Peter J. Holzer於 2019年11月4日星期一 UTC+8上午3時59分36秒寫道: > > On 2019-11-01 04:24:38 -0700, jf...@ms4.hinet.net wrote: > > > > The globals are your current module's namespace, and functions defines > > > > in a module are bound to that module's namespace. > > > >

Re: What's the difference between running a script under command box and interpreter?

2019-11-03 Thread jfong
Peter J. Holzer於 2019年11月4日星期一 UTC+8上午3時59分36秒寫道: > On 2019-11-01 04:24:38 -0700, jf...@ms4.hinet.net wrote: > > > The globals are your current module's namespace, and functions defines > > > in a module are bound to that module's namespace. > > > > > > Strip your test.py back. A lot. Try this: >

Re: Friday finking: TDD and EAFP

2019-11-03 Thread Terry Reedy
Some general thoughts on core development and testing. For bugs.python.org issues, the first Stage choice is 'test needed'. All code patches *should* include new tests. This was not always so, and we are still paying off technical debt. One problem I have encountered with idlelib is that som

Re: Friday finking: TDD and EAFP

2019-11-03 Thread Peter J. Holzer
On 2019-11-04 08:14:37 +1300, DL Neil via Python-list wrote: > Perhaps 'Python pros' don't use TDD. Which in-and-of-itself, somewhat > answers the question! A certain Youtube channel has T-shirts for sale with this text: DON'T TRY THIS AT HOME WE ARE PROFESSIONALS because we get paid

Re: Friday finking: TDD and EAFP

2019-11-03 Thread Peter J. Holzer
On 2019-11-01 18:40:06 +1300, DL Neil via Python-list wrote: > In other words, before you do anything with some data, check that it is what > you think it is. Whereas in Python we "try" by assuming everything is > compos-mentis* and handle the "except" when things are not how we'd like. > > That a

Re: Friday finking: TDD and EAFP

2019-11-03 Thread Peter J. Holzer
On 2019-11-04 07:41:32 +1300, DL Neil via Python-list wrote: > On 3/11/19 6:30 AM, Bev In TX wrote: > > > On Nov 1, 2019, at 12:40 AM, DL Neil via Python-list > > > mailto:python-list@python.org>> wrote: > > > > > > Is the practice of TDD fundamentally, if not philosophically, > > > somewhat contr

Re: What's the difference between running a script under command box and interpreter?

2019-11-03 Thread Peter J. Holzer
On 2019-11-01 04:24:38 -0700, jf...@ms4.hinet.net wrote: > > The globals are your current module's namespace, and functions defines > > in a module are bound to that module's namespace. > > > > Strip your test.py back. A lot. Try this: > > > > def main(): > > print(rule) > > > > Now,

Re: Friday finking: TDD and EAFP

2019-11-03 Thread DL Neil via Python-list
On 2/11/19 4:32 PM, boB Stepp wrote: On Fri, Nov 1, 2019 at 12:42 AM DL Neil via Python-list wrote: Is the practice of TDD fundamentally, if not philosophically, somewhat contrary to Python's EAFP approach? [...] In encouraging my mind to think about testing the code, I find myself searching

Re: Friday finking: TDD and EAFP

2019-11-03 Thread DL Neil via Python-list
On 3/11/19 6:30 AM, Bev In TX wrote: On Nov 1, 2019, at 12:40 AM, DL Neil via Python-list mailto:python-list@python.org>> wrote: Is the practice of TDD fundamentally, if not philosophically, somewhat contrary to Python's EAFP approach? I’m not an expert on either TDD or Python, but as no one