Re: How coding in Python is bad for you

2017-01-23 Thread Christian Gollwitzer
Am 23.01.17 um 18:24 schrieb breamore...@gmail.com: The article is here http://lenkaspace.net/index.php/blog/show/111 I don't agree with it (unsurprisingly), even though Python is not my favourite language in itself, but a viable compromise for many circumstances. Below is a point-by-point r

PhotoImage.paste

2017-01-23 Thread rryan . asu
I'm trying to build a tkinter GUI with python 3.5, and would like to interactively adjust the color palette for an image by moving the mouse in the canvas using PIL. In pseudo-code, I have something like palette=color_map(x,y) # x,y are scalars indicating the position of the mouse in the Can

Re: How coding in Python is bad for you

2017-01-23 Thread Chris Angelico
On Tue, Jan 24, 2017 at 6:00 PM, Bob Martin wrote: > in 770207 20170124 005601 Chris Angelico wrote: > >>REXX has even less structure than Python - it doesn't even have >>functions, just labels, so you can actually have two functions that >>share a common tail. And yes, you can abuse that horrend

Re: How coding in Python is bad for you

2017-01-23 Thread Bob Martin
in 770207 20170124 005601 Chris Angelico wrote: >REXX has even less structure than Python - it doesn't even have >functions, just labels, so you can actually have two functions that >share a common tail. And yes, you can abuse that horrendously to >create unreadable code. Is REXX a bad language b

Re: How coding in Python is bad for you

2017-01-23 Thread Chris Angelico
On Tue, Jan 24, 2017 at 4:00 PM, Steven D'Aprano wrote: > On Tuesday 24 January 2017 15:41, Chris Angelico wrote: > >> Remember: If you have only one clock, it might be right and it might >> be wrong, but it's consistent. If you have two clocks and they >> disagree, you have no clue what the time

Re: How coding in Python is bad for you

2017-01-23 Thread Steven D'Aprano
On Tuesday 24 January 2017 15:41, Chris Angelico wrote: > Remember: If you have only one clock, it might be right and it might > be wrong, but it's consistent. If you have two clocks and they > disagree, you have no clue what the time is. During the golden age of sail, there was a saying, never g

Re: How coding in Python is bad for you

2017-01-23 Thread Chris Angelico
On Tue, Jan 24, 2017 at 3:22 PM, Steven D'Aprano wrote: > But more seriously, it's easy to typo an extra indent. It's harder to typo > "endif" when you actually meant to type, oh, "ending = 1 if condition else 3", > say. So faced with ambiguity, and the insistence that the right way to break > amb

Re: How coding in Python is bad for you

2017-01-23 Thread Gregory Ewing
Chris Angelico wrote: On Tue, Jan 24, 2017 at 11:55 AM, Dennis Lee Bieber wrote: On Mon, 23 Jan 2017 22:55:19 +, mm0fmf declaimed the following: 50lbs of coffee beans made into espresso and 22lbs of chocolate to eat with all those tiny cups. How about just 75lbs of chocolate co

Re: How coding in Python is bad for you

2017-01-23 Thread Steven D'Aprano
On Tuesday 24 January 2017 13:41, Chris Angelico wrote: > On Tue, Jan 24, 2017 at 12:55 PM, Steve D'Aprano > wrote: >> Reading his post, I get the impression he's the sort of programmer who >> believes in never, ever, ever, ever re-using a variable, so he might do >> something like: >> >> raw_dat

Re: How coding in Python is bad for you

2017-01-23 Thread Steven D'Aprano
On Tuesday 24 January 2017 13:38, Chris Angelico wrote: > On Tue, Jan 24, 2017 at 12:47 PM, BartC wrote: >> Take the same code with block >> delimiters, and take out that same indent: >> >> if 0 then >> print ("one") >> print ("two") >> endif >> print ("three") >> >> It still compiles, it st

Re: How coding in Python is bad for you

2017-01-23 Thread Chris Angelico
On Tue, Jan 24, 2017 at 12:55 PM, Steve D'Aprano wrote: > Reading his post, I get the impression he's the sort of programmer who > believes in never, ever, ever, ever re-using a variable, so he might do > something like: > > raw_data = collect_raw_data() # generates 10GB of data > data_after_step

Re: How coding in Python is bad for you

2017-01-23 Thread Chris Angelico
On Tue, Jan 24, 2017 at 12:47 PM, BartC wrote: > On 24/01/2017 00:56, Chris Angelico wrote: >> >> On Tue, Jan 24, 2017 at 11:44 AM, BartC wrote: > > >>> With C++ or Java, it's possible to tell the indentation is wrong (because >>> of >>> the extra redundancy of having the indentation /and/ block

Re: How coding in Python is bad for you

2017-01-23 Thread Steve D'Aprano
On Tue, 24 Jan 2017 08:55 am, BartC wrote: > On 23/01/2017 17:34, Chris Angelico wrote: >> On Tue, Jan 24, 2017 at 4:24 AM, wrote: >>> The article is here http://lenkaspace.net/index.php/blog/show/111 >> >> I would respond point-by-point if I thought the author had a clue. > > I thought points

Re: How coding in Python is bad for you

2017-01-23 Thread BartC
On 24/01/2017 00:56, Chris Angelico wrote: On Tue, Jan 24, 2017 at 11:44 AM, BartC wrote: With C++ or Java, it's possible to tell the indentation is wrong (because of the extra redundancy of having the indentation /and/ block delimiters). That's a bit harder in Python making source more fragi

Re: How coding in Python is bad for you

2017-01-23 Thread Chris Angelico
On Tue, Jan 24, 2017 at 11:55 AM, Dennis Lee Bieber wrote: > On Mon, 23 Jan 2017 22:55:19 +, mm0fmf declaimed the > following: > > >>50lbs of coffee beans made into espresso and 22lbs of chocolate to eat >>with all those tiny cups. >> > How about just 75lbs of chocolate covered espres

Re: How coding in Python is bad for you

2017-01-23 Thread Chris Angelico
On Tue, Jan 24, 2017 at 11:44 AM, BartC wrote: > On 23/01/2017 22:09, Chris Angelico wrote: >> 1 is wrong - there is structure, same as in every language. Or if it's >> true, it's true in every language. > > > Python (I think in common with other scripting languages) allows you to > place statemen

Re: How coding in Python is bad for you

2017-01-23 Thread BartC
On 23/01/2017 22:09, Chris Angelico wrote: On Tue, Jan 24, 2017 at 8:55 AM, BartC wrote: On 23/01/2017 17:34, Chris Angelico wrote: On Tue, Jan 24, 2017 at 4:24 AM, wrote: The article is here http://lenkaspace.net/index.php/blog/show/111 I would respond point-by-point if I thought the

Re: How coding in Python is bad for you

2017-01-23 Thread Tim Daneliuk
On 01/23/2017 02:19 PM, Chris Angelico wrote: > On Tue, Jan 24, 2017 at 6:59 AM, Grant Edwards > wrote: >> On 2017-01-23, breamore...@gmail.com wrote: >> >>> The article is here http://lenkaspace.net/index.php/blog/show/111 >> >> I don't really think any of his points are valid, but one way that

Re: How coding in Python is bad for you

2017-01-23 Thread Tim Daneliuk
On 01/23/2017 11:24 AM, breamore...@gmail.com wrote: > The article is here http://lenkaspace.net/index.php/blog/show/111 > > Kindest regards. > > Mark Lawrence. > Beyond silly. Languages - like all tools - can be used properly or badly. -- https://mail.python.org/mailman/listinfo/python-list

Re: How coding in Python is bad for you

2017-01-23 Thread mm0fmf
On 23/01/2017 21:04, Adam M wrote: On Monday, January 23, 2017 at 3:41:17 PM UTC-5, Jon Ribbens wrote: On 2017-01-23, alister wrote: On Tue, 24 Jan 2017 07:19:42 +1100, Chris Angelico wrote: I believe that's "bad for you" in the sense that chocolate is bad for you. It isn't. chocolate is a

Re: How to create a socket.socket() object from a socket fd?

2017-01-23 Thread Ethan Furman
On 01/23/2017 09:00 AM, Grant Edwards wrote: On 2017-01-23, Antoon Pardon wrote: The standard response to issues like this is: A foolish consistency is the hobgoblin of little minds And wise consistency is the foundation of a good language design. Otherwise known as: if there's not a

Re: How coding in Python is bad for you

2017-01-23 Thread Ethan Furman
On 01/23/2017 01:55 PM, BartC wrote: On 23/01/2017 17:34, Chris Angelico wrote: On Tue, Jan 24, 2017 at 4:24 AM, breamoreboy wrote: The article is here http://lenkaspace.net/index.php/blog/show/111 I would respond point-by-point if I thought the author had a clue. I thought points 1 to 4

Re: How coding in Python is bad for you

2017-01-23 Thread Chris Angelico
On Tue, Jan 24, 2017 at 8:55 AM, BartC wrote: > On 23/01/2017 17:34, Chris Angelico wrote: >> >> On Tue, Jan 24, 2017 at 4:24 AM, wrote: >>> >>> The article is here http://lenkaspace.net/index.php/blog/show/111 >> >> >> I would respond point-by-point if I thought the author had a clue. > > > I t

Re: How coding in Python is bad for you

2017-01-23 Thread BartC
On 23/01/2017 17:34, Chris Angelico wrote: On Tue, Jan 24, 2017 at 4:24 AM, wrote: The article is here http://lenkaspace.net/index.php/blog/show/111 I would respond point-by-point if I thought the author had a clue. I thought points 1 to 4 were valid, in that the assertions were true. Poi

Re: How coding in Python is bad for you

2017-01-23 Thread Wildman via Python-list
On Mon, 23 Jan 2017 20:39:26 +, Jon Ribbens wrote: > On 2017-01-23, alister wrote: >> On Tue, 24 Jan 2017 07:19:42 +1100, Chris Angelico wrote: >>> I believe that's "bad for you" in the sense that chocolate is bad for >>> you. >>> >>> It isn't. >> >> chocolate is a poison (lethal dose for a

Re: Is it possible to get the Physical memory address of a variable in python?

2017-01-23 Thread breamoreboy
On Monday, January 23, 2017 at 5:59:42 PM UTC, Sourabh Kalal wrote: > how we can access the value from using id.. > like x=10 > id(x) > 3235346364 > > how i can read value 10 using id 3235346364 What are you trying to achieve here? If you'd explain that rather than how you're trying to achieve

Re: String Replacement

2017-01-23 Thread Chris Angelico
On Tue, Jan 24, 2017 at 8:23 AM, wrote: > I have a string like > > "Trump is $ the president of USA % Obama was $ the president of USA % Putin > is $ the premier of Russia%" > > Here, I want to extract the portions from $...%, which would be > > "the president of USA", > "the president of USA",

String Replacement

2017-01-23 Thread subhabangalore
I have a string like "Trump is $ the president of USA % Obama was $ the president of USA % Putin is $ the premier of Russia%" Here, I want to extract the portions from $...%, which would be "the president of USA", "the president of USA", "the premier of Russia" and would work some post extr

Re: How coding in Python is bad for you

2017-01-23 Thread Chris Angelico
On Tue, Jan 24, 2017 at 8:04 AM, Adam M wrote: > On Monday, January 23, 2017 at 3:41:17 PM UTC-5, Jon Ribbens wrote: >> On 2017-01-23, alister wrote: >> > On Tue, 24 Jan 2017 07:19:42 +1100, Chris Angelico wrote: >> >> I believe that's "bad for you" in the sense that chocolate is bad for >> >> yo

Re: How coding in Python is bad for you

2017-01-23 Thread Adam M
On Monday, January 23, 2017 at 3:41:17 PM UTC-5, Jon Ribbens wrote: > On 2017-01-23, alister wrote: > > On Tue, 24 Jan 2017 07:19:42 +1100, Chris Angelico wrote: > >> I believe that's "bad for you" in the sense that chocolate is bad for > >> you. > >> > >> It isn't. > > > > chocolate is a poison

Re: How coding in Python is bad for you

2017-01-23 Thread Jon Ribbens
On 2017-01-23, alister wrote: > On Tue, 24 Jan 2017 07:19:42 +1100, Chris Angelico wrote: >> I believe that's "bad for you" in the sense that chocolate is bad for >> you. >> >> It isn't. > > chocolate is a poison (lethal dose for a human approx 22lb) That's a meaningless statement. *Everything*

Re: How coding in Python is bad for you

2017-01-23 Thread Albert-Jan Roskam
sola dosis facit venenum ~ Paracelsus (1493-1541) From: Python-list on behalf of alister Sent: Monday, January 23, 2017 8:32:49 PM To: python-list@python.org Subject: Re: How coding in Python is bad for you On Tue, 24 Jan 2017 07:19:42 +1100, Chris Angelico wrot

Re: Adding colormaps?

2017-01-23 Thread Albert-Jan Roskam
(sorry for top-posting) I does not appear to be possible in matplolibrc (1). But you can use matplotlib.cm.register_cmap to register new cmaps (2) such as these (3). (Note: I did not try this) (1)http://matplotlib.org/1.4.0/users/customizing.html (2)http://matplotlib.org/api/cm_api.html (3)https

Re: Is it possible to get the Physical memory address of a variable in python?

2017-01-23 Thread Chris Angelico
On Tue, Jan 24, 2017 at 7:26 AM, Skip Montanaro wrote: > On Mon, Jan 23, 2017 at 2:17 PM, Chris Angelico wrote: >>> There. *Now* you have an address. Hack to your heart's content. >> >> No, you now have a hexadecimal representation of an integer. > > You missed my attempt at levity, I think. Ah

Re: How coding in Python is bad for you

2017-01-23 Thread alister
On Tue, 24 Jan 2017 07:19:42 +1100, Chris Angelico wrote: > On Tue, Jan 24, 2017 at 6:59 AM, Grant Edwards > wrote: >> On 2017-01-23, breamore...@gmail.com wrote: >> >>> The article is here http://lenkaspace.net/index.php/blog/show/111 >> >> I don't really think any of his points are valid, but

Re: Is it possible to get the Physical memory address of a variable in python?

2017-01-23 Thread Skip Montanaro
On Mon, Jan 23, 2017 at 2:17 PM, Chris Angelico wrote: >> There. *Now* you have an address. Hack to your heart's content. > > No, you now have a hexadecimal representation of an integer. You missed my attempt at levity, I think. S -- https://mail.python.org/mailman/listinfo/python-list

Re: How coding in Python is bad for you

2017-01-23 Thread Chris Angelico
On Tue, Jan 24, 2017 at 6:59 AM, Grant Edwards wrote: > On 2017-01-23, breamore...@gmail.com wrote: > >> The article is here http://lenkaspace.net/index.php/blog/show/111 > > I don't really think any of his points are valid, but one way that > programming in Python is bad for you: > > * It reduc

Re: Is it possible to get the Physical memory address of a variable in python?

2017-01-23 Thread Michael Torrie
On 01/23/2017 10:49 AM, Sourabh Kalal wrote: > how we can access the value from using id.. > like x=10 > id(x) > 3235346364 > > how i can read value 10 using id 3235346364 Many objects in python such as numbers like 10 or strings are immutable; they can never be altered once called into existance

Re: Is it possible to get the Physical memory address of a variable in python?

2017-01-23 Thread Chris Angelico
On Tue, Jan 24, 2017 at 6:05 AM, Skip Montanaro wrote: > On Mon, Jan 23, 2017 at 12:49 PM, Chris Angelico wrote: >> >> On Tue, Jan 24, 2017 at 4:49 AM, Sourabh Kalal wrote: >> > how we can access the value from using id.. >> > like x=10 >> > id(x) >> > 3235346364 >> > >> > how i can read value 1

Re: How coding in Python is bad for you

2017-01-23 Thread Michael Torrie
On 01/23/2017 10:34 AM, Chris Angelico wrote: > I would respond point-by-point if I thought the author had a clue. Yeah a pretty bizarre, flame-bait blog post. Glad I use an ad-blocker as a matter of course. I'm uncertain as to why Mark chose to post that particular little gem to the list. It's

Re: How coding in Python is bad for you

2017-01-23 Thread Grant Edwards
On 2017-01-23, breamore...@gmail.com wrote: > The article is here http://lenkaspace.net/index.php/blog/show/111 I don't really think any of his points are valid, but one way that programming in Python is bad for you: * It reduces your tolerance for progamming in PHP zero. If you end up ass

Re: Adding colormaps?

2017-01-23 Thread Martin Schöön
Den 2017-01-23 skrev blue : > you have here a full example , for another version not significant changes: > http://matplotlib.org/examples/color/colormaps_reference.html Thanks but this only shows how to use it once you have it. When I run this code I get an error message telling it can't find any

Re: Is it possible to get the Physical memory address of a variable in python?

2017-01-23 Thread Peter Otten
Sourabh Kalal wrote: > how we can access the value from using id.. > like x=10 > id(x) > 3235346364 > > how i can read value 10 using id 3235346364 Use ctypes: $ python3 Python 3.4.3 (default, Nov 17 2016, 01:08:31) [GCC 4.8.4] on linux Type "help", "copyright", "credits" or "license" for more

Re: Is it possible to get the Physical memory address of a variable in python?

2017-01-23 Thread Skip Montanaro
On Mon, Jan 23, 2017 at 12:49 PM, Chris Angelico wrote: > > On Tue, Jan 24, 2017 at 4:49 AM, Sourabh Kalal wrote: > > how we can access the value from using id.. > > like x=10 > > id(x) > > 3235346364 > > > > how i can read value 10 using id 3235346364 > > No, you can't. That isn't a memory addre

Re: Is it possible to get the Physical memory address of a variable in python?

2017-01-23 Thread Terry Reedy
On 1/23/2017 12:49 PM, Sourabh Kalal wrote: how we can access the value from using id.. like x=10 id(x) 3235346364 how i can read value 10 using id 3235346364 *In Python*, you cannot. Ids are mainly for internal use of implementations. Implementors also use them to test their implementation

Re: Is it possible to get the Physical memory address of a variable in python?

2017-01-23 Thread Chris Angelico
On Tue, Jan 24, 2017 at 4:49 AM, Sourabh Kalal wrote: > how we can access the value from using id.. > like x=10 > id(x) > 3235346364 > > how i can read value 10 using id 3235346364 No, you can't. That isn't a memory address - it's just a unique identifier. Python doesn't have memory addresses. C

Re: How coding in Python is bad for you

2017-01-23 Thread Ethan Furman
On 01/23/2017 09:34 AM, Chris Angelico wrote: On Tue, Jan 24, 2017 at 4:24 AM, wrote: The article is here http://lenkaspace.net/index.php/blog/show/111 I would respond point-by-point if I thought the author had a clue. Yeah, arguing with that person will be a waste of time. -- ~Ethan~ --

Is it possible to get the Physical memory address of a variable in python?

2017-01-23 Thread Sourabh Kalal
how we can access the value from using id.. like x=10 id(x) 3235346364 how i can read value 10 using id 3235346364 -- https://mail.python.org/mailman/listinfo/python-list

Re: How coding in Python is bad for you

2017-01-23 Thread Chris Angelico
On Tue, Jan 24, 2017 at 4:24 AM, wrote: > The article is here http://lenkaspace.net/index.php/blog/show/111 I would respond point-by-point if I thought the author had a clue. ChrisA -- https://mail.python.org/mailman/listinfo/python-list

How coding in Python is bad for you

2017-01-23 Thread breamoreboy
The article is here http://lenkaspace.net/index.php/blog/show/111 Kindest regards. Mark Lawrence. -- https://mail.python.org/mailman/listinfo/python-list

Re: How to create a socket.socket() object from a socket fd?

2017-01-23 Thread Grant Edwards
On 2017-01-23, Antoon Pardon wrote: > Op 22-01-17 om 01:52 schreef Grant Edwards: >> Newsgroups: gmane.comp.python.general >> From: Grant Edwards >> Subject: Re: How to create a socket.socket() object from a socket fd? >> References: >> >> >> Followup-To: >> >> >> >> I'm still baffled why

Re: [Python-ideas] "Immutable Builder" Pattern and Operator

2017-01-23 Thread breamoreboy
On Monday, January 23, 2017 at 2:11:53 PM UTC, M.-A. Lemburg wrote: > On 23.01.2017 14:28, Soni L. wrote: > > > > > > On 23/01/17 11:18 AM, M.-A. Lemburg wrote: > >> On 23.01.2017 14:05, Soni L. wrote: > >>> Yeah but the dotequals operator has many other benefits: > >>> > >>> long_name .= __call_

Re: How to create a socket.socket() object from a socket fd?

2017-01-23 Thread Antoon Pardon
Op 22-01-17 om 01:52 schreef Grant Edwards: > Newsgroups: gmane.comp.python.general > From: Grant Edwards > Subject: Re: How to create a socket.socket() object from a socket fd? > References: > > > Followup-To: > > > > I'm still baffled why the standard library fromfd() code dup()s the > de

Re: [Python-ideas] "Immutable Builder" Pattern and Operator

2017-01-23 Thread M.-A. Lemburg
On 23.01.2017 14:28, Soni L. wrote: > > > On 23/01/17 11:18 AM, M.-A. Lemburg wrote: >> On 23.01.2017 14:05, Soni L. wrote: >>> Yeah but the dotequals operator has many other benefits: >>> >>> long_name .= __call__ # cast to callable >>> long_name .= wrapped # unwrap >>> etc >>> >>> And it also

Re: Using python to start programs after logging in

2017-01-23 Thread Cecil Westerhof
On Thursday 19 Jan 2017 20:08 CET, Cecil Westerhof wrote: > I am writing a python program to start the programs that need to be > started after logging in. I published what I have until now at: https://github.com/CecilWesterhof/PythonScripts/blob/master/startPrograms.py I do not mind some fe

Re: Adding colormaps?

2017-01-23 Thread blue
you have here a full example , for another version not significant changes: http://matplotlib.org/examples/color/colormaps_reference.html -- https://mail.python.org/mailman/listinfo/python-list

Re: Problems with python3.6 on one system, but OK on another

2017-01-23 Thread dieter
Cecil Westerhof writes: > I build python3.6 on two systems. On one system everything is OK: > Python 3.6.0 (default, Jan 21 2017, 11:19:56) > [GCC 4.9.2] on linux > Type "help", "copyright", "credits" or "license" for more information. > > > But on another I get: > Could not find platform depend