Re: sum() vs. loop

2021-10-13 Thread Oscar Benjamin
On Mon, 11 Oct 2021 at 23:00, Christian Gollwitzer wrote: > > Am 10.10.21 um 10:49 schrieb Steve Keller: > > I have found the sum() function to be much slower than to loop over the > > operands myself: > > > > def sum_products(seq1, seq2): > > return sum([a * b for a, b in zip(seq1, seq2)]) >

Re: Does loading PDB slow down execution?

2021-10-27 Thread Benjamin Schollnick
> On Oct 27, 2021, at 1:01 PM, Unixnut wrote: > > On 06/10/2021 18:30, Dieter Maurer wrote: >> Unixnut wrote at 2021-10-3 22:03 +0100: >>> If I run a python3 program with "import pdb" in the code, would it >>> execute slower than without loading the debugger? >> Importing `pdb` does not slow do

Re: Why so fast a web framework?

2021-10-29 Thread Benjamin Schollnick
the levels are: 256, 1024, 4096, and 16384. That can’t be the concurrency/thread count??!?!?!?? I can believe 1,000 - 3,000, outrageously high, but believable. But 16K worth of concurrency/threads? I doubt that Wikipedia even has to dial it that high? I have to give them points for providing API latency, and framework overhead…. - Benjamin -- https://mail.python.org/mailman/listinfo/python-list

Re: pyinstaller wrong classified as Windows virus

2021-11-29 Thread Benjamin Schollnick
not. But if there is no reputation (eg no one has ever run it), that’s suspicious. And that’s what you are running into. You can submit the EXE to the defender team, which should allow it to operate properly without any issue. - Benjamin > On Nov 29, 2021, at 1:57 PM, Ba

Re: pyinstaller wrong classified as Windows virus

2021-11-29 Thread Benjamin Schollnick
der will either allow it to >> run or not. >> But if there is no reputation (eg no one has ever run it), that’s >> suspicious. And that’s what you are running into. >> You can submit the EXE to the defender team, which should allow it to >> operate properly with

Re: Call julia from Python: which package?

2021-12-17 Thread Oscar Benjamin
On Fri, 17 Dec 2021 at 15:04, Albert-Jan Roskam wrote: > > Hi, > > I have a Python program that uses Tkinter for its GUI. It's rather slow so I > hope to replace many or all of the non-GUI parts by Julia code. Has anybody > experience with this? Any packages you can recommend? I found three > a

Re: Call julia from Python: which package?

2021-12-17 Thread Oscar Benjamin
On Fri, 17 Dec 2021 at 22:40, Chris Angelico wrote: > > On Sat, Dec 18, 2021 at 9:24 AM Oscar Benjamin > wrote: > > When I timed the result in Julia and in Python I found that the Julia > > code was slower than the Python code. Of course I don't know how to > > op

Re: Call julia from Python: which package?

2021-12-17 Thread Oscar Benjamin
On Fri, 17 Dec 2021 at 23:11, Chris Angelico wrote: > > On Sat, Dec 18, 2021 at 10:01 AM Oscar Benjamin > wrote: > > > > On Fri, 17 Dec 2021 at 22:40, Chris Angelico wrote: > > > > > > On Sat, Dec 18, 2021 at 9:24 AM Oscar Benjamin > > > wrote:

Re: Pypy with Cython

2022-02-03 Thread Oscar Benjamin
On Thu, 3 Feb 2022 at 23:16, Greg Ewing wrote: > > On 4/02/22 5:07 am, Albert-Jan Roskam wrote: > > On Feb 3, 2022 17:01, Dan Stromberg wrote: > > > > What profiler do you recommend > > If it runs for that long, just measuring execution time should > be enough. Python comes with a "timeit

Re: Best way to check if there is internet?

2022-02-25 Thread Benjamin Schollnick
n be made of Bash, PHP, Perl, and a few other languages as well. How many “scripts” have been throw quickly together in Perl, or PHP? Quite a damn few, yet, would anyone call Wordpress a “script”? It’s effectively damning with faint praise. - Benjamin -- https://mail.python.org/mailman/listinfo/python-list

Re: C is it always faster than nump?

2022-02-25 Thread Oscar Benjamin
On Fri, 25 Feb 2022 at 23:13, Barry wrote: > > > On 25 Feb 2022, at 23:00, Richard Damon wrote: > > > > On 2/25/22 2:47 PM, Chris Angelico wrote: > >>> On Sat, 26 Feb 2022 at 05:49, Richard Damon > >>> wrote: > >>> On 2/25/22 4:12 AM, BELAHCENE Abdelkader wrote: > Hi, > a lot of peop

Re: C is it always faster than nump?

2022-02-25 Thread Oscar Benjamin
On Sat, 26 Feb 2022 at 03:10, Dennis Lee Bieber wrote: > > On Fri, 25 Feb 2022 23:06:57 + (UTC), Avi Gross > declaimed the following: > > >I do have to wonder if anyone ever considered adding back enough > >functionality into base Python to make some additions less needed. Is there > >any r

Re: Why doesn't my finaliser run here?

2016-09-04 Thread Oscar Benjamin
On 4 Sep 2016 13:27, "Steve D'Aprano" wrote: > > Why doesn't __del__ run here? > > > class Eggs(object): > def __new__(cls): > instance = object.__new__(cls) > print("instance created successfully") > return instance > def __init__(self): > print("self defin

Re: Obtain the raw line of text read by CSVDictReader when reporting errors?

2016-09-21 Thread Oscar Benjamin
On 21 September 2016 at 21:28, Malcolm Greene wrote: > Looking for ideas on how I can obtain the raw line of text read by a > CSVDictReader. I've reviewed the CSV DictReader documentation and there > are no public attributes that expose this type of data. > > My use case is reporting malformed lin

[RELEASE] Python 2.7.13 release candidate 1

2016-12-03 Thread Benjamin Peterson
://bugs.python.org A final release is scheduled for 2 weeks time. Servus, Benjamin (on behalf of all of 2.7's contributors) -- https://mail.python.org/mailman/listinfo/python-list

[RELEASE] Python 2.7.13

2016-12-17 Thread Benjamin Peterson
: https://bugs.python.org/ 2.7.14 will appear mid-2017. All the best in the new year, Benjamin Peterson 2.7 release manager -- https://mail.python.org/mailman/listinfo/python-list

[RELEASE] Python 2.7.15 release candidate 1

2018-04-14 Thread Benjamin Peterson
ship with a built-in copy of OpenSSL. Additionally, there is a new additional installer variant for macOS 10.9+ that includes a built-in version of Tcl/Tk 8.6. See the installer README for more information. Thank you, Benjamin (on behalf of 2.7's release team and contributors)

[RELEASE] Python 2.7.15

2018-04-30 Thread Benjamin Peterson
macOS installers now ship with a builtin copy of OpenSSL. Additionally, there is a new additional installer variant for macOS 10.9+ that includes a built-in version of Tcl/Tk 8.6. See the installer README for more information. Happy May, Benjamin 2.7 release manager -- https://mail.python.org/ma

Re: Dealing with errors in interactive subprocess running python interpreter that freeze the process

2018-08-03 Thread Oscar Benjamin
On 2 August 2018 at 20:54, wrote: > >> As others have mentioned, separate threads for the individual pipes >> may help, or if you need to go that far there are specialised >> libraries, I believe (pexpect is one, but from what I know it's fairly >> Unix-specific, so I'm not very familiar with it)

Re: Partitioning a list

2018-08-23 Thread Oscar Benjamin
On Thu, 23 Aug 2018 at 15:32, Sibylle Koczian wrote: > > Am 21.08.2018 um 23:36 schrieb Poul Riis: > > I would like to list all possible ways to put N students in groups of k > > students (suppose that k divides N) with the restriction that no two > > students should ever meet each other in more

Re: Generating a specific list of intsgers

2018-08-25 Thread Oscar Benjamin
On Sat, 25 Aug 2018 at 18:12, wrote: > > On Saturday, August 25, 2018 at 9:46:21 AM UTC-5, Richard Damon wrote: > > On 8/25/18 10:27 AM, Dennis Lee Bieber wrote: > > > On Sat, 25 Aug 2018 03:56:28 + (UTC), Steven D'Aprano > > > declaimed the following: > > > > > >> On Fri, 24 Aug 2018 14:40:0

Re: Generating a specific list of intsgers

2018-08-26 Thread Oscar Benjamin
On Sat, 25 Aug 2018 at 20:27, Musatov wrote: > > On Saturday, August 25, 2018 at 2:18:09 PM UTC-5, Musatov wrote: > > On Saturday, August 25, 2018 at 1:52:17 PM UTC-5, Oscar Benjamin wrote: > > > > > > > > > > > >> On Fri, 24 Aug 2018 14:40:00 -

Re: Generating a specific list of intsgers

2018-08-26 Thread Oscar Benjamin
On Sun, 26 Aug 2018 at 20:32, Musatov wrote: > > On Sunday, August 26, 2018 at 2:14:29 PM UTC-5, Oscar Benjamin wrote: > > > > > > > >> On Fri, 24 Aug 2018 14:40:00 -0700, tomusatov wrote: > > > > > > > >> > > > &g

Re: Writing a program to illustrate a fractal

2018-08-26 Thread Oscar Benjamin
On Sun, 26 Aug 2018 at 20:52, Musatov wrote: > > Thank you, Richard. If anyone is interested further, even in writing a Python > code to generate the sequence or further preparing of an animation I would be > delighted. It would not take long to write code to plot your sequence if you first cov

Re: Question about floating point

2018-08-29 Thread Oscar Benjamin
On Tue, 28 Aug 2018 at 15:50, Frank Millman wrote: > > "Frank Millman" wrote in message news:pm3l2m$kv4$1...@blaine.gmane.org... > > > > I know about this gotcha - > > > > >>> x = 1.1 + 2.2 > > >>> x > > 3.3003 > > > [...] > > > > >>> y = 3.3 > > >>> y > > 3.3 > > > [...] > > > > >>>

Re: Debug script under pdb, how to avoid a bunch of errors caused by the exit()?

2018-09-06 Thread Oscar Benjamin
On Thu, 6 Sep 2018 at 10:59, Jach Fong wrote: > > Here the script file, test0.py: > -- > password = 'bad' > if password == 'bad': > print('bad password') > exit() > else: > print('good password') > > print('something else to do') > >

Re: Why emumerated list is empty on 2nd round of print?

2018-09-07 Thread Oscar Benjamin
On Fri, 7 Sep 2018 at 16:25, Schachner, Joseph wrote: >... > Now, on to the second part: the problem you showed - that you can only loop > through aList:print(i,j) once - is BECAUSE you hung onto it from one loop to > another. Once the iterator is exhausted, it's exhausted. > > Think of another

dll file missing error

2018-09-16 Thread benjamin bulley
I encounter a dll error message while trying to run python. I uninstalled the program just to reinstall to find the same problem. Please help as I am quite new to this. -- https://mail.python.org/mailman/listinfo/python-list

Re: Need to find the centroid of a circular camera image

2018-09-23 Thread Oscar Benjamin
On Sun, 23 Sep 2018 at 20:45, Gene Heskett wrote: > > save the image and locate the centroid of that saved image. > > Is there code to do that centroid math in somebodies "bottom desk > drawer"? Something I could download and control with a bash script which > I'm fair at? This is easy enough to

Re: sympy

2016-03-31 Thread Oscar Benjamin
On 31 March 2016 at 11:57, Poul Riis wrote: > > ... However, the sympy way seems to be about 70 times slower than using the > derivative calculated 'by hand' (try the example below). > Can it be done in a more efficient way? > > Poul Riis > > > > from sympy import * > from time import * > x=Symbo

Re: sympy

2016-03-31 Thread Oscar Benjamin
On 31 March 2016 at 22:33, Poul Riis wrote: > Den onsdag den 30. marts 2016 kl. 13.17.33 UTC+2 skrev Poul Riis: >> Is it possible to transfer results from sympy to 'normal' python. >> >> In the case below I think my intention is clear enough but it does not work >> as intended. How can it be done

Re: Plot/Graph

2016-04-03 Thread Oscar Benjamin
On 3 Apr 2016 22:21, "Muhammad Ali" wrote: > > How do I convert/change/modify python script so that my data could be extracted according to python script and at the end it generates another single extracted data file instead of displaying/showing some graph? So that, I can manually plot the newly

Re: ANN: intervalset Was: Set type for datetime intervals

2016-04-04 Thread Oscar Benjamin
On 4 April 2016 at 16:09, Random832 wrote: > On Mon, Apr 4, 2016, at 03:12, Nagy László Zsolt wrote: >> >> Hi All, >> >> If anyone is interested, a module was born: >> >> https://bitbucket.org/nagylzs/intervalset >> https://pypi.python.org/pypi/intervalset/0.1.1 > > I don't know if I like it bei

Re: Request to mailing list Python-list rejected

2016-04-05 Thread Oscar Benjamin
On 5 Apr 2016 03:50, wrote: > > Your request to the Python-list mailing list > > Posting of your message titled "Re: Plot/Graph" > > has been rejected by the list moderator. The moderator gave the > following reason for rejecting your request: > > "Your message was too big; please trim unnece

Re: python script for .dat file

2016-04-05 Thread Oscar Benjamin
On 5 April 2016 at 16:44, Muhammad Ali wrote: > On Tuesday, April 5, 2016 at 8:30:27 AM UTC-7, Joel Goldstick wrote: >> On Tue, Apr 5, 2016 at 11:23 AM, Muhammad Ali >> wrote: >> > >> > Could any body tell me a general python script to generate .dat file after >> > the extraction of data from mo

Re: Install request

2016-04-05 Thread Oscar Benjamin
On 5 April 2016 at 16:56, Igor Korot wrote: > > So, here is my request: if its not possible to include the DLL in > question in the installer, > can the installer check for the OS version and ask the user to go to > Microsoft.com, > download and install the library? That's a very reasonable reque

Re: numpy arrays

2016-04-07 Thread Oscar Benjamin
On 6 April 2016 at 17:26, Heli wrote: > > Thanks for your replies. I have a question in regard with my previous > question. I have a file that contains x,y,z and a value for that coordinate > on each line. Here I am giving an example of the file using a numpy array > called f. > > f=np.array([[

Re: Install request

2016-04-07 Thread Oscar Benjamin
On 6 April 2016 at 05:08, Rustom Mody wrote: > On Wednesday, April 6, 2016 at 4:34:11 AM UTC+5:30, Steven D'Aprano wrote: >> On Wed, 6 Apr 2016 02:52 am, Rustom Mody wrote: >> >> > On Tuesday, April 5, 2016 at 9:49:58 PM UTC+5:30, Oscar Benjamin wrote: >> >

Re: numpy arrays

2016-04-07 Thread Oscar Benjamin
On 7 April 2016 at 15:31, Heli wrote: > > Thanks a lot Oscar, > > The lexsort you suggested was the way to go. Glad to hear it. > import h5py > import numpy as np > f=np.loadtxt(inputFile,delimiter=None) > xcoord=np.sort(np.unique(f[:,0])) > ycoord=np.sort(np.unique(f[:,1])) > zcoord=np.sort(np.

Re: sum accuracy

2016-04-15 Thread Oscar Benjamin
On 15 April 2016 at 10:24, Robin Becker wrote: > On 13/04/2016 18:05, Random832 wrote: > . >> >> >> No, it doesn't. Sum works on any type that can be added (except >> strings), it can't make any assumptions about the characteristics of >> floating point types. For non-numeric types, the ad

Re: Python garbage collection: not releasing memory to OS!

2016-04-15 Thread Oscar Benjamin
On 15 April 2016 at 11:25, wrote: > The input was a 4MB file. Even after returning from the 'fileopen' function > the 4MB memory was not released. I checked htop output while the loop was > running, the resident memory stays at 14MB. So unless the process is stopped > the memory stays with it.

Re: sum accuracy

2016-04-15 Thread Oscar Benjamin
On 15 April 2016 at 11:10, Ben Bacarisse wrote: > Oscar Benjamin writes: > >> On 15 April 2016 at 10:24, Robin Becker wrote: > >>> yes indeed summation is hard :( >> >> Not with Fraction it isn't: >> >> from fractions import Fraction >

Re: help install numpy and scipy in window 7 and 3.5.0 shell

2016-04-15 Thread Oscar Benjamin
On 15 April 2016 at 17:29, wrote: >> On Apr 15, 2016 10:40 AM, wrote: >> > >> > I have downloaded the numpy-1.11.01 and scipy-0.17.0 but after running >> setup files over IDLE in numpy and scipy, it still can not get through. Can >> someone give me a hand? or you can provide the installation ins

Re: scipy install error,need help its important

2016-04-18 Thread Oscar Benjamin
On 18 April 2016 at 08:38, Xristos Xristoou wrote: > Τη Δευτέρα, 18 Απριλίου 2016 - 6:53:30 π.μ. UTC+3, ο χρήστης Xristos Xristoou > έγραψε: >> guys i have big proplem i want to install scipy >> but all time show me error >> i have python 2.7 and windows 10 >> i try to use pip install scipy and i

Re: Python2.7 win64 --- cannot install the package of scipy

2016-04-18 Thread Oscar Benjamin
On 16 April 2016 at 22:53, wrote: > I failed to install the package of scipy on Python2.7(win64). > > 1. I tried the direct way that use cmd--pip install scripy. The result shows > that it failed with error code 1 in > c:\tyk\appdata\local\temp\pip-build-an9fye\scipy\. > > 2. I tried to install

Re: Failed install scipy lib

2016-04-19 Thread Oscar Benjamin
On 19 Apr 2016 17:01, wrote: > > Hello, > i'm trying to use: > "py -m pip install scipy" > and after couple of lines a get an error saying: I thought that binary wheels for scipy would be available on pypi for each OS now. Try updating pip and then using it to install scipy. I'm not on Windows t

Re: Guido sees the light: PEP 8 updated

2016-04-20 Thread Oscar Benjamin
On 20 April 2016 at 07:08, Terry Reedy wrote: > On 4/19/2016 11:41 PM, Chris Angelico wrote: >> >> On Wed, Apr 20, 2016 at 1:23 PM, Terry Reedy wrote: It kinda looks like Hypertalk syntax, which some of you may remember I'm exceedingly fond of. There's no reason why a GUI editor co

Re: Guido sees the light: PEP 8 updated

2016-04-20 Thread Oscar Benjamin
On 20 April 2016 at 02:38, Steven D'Aprano wrote: > > "Oh no! We're having trouble displaying this Scratch project. > > If you are on a mobile phone or tablet, try visiting this project on a > computer. > > If you're on a computer, your Flash player might be disabled, missing, or > out of date." >

Re: Failed install scipy lib

2016-04-20 Thread Oscar Benjamin
On 20 April 2016 at 12:30, wrote: > On Wednesday, April 20, 2016 at 2:09:10 PM UTC+3, liran@gmail.com wrote: >> On Tuesday, April 19, 2016 at 9:21:42 PM UTC+3, eryk sun wrote: >> > On Tue, Apr 19, 2016 at 12:05 PM, Oscar Benjamin >> > wrote: >>

Re: Detecting repeated subsequences of identical items

2016-04-21 Thread Oscar Benjamin
On 21 April 2016 at 04:07, Steven D'Aprano wrote: > I want to group repeated items in a sequence. For example, I can group > repeated sequences of a single item at a time using groupby: > > > from itertools import groupby > for key, group in groupby("BBCDDEEE"): > group = list(group) >

Re: Detecting repeated subsequences of identical items

2016-04-21 Thread Oscar Benjamin
On 21 April 2016 at 13:15, Steven D'Aprano wrote: > On Thu, 21 Apr 2016 06:53 pm, Oscar Benjamin wrote: > >> On 21 April 2016 at 04:07, Steven D'Aprano wrote: >>> I want to group repeated items in a sequence. For example, I can group >>> repeated se

Re: Detecting repeated subsequences of identical items

2016-04-21 Thread Oscar Benjamin
On 21 April 2016 at 15:12, Chris Angelico wrote: > On Fri, Apr 22, 2016 at 12:01 AM, Oscar Benjamin > wrote: >> In the recursive stack overflow case what you'll usually have is >> >> 1) A few frames leading up to the start of recursion >> 2) A long repeti

Re: Optimizing Memory Allocation in a Simple, but Long Function

2016-04-24 Thread Oscar Benjamin
On 24 April 2016 at 19:21, Chris Angelico wrote: > On Mon, Apr 25, 2016 at 4:03 AM, Derek Klinge wrote: >> Ok, from the gmail web client: > > Bouncing this back to the list, and removing quote markers for other > people's copy/paste convenience. > > ## Write a method to approximate Euler's Number

Re: Optimizing Memory Allocation in a Simple, but Long Function

2016-04-25 Thread Oscar Benjamin
On 25 April 2016 at 08:39, Gregory Ewing wrote: > Derek Klinge wrote: >> >> Also, it seems to me if the goal is to use the smallest value of n to get >> a >> particular level of accuracy, changing your guess of N by doubling seems >> to >> have a high chance of overshoot. > > > If you want to find

Re: Optimizing Memory Allocation in a Simple, but Long Function

2016-04-26 Thread Oscar Benjamin
On 25 April 2016 at 15:35, Derek Klinge wrote: > > Although I see the value of relative error, I am just as interested in > absolute error (though admittedly they are directly related values). I was referring to relative error because the relative error is the same at each step making the calcula

Re: setrecursionlimit

2016-05-19 Thread Oscar Benjamin
On 18 May 2016 at 17:11, Steven D'Aprano wrote: > The documentation for setrecursion limit warns against setting the limit too > high: > > [quote] > The highest possible limit is platform-dependent. A user may need to > set the limit higher when they have a program that requires deep >

Re: Python on Windows with linux environment

2016-06-02 Thread Oscar Benjamin
On 2 June 2016 at 12:22, Muhammad Ali wrote: > I use windows regularly, however, I use linux for only my research work at > supercomputer. In my research field (materials science) most of the scripts > are being written in python with linux based system. Could I installed such > linux based pyt

[RELEASE] Python 2.7.12 release candidate 1

2016-06-12 Thread Benjamin Peterson
://www.python.org/downloads/release/python-2712rc1/ The complete changelog may be viewed at https://hg.python.org/cpython/raw-file/v2.7.12rc1/Misc/NEWS Please test the pre-release and report any bugs to https://bugs.python.org Servus, Benjamin -- https://mail.python.org/mailman/listinfo/python

Re: Unexpected NANs in complex arithmetic

2016-06-22 Thread Oscar Benjamin
On 22 June 2016 at 08:14, Antoon Pardon wrote: > Op 22-06-16 om 04:48 schreef Steven D'Aprano: >> I'm doing some arithmetic on complex numbers involving INFs, and getting >> unexpected NANs. >> >> py> INF = float('inf') >> py> z = INF + 3j >> py> z >> (inf+3j) >> py> -z >> (-inf-3j) >> >> So far,

[RELEASE] Python 2.7.12

2016-06-27 Thread Benjamin Peterson
ore we hit the unlucky 2.7.13. Servus, Benjamin 2.7 release manager -- https://mail.python.org/mailman/listinfo/python-list

Re: ImportError: Import by filename is not supported when unpickleing

2016-07-27 Thread Jason Benjamin
On Wed, 27 Jul 2016 17:25:43 -0400, Larry Martell wrote: > When I try and unpickle an object with pickle.loads it fails with: > > ImportError: Import by filename is not supported when unpickleing > > I've never used pickle before. Why do I get this and how can I fix it? Try using *pickle.load*

Re: Is it possible to draw a BUTTON?

2016-07-27 Thread Jason Benjamin
On Wed, 27 Jul 2016 13:18:16 -0700, huey.y.jiang wrote: > Hi Folks, > > It is common to put a BUTTON on a canvas by the means of coding. > However, in my application, I need to draw a circle on canvas, and then > make this circle to work as if it is a button. When the circle is > clicked, it trig

RAR functionality

2018-11-30 Thread Benjamin Schollnick
natively in python? Licensing? Bad rar file design? - Benjamin -- https://mail.python.org/mailman/listinfo/python-list

Import module from file path

2018-12-04 Thread Oscar Benjamin
Hi all, I'm looking to import a module given a string representing the path to the .py file defining the module. For example given this setup mkdir -p a/b/c touch a/__init__.py touch a/b/__init__.py touch a/b/c/__init__.py touch a/b/c/stuff.py I have a module a.b.c.stuff which is defined in the

Re: Import module from file path

2018-12-05 Thread Oscar Benjamin
On Wed, 5 Dec 2018 at 07:57, Peter Otten <__pete...@web.de> wrote: > > Oscar Benjamin wrote: > > > > I'm looking to import a module given a string representing the path to > > the .py file defining the module. > > I am not aware of a clean way. I ha

Re: polar coordinates?

2018-12-09 Thread Oscar Benjamin
On Sun, 9 Dec 2018 at 16:37, Brian Christiansen wrote: > > I have been messing with a program that is inspried by a video on > youtube that is about the vizualization of pi. I might make a post > about that program someday, but I want to talk about something else. > One of the ways of visualizing

Re: clusters of numbers

2018-12-15 Thread Oscar Benjamin
On Sun, 16 Dec 2018 at 01:47, Marc Lucke wrote: > > hey guys, > > I have a hobby project that sorts my email automatically for me & I want > to improve it. There's data science and statistical info that I'm > missing, & I always enjoy reading about the pythonic way to do things too. > > I have a

Re: Mask two images with python

2018-12-19 Thread Oscar Benjamin
On Wed, 19 Dec 2018 at 05:42, Umar Yusuf wrote: > > Hello there, > How do I supper impose an image design on a transparent png image? > > I have tried to use OpenCV's "cv2.bitwise_and" function to no success. I > posted the detail question here: > https://stackoverflow.com/questions/53791510/pyt

Re: Mask two images with python

2018-12-21 Thread Oscar Benjamin
On Fri, 21 Dec 2018 at 09:32, Umar Yusuf wrote: > > On Wednesday, 19 December 2018 19:22:51 UTC+1, Oscar Benjamin wrote: > > On Wed, 19 Dec 2018 at 05:42, Umar Yusuf wrote: > > > > > > Hello there, > > > How do I supper impose an image design on a transpar

Re: python package management confusion

2019-01-20 Thread Oscar Benjamin
On Sun, 20 Jan 2019 at 16:22, dcs3spp via Python-list wrote: > > On Saturday, 19 January 2019 11:17:19 UTC, dcs3spp wrote: > > > > My question is, can setuptools be configured to pull in child from a > > separate git repository when running python setup.py develop from parent > > folder? I have

Re: python package management confusion

2019-01-20 Thread Oscar Benjamin
On Sun, 20 Jan 2019 at 21:12, dcs3spp via Python-list wrote: > > Pip 18.1 supports reading pep508 direct urls from install_requires. In future > release there are plans to deprecate the --process-dependency-links pip > install option: > - https://github.com/pypa/pip/issues/4187 > - https://githu

[RELEASE] Python 2.7.16 release candidate 1

2019-02-16 Thread Benjamin Peterson
ng to plan, Python 2.7.16 final will be released on March 2. All the best, Benjamin -- https://mail.python.org/mailman/listinfo/python-list

[RELEASE] Python 2.7.16

2019-03-03 Thread Benjamin Peterson
gelog for a full list of changes: https://raw.githubusercontent.com/python/cpython/v2.7.16/Misc/NEWS.d/2.7.16rc1.rst Please report any bugs to https://bugs.python.org/. Regards, Benjamin 2.7 release manager (on behalf of all Python 2.7's contributors) -- https://mail.python.org/mailma

itertools product(infinite iterator) hangs

2019-09-13 Thread Oscar Benjamin
I've been staring at this for a little while: from itertools import product class Naturals: def __iter__(self): i = 1 while True: yield i i += 1 N = Naturals() print(iter(N)) print(product(N)) # <--- hangs When I run the above the call to product han

Re: itertools product(infinite iterator) hangs

2019-09-15 Thread Oscar Benjamin
On Sat, 14 Sep 2019 at 03:26, Oscar Benjamin wrote: > > I've been staring at this for a little while: > > from itertools import product > > class Naturals: > def __iter__(self): > i = 1 > while True: > yield i > i

Re: itertools product(infinite iterator) hangs

2019-09-15 Thread Oscar Benjamin
On Sat, 14 Sep 2019 at 07:22, ast wrote: > > Le 14/09/2019 à 04:26, Oscar Benjamin a écrit : > > > > What am I missing? > > here is a pseudo code for product: > > def product(*args, repeat=1): > # product('ABCD', 'xy') --> Ax Ay Bx By

Re: __init__ is not invoked

2019-09-26 Thread Oscar Benjamin
On Thu, 26 Sep 2019 at 14:19, Peter Otten <__pete...@web.de> wrote: > > __init__ is called only if __new__ returns an instance of ClassB: > > """ > /* If the returned object is not an instance of type, >it won't be initialized. */ > if (!PyType_IsSubtype(Py_TYPE(obj), type)) >

Re: __init__ is not invoked

2019-09-26 Thread Oscar Benjamin
On Thu, 26 Sep 2019 at 13:39, Rhodri James wrote: > > On 26/09/2019 13:20, ast wrote: > > > > >>> class ClassB(object): > > ... def __new__(cls, arg): > > ... print('__new__ ' + arg) > > ... return object > > ... def __init__(self, arg): > > ... print('__init__ ' +

[RELEASE] Python 2.7.17 release candidate 1

2019-10-08 Thread Benjamin Peterson
release schedule, calls for 2.7.17 to be the penultimate bug fix release of the Python 2.7 series. Time for Python 2 is running low! Regards, Benjamin 2.7 release manager -- https://mail.python.org/mailman/listinfo/python-list

[RELEASE] Python 2.7.17

2019-10-19 Thread Benjamin Peterson
nates 2.7.17 as the penultimate Python 2.7 release. So, be aware that the upstream demise of Python 2 is not far away. For the time being, bugs may be reported to https://bugs.python.org. See you soon for The End, Benjamin -- https://mail.python.org/mailman/listinfo/python-list

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

2019-11-06 Thread Oscar Benjamin
On Tue, 5 Nov 2019 at 21:52, Gregory Ewing wrote: > > Peter J. Holzer wrote: > > On 2019-11-04 18:18:39 -0300, Luciano Ramalho wrote: > > > > Or maybe don't catch it here at all but just let it bubble up until it > > hits a level where dealing with it makes sense from the user's point of > > view

Re: on sorting things

2019-12-18 Thread Oscar Benjamin
On Thu, 19 Dec 2019 at 07:37, Eli the Bearded <*@eli.users.panix.com> wrote: > ... > But what caught my eye most, as someone relatively new to Python but > with long experience in C in Perl, is sorting doesn't take a > *comparison* function, it takes a *key generator* function, and that > function

[RELEASE] Python 2.7.18 release candidate 1

2020-04-06 Thread Benjamin Peterson
us know if there are any critical problems at https://bugs.python.org/ (This is the last chance!) All the best, Benjamin -- https://mail.python.org/mailman/listinfo/python-list

Re: To apply pca for a large csv

2020-04-14 Thread Oscar Benjamin
On Tue, 14 Apr 2020 at 12:42, Rahul Gupta wrote: > > Hello all, i have a csv of 1 gb which consists of 25000 columns and 2 > rows. I want to apply pca so i have seen sciki-learn had inbuilt > fucntionality to use that. But i have seen to do eo you have to load data in > data frame. But my m

[RELEASE] Python 2.7.18, the end of an era

2020-04-20 Thread Benjamin Peterson
hased Python 2 out of their archives. Users migrated hundreds of millions of lines of code, developed porting guides, and kept Python 2 in their brain while Python 3 gained 10 years of improvements. Finally, thank you to GvR for creating Python 0.9, 1, 2, and 3. Long live Python 3+! Sign

Re: Help with installation please

2020-05-17 Thread Oscar Benjamin
On Sun, 17 May 2020 at 15:21, Mats Wichmann wrote: > > On 5/15/20 9:47 PM, Souvik Dutta wrote: > > I dont know if you should shift from powershell to cmd. Python kinda does > > not work in powershell. > > Powershell has a funky way of looking up programs, with the result that > you have to type th

Re: Managing plug-ins

2020-05-25 Thread Benjamin Schollnick
re… If you’re interested feel free to take a look. - Benjamin > On Feb 23, 2020, at 5:45 PM, DL Neil via Python-list > wrote: > > Please recommend a library which will manage plug-ins. > > > (Regret that searching PyPi or using a web SE results in an overw

Re: A Python installation help doc much more friendly to newcomers? [Was Re: help]

2020-07-18 Thread Oscar Benjamin
On Sat, 18 Jul 2020 at 05:39, dn via Python-list wrote: > > On 18/07/20 3:29 PM, boB Stepp wrote: > > On Fri, Jul 17, 2020 at 9:48 PM dn via Python-list > > wrote: > >> > >> On 18/07/20 1:53 PM, Castillo, Herbert S wrote: > >>> I downloaded python not to long ago, and today when I opened Python o

Re: True is True / False is False?

2020-07-22 Thread Oscar Benjamin
On Wed, 22 Jul 2020 at 02:12, Chris Angelico wrote: > > On Wed, Jul 22, 2020 at 11:04 AM Tim Chase > wrote: > > > > I know for ints, cpython caches something like -127 to 255 where `is` > > works by happenstance based on the implementation but not the spec > > (so I don't use `is` for comparison

extending and embedding python without distutils

2005-09-26 Thread Benjamin Rutt
.upak/installed/tcltk/lib -L/usr/X11R6/lib -ltk8.4 -ltcl8.4 -lX11 -lpthread -ldl -lutil The purpose of this posting is to see if anyone jumps in and says "hey, you missed a variable called ...". Thanks, -- Benjamin Rutt -- http://mail.python.org/mailman/listinfo/python-list

Re: Where to find python c-sources

2005-09-29 Thread Dave Benjamin
Tor Erik Sønvisen wrote: > I need to browse the socket-module source-code. I believe it's contained in > the file socketmodule.c, but I can't locate this file... Where should I > look? You can browse the Python CVS tree here: http://cvs.sourceforge.net/viewcvs.py/python/python/dist/src/ For exa

Re: Duplicating Modules

2005-09-30 Thread Dave Benjamin
Misto . wrote: > Hi folks! > > Short: > > There is a way to dumplicate a module ? Here's one way... it doesn't quite work with modules inside of packages, unfortunately, but it does avoid defeating module caching and tries to keep sys.modules in a predictable state. I don't know what the thre

Re: [Info] PEP 308 accepted - new conditional expressions

2005-09-30 Thread Dave Benjamin
Reinhold Birkenfeld wrote: > after Guido's pronouncement yesterday, in one of the next versions of Python > there will be a conditional expression with the following syntax: > > X if C else Y Hooray! After years of arguing over which syntax to use, and finally giving up since nobody could agree,

Re: Question about StringIO

2005-10-10 Thread Benjamin Niemann
to > know the answer. That's probably a deadlock as described in <http://docs.python.org/lib/popen2-flow-control.html> > BTW, is there an equivalent of /dev/null on MSW? Dunno - but as a last resort, you could create a tempfile with a unique name (to be sure, not to override an

disable Pmw.Counter?

2005-10-11 Thread Benjamin Rutt
Does anyone know how to disable a Pmw.Counter? (make it so it cannot be changed, but you can still call the get() function to see its current value?) Thanks, -- Benjamin Rutt -- http://mail.python.org/mailman/listinfo/python-list

Re: Yes, this is a python question, and a serious one at that (moving to Win XP)

2005-10-17 Thread dave . benjamin
Jorgen Grahn wrote: > On Fri, 14 Oct 2005 12:37:25 +0200, Christophe <[EMAIL PROTECTED]> wrote: > > Kenneth McDonald a écrit : > >> For unfortunate reasons, I'm considering switching back to Win XP (from > >> OS X) as my "main" system. Windows has so many annoyances that I can > ... > >> Yes, I k

Re: Pickle to source code

2005-10-26 Thread Benjamin Niemann
_ method (true for built-in stuff like list, dict, set...): Just unpickle it and call repr() on the resulting object. -- Benjamin Niemann Email: pink at odahoda dot de WWW: http://www.odahoda.de/ -- http://mail.python.org/mailman/listinfo/python-list

Re: How to translate python into C

2005-10-28 Thread Benjamin Niemann
ow-do-i-compile-my-own-programs -- Benjamin Niemann Email: pink at odahoda dot de WWW: http://www.odahoda.de/ -- http://mail.python.org/mailman/listinfo/python-list

Re: Rename files with numbers

2005-10-31 Thread Dave Benjamin
handful of albums to rename, trust me. This problem has been solved. Here's a list of apps, including Tag&Rename, that can query freedb: http://www.freedb.org/freedb_aware_apps.php -- .:[ dave benjamin: ramen/[sp00] ]:. \\ "who will clean out my Inbox after I'm dead[?]"

Re: Python's website does a great disservice to the language

2005-11-01 Thread Benjamin Niemann
Steven D'Aprano wrote: > http://www.python.com/ perhaps? Yep, let's make this the new official python site ;) -- Benjamin Niemann Email: pink at odahoda dot de WWW: http://www.odahoda.de/ -- http://mail.python.org/mailman/listinfo/python-list

<    2   3   4   5   6   7   8   9   10   11   >