Re: ESR "Waning of Python" post

2018-10-11 Thread Chris Angelico
On Fri, Oct 12, 2018 at 5:51 PM Marko Rauhamaa wrote: > > Python uses the GIL mainly because it uses reference counting (with > > almost constant changes to potentially concurrently used objects) for > > memory management. Dropping the GIL would mean dropping reference > > counting likely in favou

Re: ESR "Waning of Python" post

2018-10-11 Thread Marko Rauhamaa
dieter : > Every system you use has its advantages and its drawbacks. > Depending on the specific context (problem, resources, knowledge, ...), > you must choose an appropriate one. Yep. I use Python for numerous tasks professionally and at home. Just this past week I used it to plan a junior soc

Re: ESR "Waning of Python" post

2018-10-11 Thread dieter
Ben Finney writes: > ... > Is it your position that the described behaviour is not a problem? Do > you hold that position because you think multi-core machines are not a > sector that Python needs to be good at? Or that the described behaviour > doesn't occur? Or something else? Every system you

Quickest way to concatenate strings

2018-10-11 Thread Frank Millman
Hi all I have often read that the quickest way to concatenate a number of strings is to place them in a list and 'join' them - C:\Users\User>python -m timeit -s "x='a'*500; y='b'*500; z='c'*500" ''.join([x, y, z]) 50 loops, best of 5: 307 nsec per loop I seem to have found a quick

Single DB connection during class's lifetime. Metaclass, singleton and __new__() examples and references.

2018-10-11 Thread Ryan Johnson
I am working on using mysql.connector in a class and have found an example of how to create a single connection that spans the lifetime of all instances of the class: https://softwareengineering.stackexchange.com/a/358061/317228 however, I do not understand a few things about the class, includ

Re: Observations on the List - "Be More Kind"

2018-10-11 Thread Chris Angelico
On Fri, Oct 12, 2018 at 5:07 AM Ian Kelly wrote: > > On Thu, Oct 11, 2018 at 9:28 AM Dan Purgert wrote: > > > > Larry Martell wrote: > > > On Fri, Oct 5, 2018 at 6:54 AM Bruce Coram wrote: > > > [...] > > > We don't like you. We don't want you here. We never will. Save us all > > > the trouble a

Re: Observations on the List - "Be More Kind"

2018-10-11 Thread Ian Kelly
On Thu, Oct 11, 2018 at 9:28 AM Dan Purgert wrote: > > Larry Martell wrote: > > On Fri, Oct 5, 2018 at 6:54 AM Bruce Coram wrote: > > [...] > > We don't like you. We don't want you here. We never will. Save us all > > the trouble and go away. > > That's the best code of conduct I've ever read ...

Re: From Mathematica to Jypyter

2018-10-11 Thread eryk sun
On Thu, Oct 11, 2018 at 4:10 AM Thomas Jollans wrote: > > On 2018-10-11 10:48, jfine2...@gmail.com wrote: > > It is fun to find fault in the work of a new Nobel laureate. In this case, > > a typo. > > Not a Nobel laureate. It's not a Nobel prize. More precisely it's the Nobel Memorial Prize in E

Re: ESR "Waning of Python" post

2018-10-11 Thread Neil Cerutti
On 2018-10-10, Paul Rubin wrote: > Neil Cerutti writes: >> As Stephen said, it's sort of silly not to be aware of those >> issues going in. > > If you're saying ESR messed up by using Python in the first > place for that program, that's not a great advert for Python > either. I meant Stefan, by

Re: ESR "Waning of Python" post

2018-10-11 Thread Tomasz Rola
On Thu, Oct 11, 2018 at 06:22:13PM +1100, Chris Angelico wrote: [...] > > There's a huge difference between deciding on using some different > language for a project, and going on a massive ire-filled rant. I agree, in fact this is the kind of posture that I myself implemented in my actions. I

Re: Observations on the List - "Be More Kind"

2018-10-11 Thread Dan Purgert
Larry Martell wrote: > On Fri, Oct 5, 2018 at 6:54 AM Bruce Coram wrote: > [...] > We don't like you. We don't want you here. We never will. Save us all > the trouble and go away. That's the best code of conduct I've ever read ... 10/10, would read again. -- |_|O|_| Registered Linux user #58594

AW: how to replace line on particular line in file[no need to write it back whole file again]

2018-10-11 Thread Lutz Horn
Try something like this: ``` import sys def replace(lineno, replacement): for i, line in enumerate(sys.stdin.readlines()): if i == lineno: line = replacement print(line.strip()) replace(2, "REPLACEMENT") ``` Von: Python-li

Re: how to replace line on particular line in file[no need to write it back whole file again]

2018-10-11 Thread Iranna Mathapati
Thanks Dennis Lee and Thomas On Thu, Oct 11, 2018 at 6:32 PM Dennis Lee Bieber wrote: > On Thu, 11 Oct 2018 15:14:49 +0530, Iranna Mathapati > declaimed the following: > > >Hi Team, > > > >How to replace particular line text with new text on a file > >i have below code but its writing whole co

Re: how to replace line on particular line in file[no need to write it back whole file again]

2018-10-11 Thread Thomas Jollans
On 2018-10-11 11:44, Iranna Mathapati wrote: > Hi Team, > > How to replace particular line text with new text on a file > i have below code but its writing whole code. > > def replace_line(file_name, line_num, text): > lines = open(file_name, 'r').readlines() > lines[line_num] = text >

Re: From Mathematica to Jypyter

2018-10-11 Thread Rhodri James
On 10/10/18 17:24, jfine2...@gmail.com wrote: Rhodri James wrote: Robin Becker wrote: I'm a great fan of erroneous spelling and this blog needs a spelling check as this quote shows [Paul Romer's blog] "Mathematica exemplifies the horde of new Vandals whose pursuit of private gain threatens

Re: Observations on the List - "Be More Kind"

2018-10-11 Thread Rhodri James
On 10/10/18 19:14, Ethan Furman wrote: On 10/10/2018 11:07 AM, Rhodri James wrote: Now I've had a chance to go back through the archive (it's been that kind of day at work), I'm going to have to recant.  I can't find anything that Rick wrote in the week or two before the ban Where are you lo

how to replace line on particular line in file[no need to write it back whole file again]

2018-10-11 Thread Iranna Mathapati
Hi Team, How to replace particular line text with new text on a file i have below code but its writing whole code. def replace_line(file_name, line_num, text): lines = open(file_name, 'r').readlines() lines[line_num] = text out = open(file_name, 'w') out.writelines(lines) <

Re: From Mathematica to Jypyter

2018-10-11 Thread Thomas Jollans
On 2018-10-11 10:48, jfine2...@gmail.com wrote: > It is fun to find fault in the work of a new Nobel laureate. In this case, a > typo. Not a Nobel laureate. It's not a Nobel prize. > > However, I'm disappointed that no-one has picked up the other error. Someone > posted to this thread "the #me

Re: From Mathematica to Jypyter

2018-10-11 Thread jfine2358
It is fun to find fault in the work of a new Nobel laureate. In this case, a typo. However, I'm disappointed that no-one has picked up the other error. Someone posted to this thread "the #me-too movement". It should be "#MeToo". Yes, I know it's CamelCase. I think that's actually Pythonic. It's

Problems installing RStudio from Anaconda Navigator

2018-10-11 Thread Spencer Graves
  I clicked "Install" for "RStudio 1.1.456" in Anaconda Navigator 1.9.2 under Windows 7 Home Premium SP1.  It said "Installing application RStudio" for over 30 minutes.  It looked stuck.   Then I read a GitHub post that said, "On the environments tab create a new R/Python3.5 environme

Re: ESR "Waning of Python" post

2018-10-11 Thread Chris Angelico
On Thu, Oct 11, 2018 at 6:43 PM Thomas Jollans wrote: > The gist is that the GIL is a problem only for relatively few problems > (e.g. games that need limited-scale low-latency parallelism). Most of > the time, you either only need one process in the first place, or you > can take full advantage o

Re: ESR "Waning of Python" post

2018-10-11 Thread Thomas Jollans
On 11/10/2018 09:11, Ben Finney wrote: Chris Angelico writes: In actual fact, it's not a problem per-se. It's a design choice, and every alternative choice tried so far has even worse problems. THAT is why we still have it. That reads to me like a rejection of the point made in the blog post

Re: ESR "Waning of Python" post

2018-10-11 Thread Chris Angelico
On Thu, Oct 11, 2018 at 6:12 PM Ben Finney wrote: > > Chris Angelico writes: > > > In actual fact, it's not a problem per-se. It's a design choice, and > > every alternative choice tried so far has even worse problems. THAT is > > why we still have it. > > That reads to me like a rejection of the

Re: ESR "Waning of Python" post

2018-10-11 Thread Ben Finney
Chris Angelico writes: > In actual fact, it's not a problem per-se. It's a design choice, and > every alternative choice tried so far has even worse problems. THAT is > why we still have it. That reads to me like a rejection of the point made in the blog post: that the GIL prevents Python from t