Re: warnings filters for varying message

2013-06-28 Thread Peter Otten
John Reid wrote: > Looking at the docs for warnings.simplefilter > (http://docs.python.org/2/library/warnings.html) I think the following > script should only produce one warning at each line as any message is > matched by the simple filter > > import warnings > warnings.simplefilter('default') >

Re: Making a pass form cgi => webpy framework

2013-06-28 Thread Robert Kern
On 2013-06-28 04:38, Νίκος wrote: Στις 28/6/2013 2:08 πμ, ο/η Cameron Simpson έγραψε: Pick a simple framework or templating engine and try it. I have no recommendations to make in this area myself. Can you explain to me the difference of the former and latter? A templating engine takes you

Re: Making a pass form cgi => webpy framework

2013-06-28 Thread Νίκος
Στις 28/6/2013 12:35 μμ, ο/η Robert Kern έγραψε: On 2013-06-28 04:38, Νίκος wrote: Στις 28/6/2013 2:08 πμ, ο/η Cameron Simpson έγραψε: Pick a simple framework or templating engine and try it. I have no recommendations to make in this area myself. Can you explain to me the difference of the

Re: FACTS: WHY THE PYTHON LANGUAGE FAILS.

2013-06-28 Thread 88888 Dihedral
Jason Friedman於 2013年6月28日星期五UTC+8上午11時52分33秒寫道: > > I was hoping to have a good laugh. :| > > > > > > > Although I wouldn't call it hostile. > > > > I think the python community is being educated in how to spam and troll at > the same time. > > > > It is possible the OP has a mental di

Re: Making a pass form cgi => webpy framework

2013-06-28 Thread Robert Kern
On 2013-06-28 11:15, Νίκος wrote: Στις 28/6/2013 12:35 μμ, ο/η Robert Kern έγραψε: On 2013-06-28 04:38, Νίκος wrote: Στις 28/6/2013 2:08 πμ, ο/η Cameron Simpson έγραψε: Pick a simple framework or templating engine and try it. I have no recommendations to make in this area myself. Can you e

Problems with subclassing enum34

2013-06-28 Thread Thomas Heller
trying out the enum34 module. What I want to create is a subclass of enum.Enum that is also based on ctypes.c_int so that I can better use enum instances in ctypes api calls. When I do this, I get a metaclass conflict: >>> class MyEnum(ctypes.c_int, enum.Enum): ...FOOBAR = 0 ... Traceback

Re: Why is the argparse module so inflexible?

2013-06-28 Thread Andrew Berg
After getting over the hurdles I initially explained and moving forward, I've found that standard command-line parsing and its conventions are far too ingrained in the design of argparse to make it useful as a general command parser. I think I would end up overriding a substantial amount of the m

Re: Problems with subclassing enum34

2013-06-28 Thread Robert Kern
On 2013-06-28 11:48, Thomas Heller wrote: trying out the enum34 module. What I want to create is a subclass of enum.Enum that is also based on ctypes.c_int so that I can better use enum instances in ctypes api calls. When I do this, I get a metaclass conflict: >>> class MyEnum(ctypes.c_int,

Re: Don't feed the troll...

2013-06-28 Thread Antoon Pardon
Op 26-06-13 23:02, Ian Kelly schreef: On Wed, Jun 26, 2013 at 1:46 PM, Antoon Pardon wrote: But you didn't even go to the trouble of trying to find out what those concerns would be and how strong people feel about them. You just took your assumptions about those concerns for granted and procee

Re: Problems with subclassing enum34

2013-06-28 Thread 88888 Dihedral
Thomas Heller於 2013年6月28日星期五UTC+8下午6時48分38秒寫道: > trying out the enum34 module. > > > > What I want to create is a subclass of enum.Enum that is also > > based on ctypes.c_int so that I can better use enum instances > > in ctypes api calls. > > > > When I do this, I get a metaclass conflict:

Re: Making a pass form cgi => webpy framework

2013-06-28 Thread rusi
On Friday, June 28, 2013 3:45:27 PM UTC+5:30, Νίκος wrote: > Στις 28/6/2013 12:35 μμ, ο/η Robert Kern έγραψε: > I see, your explanation started to make things clearer to me. > What is the easiest and simplest web framework you advise me to use? > Here's a picture of the web-development scene as I

? get negative from prod(x) when x is positive integers

2013-06-28 Thread Vincent Davis
I have a list of a list of integers. The lists are long so i cant really show an actual example of on of the lists, but I know that they contain only the integers 1,2,3,4. so for example. s2 = [[1,2,2,3,2,1,4,4],[2,4,3,2,3,1]] I am calculating the product, sum, max, min of each list in s2 but

Re: ? get negative from prod(x) when x is positive integers

2013-06-28 Thread Peter Otten
Vincent Davis wrote: > I have a list of a list of integers. The lists are long so i cant really > show an actual example of on of the lists, but I know that they contain > only the integers 1,2,3,4. so for example. > s2 = [[1,2,2,3,2,1,4,4],[2,4,3,2,3,1]] > > I am calculating the product, sum, ma

Re: ? get negative from prod(x) when x is positive integers

2013-06-28 Thread Joshua Landau
On 28 June 2013 15:38, Vincent Davis wrote: > I have a list of a list of integers. The lists are long so i cant really > show an actual example of on of the lists, but I know that they contain only > the integers 1,2,3,4. so for example. > s2 = [[1,2,2,3,2,1,4,4],[2,4,3,2,3,1]] > > I am calculatin

Re: Problems with subclassing enum34

2013-06-28 Thread Ethan Furman
On 06/28/2013 03:48 AM, Thomas Heller wrote: trying out the enum34 module. What I want to create is a subclass of enum.Enum that is also based on ctypes.c_int so that I can better use enum instances in ctypes api calls. Have you tried using enum.IntEnum? If you were able to pass ints in befor

Re: Problems with subclassing enum34

2013-06-28 Thread Thomas Heller
Am 28.06.2013 17:16, schrieb Ethan Furman: On 06/28/2013 03:48 AM, Thomas Heller wrote: trying out the enum34 module. What I want to create is a subclass of enum.Enum that is also based on ctypes.c_int so that I can better use enum instances in ctypes api calls. Have you tried using enum.IntE

Re: ? get negative from prod(x) when x is positive integers

2013-06-28 Thread Vincent Davis
@Joshua "You are using numpy.prod()" Wow, since sum([1,2,3,4]) worked I tried prod([1,2,3,4]) and got the right answer so I just used that. Confusing that it would use numpy.prod(), I realize now there is no python prod(). At no point do I "import numpy" in my code. The seems to be a result of usin

Re: Problems with subclassing enum34

2013-06-28 Thread Thomas Heller
Am 28.06.2013 17:25, schrieb Thomas Heller: Robert Kern: enum.EnumMeta uses super() in its __new__() implementation but _ctypes.PyCSimpleType doesn't. Thus, only _ctypes.PyCSimpleType.__new__() gets a chance to run. Switching the order of the two might work. Robert found the problem but I'm

Re: ? get negative from prod(x) when x is positive integers

2013-06-28 Thread Terry Reedy
On 6/28/2013 10:38 AM, Vincent Davis wrote: I have a list of a list of integers. The lists are long so i cant really show an actual example of on of the lists, but I know that they contain only the integers 1,2,3,4. so for example. s2 = [[1,2,2,3,2,1,4,4],[2,4,3,2,3,1]] I am calculating the prod

Re: Problems with subclassing enum34

2013-06-28 Thread Robert Kern
On 2013-06-28 16:32, Thomas Heller wrote: Am 28.06.2013 17:25, schrieb Thomas Heller: Robert Kern: enum.EnumMeta uses super() in its __new__() implementation but _ctypes.PyCSimpleType doesn't. Thus, only _ctypes.PyCSimpleType.__new__() gets a chance to run. Switching the order of the two migh

Re: ? get negative from prod(x) when x is positive integers

2013-06-28 Thread Robert Kern
On 2013-06-28 16:26, Vincent Davis wrote: @Joshua "You are using numpy.prod()" Wow, since sum([1,2,3,4]) worked I tried prod([1,2,3,4]) and got the right answer so I just used that. Confusing that it would use numpy.prod(), I realize now there is no python prod(). At no point do I "import numpy"

Re: Problems with subclassing enum34

2013-06-28 Thread Ethan Furman
On 06/28/2013 08:32 AM, Thomas Heller wrote: Am 28.06.2013 17:25, schrieb Thomas Heller: Robert Kern: enum.EnumMeta uses super() in its __new__() implementation but _ctypes.PyCSimpleType doesn't. Thus, only _ctypes.PyCSimpleType.__new__() gets a chance to run. Switching the order of the two m

what happened?

2013-06-28 Thread mpowers
-- http://mail.python.org/mailman/listinfo/python-list

Re: FACTS: WHY THE PYTHON LANGUAGE FAILS.

2013-06-28 Thread Wayne Werner
On Fri, 28 Jun 2013, 8 Dihedral wrote: KIND OF BORING TO SHOW HOW THE LISP PROGRAMMING WAS ASSIMULATED BY THE PYTHON COMMUNITY. OF COURSE PYTHON IS A GOOD LANGUAGE FOR DEVELOPING ARTIFICIAL INTELEGENT ROBOT PROGRAMS NOT SO BRAIN DAMAGES, OR SO SLAVERY AS C/C++ OR ASEMBLY PARTS. Best. Post

Re: FACTS: WHY THE PYTHON LANGUAGE FAILS.

2013-06-28 Thread Joel Goldstick
On Fri, Jun 28, 2013 at 2:52 PM, Wayne Werner wrote: > On Fri, 28 Jun 2013, 8 Dihedral wrote: > > KIND OF BORING TO SHOW HOW THE LISP PROGRAMMING >> WAS ASSIMULATED BY THE PYTHON COMMUNITY. >> >> OF COURSE PYTHON IS A GOOD LANGUAGE FOR DEVELOPING >> ARTIFICIAL INTELEGENT ROBOT PROGRAMS NOT S

Re: FACTS: WHY THE PYTHON LANGUAGE FAILS.

2013-06-28 Thread Joshua Landau
On 28 June 2013 19:52, Wayne Werner wrote: > On Fri, 28 Jun 2013, 8 Dihedral wrote: > >> KIND OF BORING TO SHOW HOW THE LISP PROGRAMMING >> WAS ASSIMULATED BY THE PYTHON COMMUNITY. >> >> OF COURSE PYTHON IS A GOOD LANGUAGE FOR DEVELOPING >> ARTIFICIAL INTELEGENT ROBOT PROGRAMS NOT SO BRAIN DAM

Re: FACTS: WHY THE PYTHON LANGUAGE FAILS.

2013-06-28 Thread Joel Goldstick
On Fri, Jun 28, 2013 at 3:22 PM, Joshua Landau wrote: > On 28 June 2013 19:52, Wayne Werner wrote: > > On Fri, 28 Jun 2013, 8 Dihedral wrote: > > > >> KIND OF BORING TO SHOW HOW THE LISP PROGRAMMING > >> WAS ASSIMULATED BY THE PYTHON COMMUNITY. > >> > >> OF COURSE PYTHON IS A GOOD LANGUAGE FO

Re: FACTS: WHY THE PYTHON LANGUAGE FAILS.

2013-06-28 Thread Joshua Landau
On 28 June 2013 20:35, Joel Goldstick wrote: > > On Fri, Jun 28, 2013 at 3:22 PM, Joshua Landau > wrote: >> >> On 28 June 2013 19:52, Wayne Werner wrote: >> > On Fri, 28 Jun 2013, 8 Dihedral wrote: >> > >> >> KIND OF BORING TO SHOW HOW THE LISP PROGRAMMING >> >> WAS ASSIMULATED BY THE PYTHON

Re: FACTS: WHY THE PYTHON LANGUAGE FAILS.

2013-06-28 Thread Wayne Werner
On Fri, 28 Jun 2013, Joel Goldstick wrote: On Fri, Jun 28, 2013 at 2:52 PM, Wayne Werner wrote: On Fri, 28 Jun 2013, 8 Dihedral wrote: KIND OF BORING TO SHOW HOW THE LISP PROGRAMMING WAS ASSIMULATED BY THE PYTHON COMMUNITY. OF COURSE PYTHON IS

Re: How to make a web framework

2013-06-28 Thread Giorgos Tzampanakis
On 2013-06-27, gamesbrain...@gmail.com wrote: > I've used web frameworks, but I don't know how they work. Is there > anywhere that I can learn how this all works from scratch? Yes, read the source code of a mature framework. -- Real (i.e. statistical) tennis and snooker player rankings and rati

Re: How to make a web framework

2013-06-28 Thread Joel Goldstick
On Fri, Jun 28, 2013 at 5:00 PM, Giorgos Tzampanakis < giorgos.tzampana...@gmail.com> wrote: > On 2013-06-27, gamesbrain...@gmail.com wrote: > > > I've used web frameworks, but I don't know how they work. Is there > > anywhere that I can learn how this all works from scratch? > Although it is dat

Survey - how much do you rely on Free/Open Source Software?

2013-06-28 Thread Tony
Hi, I'm conducting a survey that aims to measure the importance that Open Source/Free Software has to people and organizations around the world. Answering is very quick (mostly one click per answer) Please answer it by clicking the link below: https://docs.google.com/forms/d/1bY5KQgsuPeGMwRoTY2DW

indexerror: list index out of range??

2013-06-28 Thread Titiksha Joshi
Hi, I am working on the following code but am getting the error: list index out of range. I surfed through the group but somehow I am not able to fix my error.Please guide.Structure is given below: m is a list of 5 elements. I have to match elements of m from fields in file ALL_BUSES_FINAL.cvs.

Re: Why is the argparse module so inflexible?

2013-06-28 Thread Ethan Furman
On 06/27/2013 03:49 PM, Steven D'Aprano wrote: [rant] I think it is lousy design for a framework like argparse to raise a custom ArgumentError in one part of the code, only to catch it elsewhere and call sys.exit. At the very least, that ought to be a config option, and off by default. Librarie

Re: Why is the argparse module so inflexible?

2013-06-28 Thread Modulok
Have you looked into docopt? -Modulok- On Fri, Jun 28, 2013 at 7:36 PM, Ethan Furman wrote: > On 06/27/2013 03:49 PM, Steven D'Aprano wrote: > >> >> [rant] >> I think it is lousy design for a framework like argparse to raise a >> custom ArgumentError in one part of the code, only to catch it e

Re: indexerror: list index out of range??

2013-06-28 Thread Chris Angelico
On Sat, Jun 29, 2013 at 11:20 AM, Titiksha Joshi wrote: > Hi, > I am working on the following code but am getting the error: list index out > of range. I surfed through the group but somehow I am not able to fix my > error.Please guide.Structure is given below: > m is a list of 5 elements. I hav

Re: indexerror: list index out of range??

2013-06-28 Thread Dave Angel
On 06/28/2013 09:20 PM, Titiksha Joshi wrote: Hi, I am working on the following code but am getting the error: list index out of range. I surfed through the group but somehow I am not able to fix my error.Please guide.Structure is given below: m is a list of 5 elements. I have to match elements

python adds an extra half space when reading from a string or list

2013-06-28 Thread charles benoit
number_drawn=() def load(lot_number,number_drawn): first=input("enter first lot: ") last=input("enter last lot: ") for lot_number in range(first,last): line_out=str(lot_number) for count in range(1,5): number_drawn=raw_input("number: ") line_out=l

Re: indexerror: list index out of range??

2013-06-28 Thread Titiksha
On Friday, June 28, 2013 8:20:28 PM UTC-5, Titiksha wrote: > Hi, > > I am working on the following code but am getting the error: list index out > of range. I surfed through the group but somehow I am not able to fix my > error.Please guide.Structure is given below: > > m is a list of 5 element

Re: Why is the argparse module so inflexible?

2013-06-28 Thread rusi
On Saturday, June 29, 2013 7:06:37 AM UTC+5:30, Ethan Furman wrote: > On 06/27/2013 03:49 PM, Steven D'Aprano wrote: > > [rant] > > I think it is lousy design for a framework like argparse to raise a > > custom ArgumentError in one part of the code, only to catch it elsewhere > > and call sys.exit.

Re: Why is the argparse module so inflexible?

2013-06-28 Thread Isaac To
On Sat, Jun 29, 2013 at 9:36 AM, Ethan Furman wrote: > On 06/27/2013 03:49 PM, Steven D'Aprano wrote: > >> >> Libraries should not call sys.exit, or raise SystemExit. Whether to quit >> or not is not the library's decision to make, that decision belongs to >> the application layer. Yes, the appli

Re: Why is the argparse module so inflexible?

2013-06-28 Thread Terry Reedy
On 6/29/2013 12:12 AM, rusi wrote: On Saturday, June 29, 2013 7:06:37 AM UTC+5:30, Ethan Furman wrote: On 06/27/2013 03:49 PM, Steven D'Aprano wrote: [rant] I think it is lousy design for a framework like argparse to raise a custom ArgumentError in one part of the code, only to catch it elsewhe

Re: Why is the argparse module so inflexible?

2013-06-28 Thread Steven D'Aprano
On Fri, 28 Jun 2013 18:36:37 -0700, Ethan Furman wrote: > On 06/27/2013 03:49 PM, Steven D'Aprano wrote: >> >> [rant] >> I think it is lousy design for a framework like argparse to raise a >> custom ArgumentError in one part of the code, only to catch it >> elsewhere and call sys.exit. At the very