Re: on writing a while loop for rolling two dice

2021-09-11 Thread Andrew Jaffe
On 11/09/2021 10:09, dn via Python-list wrote: The stated requirement is: "I'd like to get the number of times I tried". Given such: why bother with returning any of the pairs of values? Indeed, if that's the requirement, then you can do even better, noting that the probability of getting

Re: better handling of "pinned" modules?

2021-01-08 Thread Andrew Jaffe
On 08/01/2021 18:21, Chris Angelico wrote: On Sat, Jan 9, 2021 at 5:18 AM Andrew Jaffe wrote: Hi, I don't know if this makes more sense here or on "python-ideas" (or elsewhere?) but I'll try this first: I am starting to encounter more and more instances of packages requiring old

better handling of "pinned" modules?

2021-01-08 Thread Andrew Jaffe
Hi, I don't know if this makes more sense here or on "python-ideas" (or elsewhere?) but I'll try this first: I am starting to encounter more and more instances of packages requiring older, pinned, versions of modules, and this is occasionally actually starting to cause conflicts. It seems

Re: [Beginner] Spliting input

2020-06-25 Thread Andrew Jaffe
Hi, On 25/06/2020 12:50, Bischoop wrote: I try to split input numbers, for example: 12 so I cant add them, I tried separated split(' ') but it's not working. Any ideas how to do this? * numb1,numb2=input("enter 1st and 2nd no ").split() Avg=(int(numb1) + int(numb2)) / 2 print(Avg) So, this

Re: Behaviour of os.path.join

2020-05-27 Thread Andrew Jaffe
Dear all, \On 26/05/2020 15:56, BlindAnagram wrote: I came across an issue that I am wondering whether I should report as an issue. If I have a directory, say: base='C:\\Documents' and I use os.path.join() as follows: join(base, '..\\..\\', 'build', '') I obtain as expected from the

[issue30392] default webbrowser fails on macOS Sierra 10.12.5

2017-07-20 Thread Andrew Jaffe
Andrew Jaffe added the comment: 10.12.6 is out and the bug appears to be fixed... -- resolution: out of date -> third party status: pending -> closed ___ Python tracker <rep...@bugs.python.org> <http://bugs.python

[issue30392] default webbrowser fails on macOS Sierra 10.12.5

2017-05-24 Thread Andrew Jaffe
Andrew Jaffe added the comment: I'll also note that my bug report (radar) has been marked as "DUPLICATE OF 31898264 (OPEN)". So Apple is aware of the bug, and possibly not completely ignoring it. However, the opacity of the system is such that there is no way to get any further i

[issue30392] default webbrowser fails on macOS Sierra 10.12.5

2017-05-23 Thread Andrew Jaffe
Andrew Jaffe added the comment: Yes, it's a weird bug. see http://www.andrewjaffe.net/blog/2017/05/python-bug-hunt.html for more of the story so far. I have already filed a radar, and I hope this will get fixed at Apple, but it's a bug we need to live with for a while one way or the other

[issue30392] default webbrowser fails on macOS Sierra 10.12.5

2017-05-19 Thread Andrew Jaffe
Andrew Jaffe added the comment: This seems to be a bug in the `osascript` application in the latest macOS 10.12.5: $ osascript < open location "http://python.org; > EOF 0:33: execution error: "http://python.org; doesn’t understand the “open location”

[issue30392] default webbrowser fails on macOS Sierra 10.12.5

2017-05-18 Thread Andrew Jaffe
Andrew Jaffe added the comment: The same behaviour also happens under Apple's system Python 2.7.10. Perhaps this implies a macOS bug or deliberate behaviour change? (I couldn't find anything obviously appropriate in the list of security fixes for 10.12.5

[issue30392] default webbrowser fails on macOS Sierra 10.12.5

2017-05-17 Thread Andrew Jaffe
Changes by Andrew Jaffe <a.h.ja...@gmail.com>: -- title: default webbrowser not used on macOS Sierra 10.12.5 -> default webbrowser fails on macOS Sierra 10.12.5 ___ Python tracker <rep...@bugs.python.org> <http://bugs.pyt

[issue30392] default webbrowser not used on macOS Sierra 10.12.5

2017-05-17 Thread Andrew Jaffe
Andrew Jaffe added the comment: A few more details: - I believe this worked correctly under previous macOS versions (but I don't currently have access to any such machines). - This behaviour is identical under 3.6.1 and 2.7.13 (untested elsewhere) - Behaviour first noticed under Jupyter

[issue30392] default webbrowser not used on macOS Sierra 10.12.5

2017-05-17 Thread Andrew Jaffe
New submission from Andrew Jaffe: On the newly-released macOS Sierra 10.12.5, the default web browser which is meant to returned by webbrowser.get() gives an error. Specifically: >>> import webbrowser >>> br = webbrowser.get() >>> br.open("http://

[issue30392] default webbrowser not used on macOS Sierra 10.12.5

2017-05-17 Thread Andrew Jaffe
Changes by Andrew Jaffe <a.h.ja...@gmail.com>: -- title: default webbrowser macOS Sierra 10.12.5 -> default webbrowser not used on macOS Sierra 10.12.5 ___ Python tracker <rep...@bugs.python.org> <http://bugs.pyt

[issue30392] default webbrowser macOS Sierra 10.12.5

2017-05-17 Thread Andrew Jaffe
Changes by Andrew Jaffe <a.h.ja...@gmail.com>: -- components: Library (Lib), macOS nosy: Andrew.Jaffe, ned.deily, ronaldoussoren priority: normal severity: normal status: open title: default webbrowser macOS Sierra 10.12.5 type: behavior versions: Python 2.7, Pyth

Re: Pyhon 2.x or 3.x, which is faster?

2016-03-07 Thread Andrew Jaffe
On 06/03/2016 14:41, Steven D'Aprano wrote: On Sun, 6 Mar 2016 10:34 pm, Tony van der Hoff wrote: Hi, I've been experimenting with a short test program under python 2.7 and python 3.4.2. It's a simple read from file, and locate a word therein. I get the (subjective) impression that python2

OS X Python: can I explicitly set MACOSX_DEPLOYMENT_TARGET for extensions?

2015-10-19 Thread Andrew Jaffe
I use the python.org framework build of Python under recent versions of OS X (i.e., 10.11 El Capitan). I need to build some extensions that rely on recent versions of compilers (e.g., C++-11 features). However the python.org python is built to work on older systems as well, for backward

Re: Question About Running Python code

2014-10-16 Thread Andrew Jaffe
On 15/10/2014 23:50, ryguy7272 wrote: The error that I get is this. 'invalid syntax' The second single quote in this line is highlighted pink. print 'Downloading data from Yahoo for %s sector' % sector This is a script written for Python 2.*, but you say you are using Python 3.4. In Python

Re: Log base 2 of large integers

2014-08-13 Thread Andrew Jaffe
On 13/08/2014 14:46, Mok-Kong Shen wrote: Am 13.08.2014 15:32, schrieb Steven D'Aprano: Mok-Kong Shen wrote: I like to compute log base 2 of a fairly large integer n but with math.log(n,2) I got: OverflowError: long int too large to convert to float. Is there any feasible work-around for

Re: Python 3 on Mac OS X 10.8.4

2014-06-19 Thread Andrew Jaffe
On 19/06/2014 08:02, Une Bévue wrote: On my mac i do have : $ python --version Python 2.7.2 I want to install Python 3 such as python-3.4.0-macosx10.6.dmg avoiding disturbing the built-in version. Is that possible ? The python.org packages are explicitly created in order to have no conflict

[issue3588] sysconfig variable LINKFORSHARED has wrong value for MacOS X framework build

2013-02-27 Thread Andrew Jaffe
Andrew Jaffe added the comment: Was this actually fixed? As per http://bugs.python.org/issue16848 it affects python-config --ldflags which is used by various build systems. -- nosy: +Andrew.Jaffe ___ Python tracker rep...@bugs.python.org http

[issue16848] Mac OS X: python-config --ldflags and location of Python.framework

2013-02-27 Thread Andrew Jaffe
Andrew Jaffe added the comment: Will this be fixed? I note that the related LINKFORSHARED bug (which causes this, I think) is marked as resolved. -- nosy: +Andrew.Jaffe ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue16848

Re: classmethods, class variables and subclassing

2005-10-21 Thread Andrew Jaffe
Andrew Jaffe wrote: Hi, I have a class with various class-level variables which are used to store global state information for all instances of a class. These are set by a classmethod as in the following class sup(object): cvar1 = None cvar2 = None @classmethod

Re: classmethods, class variables and subclassing

2005-10-21 Thread Andrew Jaffe
Steve Holden wrote: Andrew Jaffe wrote: The problem is that I actually do want to call these methods on the class itself, before I've made any instances. Except you could use staticmethods with an explicit class argument ... Steve, Yep, that would work! Thanks. But it does seem like a bit

Re: classmethods, class variables and subclassing

2005-10-21 Thread Andrew Jaffe
Steve Holden wrote: Andrew Jaffe wrote: Steve Holden wrote: Andrew Jaffe wrote: The problem is that I actually do want to call these methods on the class itself, before I've made any instances. Except you could use staticmethods with an explicit class argument ... Yep, that would work

Re: classmethods, class variables and subclassing

2005-10-21 Thread Andrew Jaffe
Steven Bethard wrote: Andrew Jaffe wrote: I'm not sure if I understand your goal here, but you can get different behavior using super(). py class sup(object): ... cvar1 = None ... cvar2 = None ... @classmethod ... def setcvar1(cls, val): ... cls.cvar1 = val

classmethods, class variables and subclassing

2005-10-20 Thread Andrew Jaffe
Hi, I have a class with various class-level variables which are used to store global state information for all instances of a class. These are set by a classmethod as in the following (in reality the setcvar method is more complicated than this!): class sup(object): cvar1 = None