Re: OOP - how to abort an __init__ when the initialisation code fails ?

2019-11-05 Thread R.Wieser
Chris, > "Control flow" is anything that changes the order that your code runs. My apologies, I should have said "a control flow mechanism" /in this context/ (though I assumed that as implicite, as I quoted the text from the OP). Case in point, the __init__ code (of a class object) can result

Re: OOP - how to abort an __init__ when the initialisation code fails ?

2019-11-05 Thread Chris Angelico
On Tue, Nov 5, 2019 at 8:46 PM R.Wieser wrote: > > Chris, > > > "Control flow" is anything that changes the order that your code runs. > > My apologies, I should have said "a control flow mechanism" /in this > context/ (though I assumed that as implicite, as I quoted the text from the > OP). > > C

Re: __instancecheck__ metaclasses, how do they work: why do I get True when I tuple, why doesn't print run?

2019-11-05 Thread Rhodri James
On 04/11/2019 22:23, Peter J. Holzer wrote: On 2019-11-04 14:54:23 +, Rhodri James wrote: On 04/11/2019 14:33, Veek M wrote: __metaclass__ = whatever; # is python2.x syntax But not Python3: see PEP 3115 Doesn't "X is python2.x syntax" imply "X is not python3 syntax"? Not necessarily,

Re: Is there some python libary for edit iso file drectly?

2019-11-05 Thread Grant Edwards
On 2019-11-05, Michael Torrie wrote: > On 11/4/19 4:11 PM, Hongyi Zhao wrote: >> Is there some python libary for edit iso file drectly? > > Isn't an ISO image a read-only sort of thing? Yes. > If you want to modify files don't you have to create a whole new > image? Yes. "Edit an ISO image" co

Pip not available

2019-11-05 Thread Ethan Woo
Dear person reading this, I was using Python 3.7.4 for a project, and I needed to install the *playsound* function. I looked through online and saw that I needed to use pip. However, it didn't work. I looked online and saw that I needed to install it through the application, however, now th

Re: __instancecheck__ metaclasses, how do they work: why do I get True when I tuple, why doesn't print run?

2019-11-05 Thread Pieter van Oostrum
Chris Angelico writes: > On Tue, Nov 5, 2019 at 5:43 PM dieter wrote: >> I suppose that "isinstance" (at least under Python 2) does not >> behave exactly as stated in PEP 3119. Instead, "isinstance" >> first directly checks for the instance to be an instance of the >> class *AND ONLY IF THIS FAI

Re: Pip not available

2019-11-05 Thread Pankaj Jangid
Ethan Woo writes: > I was using Python 3.7.4 for a project, and I needed to install the > *playsound* function. I looked through online and saw that I needed to use > pip. However, it didn't work. I looked online and saw that I needed to > install it through the application, however, now

Re: Is there some python libary for edit iso file drectly?

2019-11-05 Thread robin deatherage
On Tuesday, November 5, 2019 at 7:11:30 AM UTC+8, Hongyi Zhao wrote: > Is there some python libary for edit iso file drectly? You can use batch .bat files and have Python execute them. Honestly Batch will do all you are asking on MS Windows. Use its XCOPY to copy the IO file or the entire IO Dir

Re: permission denied using python 3.8

2019-11-05 Thread robin deatherage
On Tuesday, November 5, 2019 at 10:06:49 AM UTC+8, Francois van Lieshout wrote: > Hi, i installed python 3.8 the latest version but it doesn’t work, i get > “permission denied” when trying to acces python in the CLI and also i can’t > run my code from my python files in the command-line nor in ID

How execute at least two python files at once when imported?

2019-11-05 Thread Spencer Du
Hi I want to execute at least two python files at once when imported but I dont know how to do this. Currently I can only import each file one after another but what i want is each file to be imported at the same time. Can you help me write the code for this? embedded.py is the main file to exe

Aw: How execute at least two python files at once when imported?

2019-11-05 Thread Karsten Hilbert
> I want to execute at least two python files at once when imported but I dont > know how to do this. > Currently I can only import each file one after another but what i want is > each file to be imported > at the same time. Can you explain why that seems necessary ? Karsten -- https://mail.p

Re: How execute at least two python files at once when imported?

2019-11-05 Thread Bob Gailer
On Nov 5, 2019 1:35 PM, "Spencer Du" wrote: > > Hi > > I want to execute at least two python files at once when imported but I dont know how to do this. Currently I can only import each file one after another but what i want is each file to be imported at the same time. Can you help me write the c

Re: How execute at least two python files at once when imported?

2019-11-05 Thread Rhodri James
On 05/11/2019 18:33, Spencer Du wrote: I want to execute at least two python files at once when imported but I dont know how to do this. Currently I can only import each file one after another but what i want is each file to be imported at the same time. That is a very odd requirement. Why wou

Re: Friday finking: TDD and EAFP

2019-11-05 Thread Barry Scott
> On 1 Nov 2019, at 05:40, DL Neil via Python-list > wrote: > > Is the practice of TDD fundamentally, if not philosophically, somewhat > contrary to Python's EAFP approach? > > > TDD = Test-Driven Development > EAFP = it's easier to ask forgiveness than permission > * WebRefs as footnote >

Re: OOP - how to abort an __init__ when the initialisation code fails ?

2019-11-05 Thread Peter J. Holzer
On 2019-11-04 18:18:39 -0300, Luciano Ramalho wrote: > In addition, as Rob said, it is usually a bad idea to wrap several > lines of code in a single try/except block I disagree with this. While it is sometimes useful to wrap a single line, in my experience it rarely is. The scope of the try ... e

Re: How execute at least two python files at once when imported?

2019-11-05 Thread Terry Reedy
On 11/5/2019 1:33 PM, Spencer Du wrote: I want to execute at least two python files at once when imported but I dont know how to do this. Currently I can only import each file one after another but what i want is each file to be imported at the same time. Can you help me write the code for th

Re: permission denied using python 3.8

2019-11-05 Thread Terry Reedy
On 11/5/2019 12:26 PM, robin deatherage wrote: Also there is no limit to how many different versions of Python you use on Windows---As long as you have a different UAC Control user logged in Windows for each one you add. I have 2.75, 3.5, 3.6, 3.7.0 and now 3.8 on my Windows now and all work

Re: Pip not available

2019-11-05 Thread Terry Reedy
On 11/5/2019 5:22 AM, Ethan Woo wrote: [image: image.png] This, like most PSF lists, is text only. -- Terry Jan Reedy -- https://mail.python.org/mailman/listinfo/python-list

Re: OOP - how to abort an __init__ when the initialisation code fails ?

2019-11-05 Thread Rob Gaddi
On 11/5/19 11:52 AM, Peter J. Holzer wrote: On 2019-11-04 18:18:39 -0300, Luciano Ramalho wrote: In addition, as Rob said, it is usually a bad idea to wrap several lines of code in a single try/except block I disagree with this. While it is sometimes useful to wrap a single line, in my experie

Re: OOP - how to abort an __init__ when the initialisation code fails ?

2019-11-05 Thread Gregory Ewing
Peter J. Holzer wrote: On 2019-11-04 18:18:39 -0300, Luciano Ramalho wrote: In addition, as Rob said, it is usually a bad idea to wrap several lines of code in a single try/except block I disagree with this. While it is sometimes useful to wrap a single line, in my experience it rarely is. T

Re: What PEPs are worth reading after you've read a textbook/Beazley but want to understand details/innerworkings

2019-11-05 Thread Gregory Ewing
Gilmeh Serda wrote: Can't wait until we get to PEP 84657675, or PEP 33 PEP TREE(3) promises to be even more exciting! -- Greg -- https://mail.python.org/mailman/listinfo/python-list

Re: permission denied using python 3.8

2019-11-05 Thread Eryk Sun
On 11/5/19, robin deatherage wrote: > > MS Windows uses a UAC User Control. So it is best to not add a package > to an Admin user on Windows. The OP would have to install Python in a location that that's inaccessible to standard users and add this directory to the system PATH. It's dysfunctional

Re: permission denied using python 3.8

2019-11-05 Thread Eryk Sun
On 11/5/19, robin deatherage wrote: > > MS Windows uses a UAC User Control. So it is best to not add a package > to an Admin user on Windows. The OP would have to install Python in a location that that's inaccessible to standard users and add this directory to the system PATH. It's dysfunctional