Re: Fwd: ImportError: No module named site

2015-07-23 Thread chenc...@inhand.com.cn
hi: Do you know, where can I download the python2.7.10-xcompile.patch file?thanks. On 07/24/2015 10:20 AM, Christopher Mullins wrote: What did you set those variables to? Also, output from python -v would be helpful. On Jul 23, 2015 10:15 PM, "Laura Creighton" > w

Re: Integers with leading zeroes

2015-07-23 Thread Chris Angelico
On Fri, Jul 24, 2015 at 4:23 PM, Gregory Ewing wrote: > Michael Torrie wrote: >> >> A credit card number is indeed a number, and there are >> mathematical formulas for determining if a particular number is a valid >> (as in well-formed) credit card number, > > > If you're talking about the check-d

Re: Integers with leading zeroes

2015-07-23 Thread Gregory Ewing
Michael Torrie wrote: A credit card number is indeed a number, and there are mathematical formulas for determining if a particular number is a valid (as in well-formed) credit card number, If you're talking about the check-digit algorithm, that doesn't treat the whole number as an integer, it w

Re: OT Re: Math-embarrassment results in CS [was: Should non-security 2.7 bugs be fixed?]

2015-07-23 Thread Rustom Mody
On Friday, July 24, 2015 at 2:59:41 AM UTC+5:30, Marko Rauhamaa wrote: > Chris : > > > Fortunately, we don't need to completely understand it. New Horizons > > reached Pluto right on time after a decade of flight that involved > > taking a left turn at Jupiter... we can predict exactly what angle

Re: Object Pool design pattern

2015-07-23 Thread Laura Creighton
In a message of Thu, 23 Jul 2015 23:09:38 +0200, Abder-Rahman Ali writes: >Hello, > >How can we implement the Object Pool design pattern in Python, especially >when the pool consists of array data types? > >Thanks. Is your problem 'I don't know how to implement the Object Pool Design pattern at al

Re: Fwd: ImportError: No module named site

2015-07-23 Thread Christopher Mullins
What did you set those variables to? Also, output from python -v would be helpful. On Jul 23, 2015 10:15 PM, "Laura Creighton" wrote: > In a message of Fri, 24 Jul 2015 09:37:35 +0800, "chenc...@inhand.com.cn" > write > s: > >hi: > >I'm Needing to get python 2.7.10 to cross compile correctly for

Object Pool design pattern

2015-07-23 Thread Abder-Rahman Ali
Hello, How can we implement the Object Pool design pattern in Python, especially when the pool consists of array data types? Thanks. -- https://mail.python.org/mailman/listinfo/python-list

Re: OT Re: Math-embarrassment results in CS [was: Should non-security 2.7 bugs be fixed?]

2015-07-23 Thread Rick Johnson
On Thursday, July 23, 2015 at 9:03:15 PM UTC-5, Paul Rubin wrote: > Did you hear about the idiot topologist? He couldn't tell his butt from > a hole in the ground, but he *could* tell his butt from two holes in the > ground. This sounds more like a riddle than a joke. So in other words: the messa

Re: Fwd: ImportError: No module named site

2015-07-23 Thread Laura Creighton
In a message of Fri, 24 Jul 2015 09:37:35 +0800, "chenc...@inhand.com.cn" write s: >hi: >I'm Needing to get python 2.7.10 to cross compile correctly for an ARM >embedded device. When I execute python using shell, it comes out this >error:ImportError: No module named site.I have setted environment

Re: OT Re: Math-embarrassment results in CS [was: Should non-security 2.7 bugs be fixed?]

2015-07-23 Thread Paul Rubin
Grant Edwards writes: > You can always pick out the topologist at a conference: he's the one > trying to dunk his coffee cup in his doughnut. > [Hey, how often do you get to use a topology joke.] Did you hear about the idiot topologist? He couldn't tell his butt from a hole in the ground, but h

Re: Python 3.4 Idle?

2015-07-23 Thread Steve Burrus
On Thursday, July 23, 2015 at 8:41:03 PM UTC-5, Chris Angelico wrote: > On Fri, Jul 24, 2015 at 11:34 AM, Steve Burrus > wrote: > > I got Idle the other day biut had to get the older version, 2.7, of python > > to get it. So I wonder if there is an Idle version that comes with python > > 3.4.*

Re: OT Re: Math-embarrassment results in CS [was: Should non-security 2.7 bugs be fixed?]

2015-07-23 Thread Rick Johnson
On Thursday, July 23, 2015 at 7:08:10 PM UTC-5, Grant Edwards wrote: > You can always pick out the topologist at a conference: > he's the one trying to dunk his coffee cup in his > doughnut. > > [Hey, how often do you get to use a topology joke.] Don't sale yourself short Grant. You get extra bo

Re: Python 3.4 Idle?

2015-07-23 Thread Chris Angelico
On Fri, Jul 24, 2015 at 11:34 AM, Steve Burrus wrote: > I got Idle the other day biut had to get the older version, 2.7, of python to > get it. So I wonder if there is an Idle version that comes with python 3.4.*? What system are you on? What did you do to install Python? On Windows, the python

Fwd: ImportError: No module named site

2015-07-23 Thread chenc...@inhand.com.cn
hi: I'm Needing to get python 2.7.10 to cross compile correctly for an ARM embedded device. When I execute python using shell, it comes out this error:ImportError: No module named site.I have setted environment varible:PYTHONHOME and PYTHONPATH. Is there some good idea to sovle this issue?

Python 3.4 Idle?

2015-07-23 Thread Steve Burrus
I got Idle the other day biut had to get the older version, 2.7, of python to get it. So I wonder if there is an Idle version that comes with python 3.4.*? -- https://mail.python.org/mailman/listinfo/python-list

Python 3.4 Idle?

2015-07-23 Thread Steve Burrus
Listen I got back the Idle EAditor the other day but I had to install the older, version 2.7, version of Python to get it. So naturally I w onder if I can get Idle for version 3.4.*? -- https://mail.python.org/mailman/listinfo/python-list

Re: Find Minimum for element in multiple dimensional array

2015-07-23 Thread Denis McMahon
On Wed, 22 Jul 2015 15:54:06 -0700, Robert Davis wrote: > Given a set of arrays within an array how do I find the arrays with the > minimum values based on two elements/columns in the array? Those two > elements/columns are the destination zip code and distance. create a new dictionary for each

Re: OT Re: Math-embarrassment results in CS [was: Should non-security 2.7 bugs be fixed?]

2015-07-23 Thread Grant Edwards
On 2015-07-23, Marko Rauhamaa wrote: > Chris Angelico : > >> Fortunately, we don't need to completely understand it. New Horizons >> reached Pluto right on time after a decade of flight that involved >> taking a left turn at Jupiter... we can predict exactly what angle to >> fire the rockets at in

Re: OT Re: Math-embarrassment results in CS [was: Should non-security 2.7 bugs be fixed?]

2015-07-23 Thread Mark Lawrence
On 23/07/2015 23:01, MRAB wrote: On 2015-07-23 22:50, Mark Lawrence wrote: On 23/07/2015 22:29, Marko Rauhamaa wrote: Chris Angelico : Fortunately, we don't need to completely understand it. New Horizons reached Pluto right on time after a decade of flight that involved taking a left turn at

Re: Should non-security 2.7 bugs be fixed?

2015-07-23 Thread Rick Johnson
On Wednesday, July 22, 2015 at 11:26:50 PM UTC-5, Jason Swails wrote: > I know my experiences don't hold true for everybody, but I > also don't think they are uncommon (I know several > colleagues that share many aspects of them).  And for me, > the *better* Python 2.7 becomes, and the longer it's

Re: OT Re: Math-embarrassment results in CS [was: Should non-security 2.7 bugs be fixed?]

2015-07-23 Thread Laura Creighton
In a message of Thu, 23 Jul 2015 23:01:51 +0100, MRAB writes: >And an Apple engineer would suggest buying a new car that runs only on >its manufacturer's brand of fuel. :-) Before you do that, read this: http://teslaclubsweden.se/test-drive-of-a-petrol-car/ (ps, if you can read Swedish, the Swedi

Re: OT Re: Math-embarrassment results in CS [was: Should non-security 2.7 bugs be fixed?]

2015-07-23 Thread MRAB
On 2015-07-23 22:50, Mark Lawrence wrote: On 23/07/2015 22:29, Marko Rauhamaa wrote: Chris Angelico : Fortunately, we don't need to completely understand it. New Horizons reached Pluto right on time after a decade of flight that involved taking a left turn at Jupiter... we can predict exactly

Re: OT Re: Math-embarrassment results in CS [was: Should non-security 2.7 bugs be fixed?]

2015-07-23 Thread Chris Angelico
On Fri, Jul 24, 2015 at 7:59 AM, Marko Rauhamaa wrote: > Laura Creighton : > >> In a message of Fri, 24 Jul 2015 00:29:28 +0300, Marko Rauhamaa writes: >>>At the time I was in college I heard topology was very fashionable >>>among mathematicians. That was because it was one of the last >>>remainin

Re: OT Re: Math-embarrassment results in CS [was: Should non-security 2.7 bugs be fixed?]

2015-07-23 Thread Marko Rauhamaa
Laura Creighton : > In a message of Fri, 24 Jul 2015 00:29:28 +0300, Marko Rauhamaa writes: >>At the time I was in college I heard topology was very fashionable >>among mathematicians. That was because it was one of the last >>remaining research topics that didn't yet have an application. > > I ha

Re: OT Re: Math-embarrassment results in CS [was: Should non-security 2.7 bugs be fixed?]

2015-07-23 Thread Chris Angelico
On Fri, Jul 24, 2015 at 7:50 AM, Mark Lawrence wrote: > Heard the one about the three engineers in the car that breaks down? > > The chemical engineer suggests that they could have contaminated fuel. They > should try and get a sample and get someone to take it to a lab for > analysis. > > The ele

Re: Find Minimum for element in multiple dimensional array

2015-07-23 Thread Robert Davis
On Wednesday, July 22, 2015 at 5:54:30 PM UTC-5, Robert Davis wrote: > Given a set of arrays within an array how do I find the arrays with the > minimum values based on two elements/columns in the array? Those two > elements/columns are the destination zip code and distance. > > I have an array

Re: OT Re: Math-embarrassment results in CS [was: Should non-security 2.7 bugs be fixed?]

2015-07-23 Thread Laura Creighton
In a message of Fri, 24 Jul 2015 00:29:28 +0300, Marko Rauhamaa writes: >Chris Angelico : > >> Fortunately, we don't need to completely understand it. New Horizons >> reached Pluto right on time after a decade of flight that involved >> taking a left turn at Jupiter... we can predict exactly what a

Re: OT Re: Math-embarrassment results in CS [was: Should non-security 2.7 bugs be fixed?]

2015-07-23 Thread Mark Lawrence
On 23/07/2015 22:29, Marko Rauhamaa wrote: Chris Angelico : Fortunately, we don't need to completely understand it. New Horizons reached Pluto right on time after a decade of flight that involved taking a left turn at Jupiter... we can predict exactly what angle to fire the rockets at in order

Re: OT Re: Math-embarrassment results in CS [was: Should non-security 2.7 bugs be fixed?]

2015-07-23 Thread Marko Rauhamaa
Chris Angelico : > Fortunately, we don't need to completely understand it. New Horizons > reached Pluto right on time after a decade of flight that involved > taking a left turn at Jupiter... we can predict exactly what angle to > fire the rockets at in order to get where we want to go, even witho

Re: OT Re: Math-embarrassment results in CS [was: Should non-security 2.7 bugs be fixed?]

2015-07-23 Thread Chris Angelico
On Fri, Jul 24, 2015 at 6:59 AM, Marko Rauhamaa wrote: > Ian Kelly : > >> Gravity existed before Newton, but the *theory* of gravity did not, so >> he composed the theory? > > Ironically, gravity is maybe the least well understood phenomenon in > modern physics. Fortunately, we don't need to comp

Re: OT Re: Math-embarrassment results in CS [was: Should non-security 2.7 bugs be fixed?]

2015-07-23 Thread Marko Rauhamaa
Ian Kelly : > Gravity existed before Newton, but the *theory* of gravity did not, so > he composed the theory? Ironically, gravity is maybe the least well understood phenomenon in modern physics. Marko -- https://mail.python.org/mailman/listinfo/python-list

Re: OT Re: Math-embarrassment results in CS [was: Should non-security 2.7 bugs be fixed?]

2015-07-23 Thread Ian Kelly
On Jul 22, 2015 9:46 PM, "Steven D'Aprano" < steve+comp.lang.pyt...@pearwood.info> wrote: > > On Thursday 23 July 2015 04:09, Rustom Mody wrote: > > > tl;dr To me (as unprofessional a musician as mathematician) I find it > > arbitrary that Newton *discovered* gravity whereas Beethoven *composed* >

Re: problem with selecting remote procedure calls

2015-07-23 Thread Irmen de Jong
On 23-7-2015 13:39, Tim Golden wrote: > On 23/07/2015 04:10, eric johansson wrote: >> https://docs.google.com/drawings/d/1M-TzfRaSaAhFXQk1OmcmHNOaW31_7W_7q0bf8CAJqSw/edit?usp=sharing >> >> while this is related to my speech recognition through the next >> project, is actually a good question for R

Re: Stripping sRGB profile from PNGs in python

2015-07-23 Thread Laura Creighton
To scale images, you should get Pillow, which can construct new images based on old ones for arbitrary size. see: http://pillow.readthedocs.org/en/latest/reference/Image.html Pillow is a fork of PIL. PIL isn't being maintained, Pillow is. Note that reading this is a good idea: http://united-code

Re: unexpected output while using list(and nested dictionary)

2015-07-23 Thread Mark Lawrence
On 23/07/2015 18:08, Grant Edwards wrote: I recomment mutt if you really want to stick with getting everything e-mailed to you (which I personally don't like). Better yet (IMO) point slrn or your favorite NNTP client at comp.lang.python on your friendly local Usenet server or at gmane's nntp ser

Re: Stripping sRGB profile from PNGs in python

2015-07-23 Thread Emile van Sebille
On 7/23/2015 10:31 AM, Ryan Holmes wrote: We're getting this error when trying to load some of out projects images: libpng warning: iCCP: known incorrect sRGB profile The source files that we have some with incorrect sRGB profiles. We don't have control over the source files, but what we

Stripping sRGB profile from PNGs in python

2015-07-23 Thread Ryan Holmes
We're getting this error when trying to load some of out projects images: libpng warning: iCCP: known incorrect sRGB profile The source files that we have some with incorrect sRGB profiles. We don't have control over the source files, but what we normally do is take them and scale them d

Re: unexpected output while using list(and nested dictionary)

2015-07-23 Thread Grant Edwards
On 2015-07-23, Steven D'Aprano wrote: > On Fri, 24 Jul 2015 12:04 am, max scalf wrote: [...] >> Do you guys have any suggestion as to what to use if the code is >> lone, as the formatting gets lost in an email... > > Use a tool that doesn't break your emails. > > If you turn "Rich Text" or "Form

Re: How we can send mail with attachment in Python?

2015-07-23 Thread Robert Davis
On Monday, July 20, 2015 at 12:01:49 AM UTC-5, Chris Angelico wrote: > On Mon, Jul 20, 2015 at 2:54 PM, Kevin Peterson wrote: > > How we can send mail with attachment in Python? Is it any prerequisite for > > it? > > You could use your favourite search engine to look this up. Or you > could poke

Re: unexpected output while using list(and nested dictionary)

2015-07-23 Thread Rustom Mody
On Thursday, July 23, 2015 at 9:25:46 PM UTC+5:30, Laura Creighton wrote: > In a message of Thu, 23 Jul 2015 09:04:38 -0500, max scalf writes: > >I am sorry for doing what i did (asking question in Stackoverflow and > >pasting the link here). I will keep this in mind for the future. I am > >very

Re: unexpected output while using list(and nested dictionary)

2015-07-23 Thread Laura Creighton
In a message of Fri, 24 Jul 2015 00:57:42 +1000, "Steven D'Aprano" writes: >On Fri, 24 Jul 2015 12:04 am, max scalf wrote: >Another alternative is to save your code in a .py file, then attach it to >the email as an attachment. Even the most obnoxious email program doesn't >mangle attachments, at le

Re: unexpected output while using list(and nested dictionary)

2015-07-23 Thread Laura Creighton
In a message of Thu, 23 Jul 2015 09:04:38 -0500, max scalf writes: >I am sorry for doing what i did (asking question in Stackoverflow and >pasting the link here). I will keep this in mind for the future. I am >very much new to this list, so was not sure. > >Do you guys have any suggestion as to w

Re: unexpected output while using list(and nested dictionary)

2015-07-23 Thread Ben Finney
max scalf writes: > I am sorry for doing what i did (asking question in Stackoverflow and > pasting the link here). No harm done. The rule isn't special to this forum; it's best to minimise the fragility of your message by not relying on many sites all staying the same over a long time. > Do yo

Re: unexpected output while using list(and nested dictionary)

2015-07-23 Thread Steven D'Aprano
On Fri, 24 Jul 2015 12:04 am, max scalf wrote: > I am sorry for doing what i did (asking question in Stackoverflow and > pasting the link here). I will keep this in mind for the future. I am > very much new to this list, so was not sure. > > Do you guys have any suggestion as to what to use if

Search in Flask Restful

2015-07-23 Thread subhabrata . banerji
Dear Group, I am trying to build one REST framework using Restful Flask. To put or get I am trying to use the requests module, as given in the following lines. >>> var2=requests.put('http://127.0.0.1:5000/todos/todo1', data={'task': 'It is >>> my challenge'}) >>> var3=requests.get('http://127.

Re: unexpected output while using list(and nested dictionary)

2015-07-23 Thread max scalf
I am sorry for doing what i did (asking question in Stackoverflow and pasting the link here). I will keep this in mind for the future. I am very much new to this list, so was not sure. Do you guys have any suggestion as to what to use if the code is lone, as the formatting gets lost in an email.

Re: global and loop control variable

2015-07-23 Thread Lorenzo Sutton
On 23/07/2015 14:31, Steven D'Aprano wrote: On Thu, 23 Jul 2015 09:20 pm, Lorenzo Sutton wrote: On 23/07/2015 12:24, candide wrote: Now, global declaration has another restriction, as PLR explains: [https://docs.python.org/3.4/reference/simple_stmts.html#the-global-statement]

Re: OT Re: Math-embarrassment results in CS [was: Should non-security 2.7 bugs be fixed?]

2015-07-23 Thread Rustom Mody
On Thursday, July 23, 2015 at 12:28:19 PM UTC+5:30, Gregory Ewing wrote: > Rustom Mody wrote: > > Ive known good ones) most practicing-mathematicians proceed on the > > assumption > > that they *discover* math and not that they *invent* it. > > For something purely abstract like mathematics, I d

Re: global and loop control variable

2015-07-23 Thread Steven D'Aprano
On Thu, 23 Jul 2015 09:20 pm, Lorenzo Sutton wrote: > On 23/07/2015 12:24, candide wrote: >> Now, global declaration has another restriction, as PLR explains: >> [https://docs.python.org/3.4/reference/simple_stmts.html#the-global-statement] >> ~ >> Names listed

Re: Find Minimum for element in multiple dimensional array

2015-07-23 Thread Robert Davis
On Wednesday, July 22, 2015 at 5:54:30 PM UTC-5, Robert Davis wrote: > Given a set of arrays within an array how do I find the arrays with the > minimum values based on two elements/columns in the array? Those two > elements/columns are the destination zip code and distance. > > I have an array

Re: Optimizing if statement check over a numpy value

2015-07-23 Thread Jeremy Sanders
Heli Nix wrote: > Is there any way that I can optimize this if statement. Array processing is much faster in numpy. Maybe this is close to what you want import numpy as N # input data vals = N.array([42, 1, 5, 3.14, 53, 1, 12, 11, 1]) # list of items to exclude exclude = [1] # convert to a bool

Re: problem with selecting remote procedure calls

2015-07-23 Thread Tim Golden
On 23/07/2015 04:10, eric johansson wrote: > https://docs.google.com/drawings/d/1M-TzfRaSaAhFXQk1OmcmHNOaW31_7W_7q0bf8CAJqSw/edit?usp=sharing > > while this is related to my speech recognition through the next > project, is actually a good question for RPCs in general. > Specifically, are there an

Re: global and loop control variable

2015-07-23 Thread Lorenzo Sutton
On 23/07/2015 12:24, candide wrote: [...] Now, global declaration has another restriction, as PLR explains: [https://docs.python.org/3.4/reference/simple_stmts.html#the-global-statement] ~ Names listed in a global statement must not be defined as formal pa

ImportError: No module named site

2015-07-23 Thread chenc...@inhand.com.cn
hi: I'm Needing to get python 2.7.10 to cross compile correctly for an ARM embedded device. When I execute python using shell, it comes out this error:ImportError: No module named site.I have setted environment varible:PYTHONHOME and PYTHONPATH. Is there some good idea to sovle this issue? --

global and loop control variable

2015-07-23 Thread candide
About global declarations, Python Language Ref (PLR) explains: [https://docs.python.org/3.4/reference/simple_stmts.html#the-global-statement] ~ Names listed in a global statement must not be used in the same code block textually preceding that global statement.

Re: Optimizing if statement check over a numpy value

2015-07-23 Thread Laura Creighton
Take a look at the sorted collection recipe: http://code.activestate.com/recipes/577197-sortedcollection/ You want myList to be a sorted List. You want lookups to be fast. See if that improves things enough for you. It may be possible to have better speedups if instead of myList you write myTre

Re: convert output to list(and nested dictionary)

2015-07-23 Thread Peter Otten
max scalf wrote: > Hi Peter, > > Could you please explain what i am doing wrong? I did inspected the > "get_all_security_groups()" object using dir and i do need the get_data > function for this to work...as i have to parse the output...just getting > the rule and grants does not work...as it co

Re: Optimizing if statement check over a numpy value

2015-07-23 Thread MRAB
On 2015-07-23 10:21, Heli Nix wrote: Dear all, I have the following piece of code. I am reading a numpy dataset from an hdf5 file and I am changing values to a new value if they equal 1. There is 90 percent chance that (if id not in myList:) is true and in 10 percent of time is false. with

Optimizing if statement check over a numpy value

2015-07-23 Thread Heli Nix
Dear all, I have the following piece of code. I am reading a numpy dataset from an hdf5 file and I am changing values to a new value if they equal 1. There is 90 percent chance that (if id not in myList:) is true and in 10 percent of time is false. with h5py.File(inputFile, 'r') as f1:

on keeping things civil (was: Encoding of Python 2 string literals)

2015-07-23 Thread Cameron Simpson
On 22Jul2015 22:26, Mark Lawrence wrote: He refuses point blank to contribute to core python because he will not sign the CLA. So? That's his prerogative. There's plenty of work I won't undertake because of the conditions attached. Defense/military comes to mind as an example. Oh, and ple

Re: OT Re: Math-embarrassment results in CS [was: Should non-security 2.7 bugs be fixed?]

2015-07-23 Thread Rustom Mody
On Thursday, July 23, 2015 at 12:28:19 PM UTC+5:30, Gregory Ewing wrote: > Rustom Mody wrote: > > Ive known good ones) most practicing-mathematicians proceed on the > > assumption > > that they *discover* math and not that they *invent* it. > > For something purely abstract like mathematics, I d

Re: OT Re: Math-embarrassment results in CS [was: Should non-security 2.7 bugs be fixed?]

2015-07-23 Thread Marko Rauhamaa
Steven D'Aprano : > I think that we can equally choose the natural numbers to be > axiomatic, or sets to be axiomatic and derive natural numbers from > them. Neither is more correct than the other. Mathematicians quit trying to define what natural numbers mean and just chose a standard enumerable

Re: Integers with leading zeroes

2015-07-23 Thread Michael Torrie
On 07/22/2015 07:51 AM, Grant Edwards wrote: > On 2015-07-22, Ben Finney wrote: >> Laura Creighton writes: >> >>> The biggest use I have for decimal numbers that begin with 0 is in >>> credit card numbers, account numbers and the like where the first >>> check you do is 'does this thing have the

Re: password authentication failed

2015-07-23 Thread Gary Roach
On 07/16/2015 04:53 PM, Chris Angelico wrote: On Fri, Jul 17, 2015 at 9:34 AM, Gary Roach wrote: On 07/15/2015 11:25 AM, Chris Angelico wrote: You should then be able to create a regular user, and grant appropriate permissions: postgres=# create user archives password 'traded-links-linguisti

Re: OT Re: Math-embarrassment results in CS [was: Should non-security 2.7 bugs be fixed?]

2015-07-23 Thread Gregory Ewing
Rustom Mody wrote: Ive known good ones) most practicing-mathematicians proceed on the assumption that they *discover* math and not that they *invent* it. For something purely abstract like mathematics, I don't see how there's any distinction between "discovering" and "inventing". They're two wo