Re: Compiling main script into .pyc

2014-01-17 Thread Steven D'Aprano
On Thu, 16 Jan 2014 23:43:02 -0500, Dave Angel wrote: MRAB pyt...@mrabarnett.plus.com Wrote in message: On 2014-01-17 02:56, bob gailer wrote: On 1/16/2014 8:01 PM, Sam wrote: One thing I observe about python byte-code compiling is that the main script does not gets compiled into .pyc. Only

Re: Converting folders of jpegs to single pdf per folder

2014-01-17 Thread Tim Golden
On 17/01/2014 05:42, vasishtha.sp...@gmail.com wrote: On Thursday, January 16, 2014 12:07:59 PM UTC-8, Tim Golden wrote: Here's a quick example. This should walk down the Python directory, creating a text file for each directory. The textfile will contain the names of all the files in the

Re: Process datafeed in one MySql table and output to another MySql table

2014-01-17 Thread Sam
On Friday, January 17, 2014 10:07:58 AM UTC+8, Denis McMahon wrote: On Thu, 16 Jan 2014 17:03:24 -0800, Sam wrote: I have a datafeed which is constantly sent to a MySql table ... Which are the python libraries which are suitable for this purpose? Are there any useful sample

Re: Converting folders of jpegs to single pdf per folder

2014-01-17 Thread Tim Golden
On 17/01/2014 05:42, vasishtha.sp...@gmail.com wrote: try: n = 0 for dirpath, dirnames, filenames in os.walk(root): PdfOutputFileName = os.path.basename(dirpath) + .pdf c = canvas.Canvas(PdfOutputFileName) if n 0 : for filename in

Re: Guessing the encoding from a BOM

2014-01-17 Thread Mark Lawrence
On 17/01/2014 01:40, Tim Chase wrote: On 2014-01-17 11:14, Chris Angelico wrote: UTF-8 specifies the byte order as part of the protocol, so you don't need to mark it. You don't need to mark it when writing, but some idiots use it anyway. If you're sniffing a file for purposes of reading, you

Re: interactive help on the base object

2014-01-17 Thread Mark Lawrence
On 17/01/2014 01:00, Terry Reedy wrote: On 12/6/2013 8:35 PM, Terry Reedy wrote: On 12/6/2013 12:03 PM, Mark Lawrence wrote: Is it just me, or is this basically useless? help(object) Help on class object in module builtins: class object | The most base type Given that this can be

Re: Process datafeed in one MySql table and output to another MySql table

2014-01-17 Thread Mark Lawrence
On 17/01/2014 08:53, Sam wrote: On Friday, January 17, 2014 10:07:58 AM UTC+8, Denis McMahon wrote: On Thu, 16 Jan 2014 17:03:24 -0800, Sam wrote: I have a datafeed which is constantly sent to a MySql table ... Which are the python libraries which are suitable for this purpose? Are

Re: extracting string.Template substitution placeholders

2014-01-17 Thread Mark Lawrence
On 17/01/2014 06:07, gmflanagan wrote: On Sunday, January 12, 2014 3:08:31 PM UTC, Eric S. Johansson wrote: As part of speech recognition accessibility tools that I'm building, I'm using string.Template. In order to construct on-the-fly grammar, I need to know all of the identifiers before

Re: Guessing the encoding from a BOM

2014-01-17 Thread Chris Angelico
On Fri, Jan 17, 2014 at 8:10 PM, Mark Lawrence breamore...@yahoo.co.uk wrote: Slight aside, any chance of changing the subject of this thread, or even ending the thread completely? Why? Every time I see it I picture Inspector Clouseau, A BOM!!! :) Special delivery, a berm! Were you expecting

Re: Guessing the encoding from a BOM

2014-01-17 Thread Mark Lawrence
On 17/01/2014 09:43, Chris Angelico wrote: On Fri, Jan 17, 2014 at 8:10 PM, Mark Lawrence breamore...@yahoo.co.uk wrote: Slight aside, any chance of changing the subject of this thread, or even ending the thread completely? Why? Every time I see it I picture Inspector Clouseau, A BOM!!! :)

Re: Guessing the encoding from a BOM

2014-01-17 Thread Chris Angelico
On Fri, Jan 17, 2014 at 8:47 PM, Mark Lawrence breamore...@yahoo.co.uk wrote: On 17/01/2014 09:43, Chris Angelico wrote: On Fri, Jan 17, 2014 at 8:10 PM, Mark Lawrence breamore...@yahoo.co.uk wrote: Slight aside, any chance of changing the subject of this thread, or even ending the thread

doctests compatibility for python 2 python 3

2014-01-17 Thread Robin Becker
I have some problems making some doctests for python2 code compatible with python3. The problem is that as part of our approach we are converting the code to use unicode internally. So we allow eihter byte strings or unicode in inputs, but we are trying to convert to unicode outputs. That

Re: doctests compatibility for python 2 python 3

2014-01-17 Thread Chris Angelico
On Fri, Jan 17, 2014 at 10:16 PM, Robin Becker ro...@reportlab.com wrote: Aside from changing the tests so they look like func(u'aaa')==u'aaa' True Do your test strings contain any non-ASCII characters? If not, you might be able to do this: def func(a):

Re: doctests compatibility for python 2 python 3

2014-01-17 Thread Chris Angelico
On Fri, Jan 17, 2014 at 10:24 PM, Chris Angelico ros...@gmail.com wrote: Do your test strings contain any non-ASCII characters? If not, you might be able to do this: def func(a): str(func(u'aaa')) 'aaa' return a Actually, probably better than that: def func(a):

Re: doctests compatibility for python 2 python 3

2014-01-17 Thread Steven D'Aprano
On Fri, 17 Jan 2014 11:16:17 +, Robin Becker wrote: I have some problems making some doctests for python2 code compatible with python3. The problem is that as part of our approach we are converting the code to use unicode internally. So we allow eihter byte strings or unicode in inputs,

Re: doctests compatibility for python 2 python 3

2014-01-17 Thread Robin Becker
On 17/01/2014 11:41, Steven D'Aprano wrote: def func(a): print(func(u'aaa')) aaa return a I think this approach seems to work if I turn the docstring into unicode def func(a): u print(func(u'aaa\u020b')) aaa\u020b return a

Re: doctests compatibility for python 2 python 3

2014-01-17 Thread Robin Becker
On 17/01/2014 11:30, Chris Angelico wrote: On Fri, Jan 17, 2014 at 10:24 PM, Chris Angelico ros...@gmail.com wrote: Do your test strings contain any non-ASCII characters? If not, you might be able to do this: def func(a): str(func(u'aaa')) 'aaa' return a Actually,

Re: interactive help on the base object

2014-01-17 Thread Jean-Michel Pichavant
- Original Message - On 17/01/2014 01:00, Terry Reedy wrote: On 12/6/2013 8:35 PM, Terry Reedy wrote: On 12/6/2013 12:03 PM, Mark Lawrence wrote: Is it just me, or is this basically useless? help(object) Help on class object in module builtins: class object | The

EuroPython has a new blog

2014-01-17 Thread M.-A. Lemburg
The EuroPython Society has setup a new blog for EuroPython in its efforts to provide more conference facilities for the EuroPython organization and to enhance the EuroPython attendee experience. http://blog.europython.eu/ There’s an RSS feed in case you want to subscribe to it:

EuroPython Society website now live

2014-01-17 Thread M.-A. Lemburg
The EuroPython Society has created a new website to collect information on EuroPython, the society and its workings: http://www.europython-society.org/ For those who don’t know: the society is a Swedish non-profit organization which was formed in 2004 by the EuroPython organizers to put on

Re: EuroPython has a new blog

2014-01-17 Thread Stéphane Wirtel
Hi Marc-André, Cool for EuroPython, Good idea, I think we will use tumblr for a small blog for Python-FOSDEM. Stef On 17 Jan 2014, at 13:37, M.-A. Lemburg wrote: The EuroPython Society has setup a new blog for EuroPython in its efforts to provide more conference facilities for the

[newbie] advice and comment wanted on first tkinter program

2014-01-17 Thread Jean Dupont
Dear all, I made a simple gui with tkinter. I can imagine there are things which I did which are not optimal. So what I ask is to comment on my code preferable with snippets of code which show how to do improve my code. #!/usr/bin/env python import Tkinter import time import RPi.GPIO as GPIO

python2.6 needed as an aptitude package as dependency

2014-01-17 Thread Jan Hapala
Hello, I need to install a program (MACS: http://liulab.dfci.harvard.edu/MACS/) for which I need to have Python2.6 installed. I do have two other Pythons installed but not this version. 1) So I tried apt-get install... python2.6 is not there as a package (I am running Linux Mint 15). 2)

Re: Python declarative

2014-01-17 Thread Francesco Bochicchio
Some time ago I played with Tkinter trying a more declarative way of coding the GUI building part and I come out with this: top = Tk( 'top' ).add ( Frame( 'frame' ).add ( Pack( side = 'top' ), Frame ( 'panel1' ).add ( Pack(

Re: python2.6 needed as an aptitude package as dependency

2014-01-17 Thread Chris Angelico
On Sat, Jan 18, 2014 at 1:24 AM, Jan Hapala j...@hapala.cz wrote: I need to install a program (MACS: http://liulab.dfci.harvard.edu/MACS/) for which I need to have Python2.6 installed. I do have two other Pythons installed but not this version. Is one of those Pythons a 2.7? If so, MACS will

Re: Python declarative

2014-01-17 Thread sertorbe
El miércoles, 15 de enero de 2014 18:02:08 UTC+1, Sergio Tortosa Benedito escribió: Hi I'm developing a sort of language extension for writing GUI programs called guilang, right now it's written in Lua but I'm considreing Python instead (because it's more tailored to alone applications).

Re: [newbie] advice and comment wanted on first tkinter program

2014-01-17 Thread Peter Otten
Jean Dupont wrote: Dear all, I made a simple gui with tkinter. I can imagine there are things which I did which are not optimal. So what I ask is to comment on my code preferable with snippets of code which show how to do improve my code. #!/usr/bin/env python import Tkinter import time

Re: doctests compatibility for python 2 python 3

2014-01-17 Thread Steven D'Aprano
On Fri, 17 Jan 2014 12:12:35 +, Robin Becker wrote: On 17/01/2014 11:41, Steven D'Aprano wrote: def func(a): print(func(u'aaa')) aaa return a I think this approach seems to work if I turn the docstring into unicode def func(a): u

Re: Python 3.x adoption

2014-01-17 Thread Grant Edwards
On 2014-01-14, Staszek nore...@eisenbits.com wrote: What's the problem with Python 3.x? The problem with Python 3.x is Python 2.7. ;) What's wrong?... Python 2.7 still does everything 99% of us need to do, and we're too lazy to switch. -- Grant Edwards grant.b.edwards

Re: Python 3.x adoption

2014-01-17 Thread Tim Chase
On 2014-01-17 15:27, Grant Edwards wrote: What's wrong?... Python 2.7 still does everything 99% of us need to do, and we're too lazy to switch. And in most distros, typing python invokes 2.x, and explicitly typing python3 is almost 17% longer. We're a lazy bunch! :-) -tkc --

Re: doctests compatibility for python 2 python 3

2014-01-17 Thread Robin Becker
On 17/01/2014 15:27, Steven D'Aprano wrote: .. # -*- coding: utf-8 -*- def func(a): print(func(u'aaa\u020b')) aaaȋ return a There seems to be some mojibake in your post, which confuses issues. You refer to \u020b, which is LATIN SMALL LETTER I WITH

Re: Python 3.x adoption

2014-01-17 Thread Mark Lawrence
On 17/01/2014 16:15, Tim Chase wrote: On 2014-01-17 15:27, Grant Edwards wrote: What's wrong?... Python 2.7 still does everything 99% of us need to do, and we're too lazy to switch. And in most distros, typing python invokes 2.x, and explicitly typing python3 is almost 17% longer. We're a

Re: Guessing the encoding from a BOM

2014-01-17 Thread Pete Forman
Rustom Mody rustompm...@gmail.com writes: On Friday, January 17, 2014 7:10:05 AM UTC+5:30, Tim Chase wrote: On 2014-01-17 11:14, Chris Angelico wrote: UTF-8 specifies the byte order as part of the protocol, so you don't need to mark it. You don't need to mark it when writing, but some

Re: Guessing the encoding from a BOM

2014-01-17 Thread Rustom Mody
On Friday, January 17, 2014 9:56:28 PM UTC+5:30, Pete Forman wrote: Rustom Mody writes: On Friday, January 17, 2014 7:10:05 AM UTC+5:30, Tim Chase wrote: On 2014-01-17 11:14, Chris Angelico wrote: UTF-8 specifies the byte order as part of the protocol, so you don't need to mark it.

Re: Guessing the encoding from a BOM

2014-01-17 Thread Chris Angelico
On Sat, Jan 18, 2014 at 3:26 AM, Pete Forman petef4+use...@gmail.com wrote: It would have been nice if there was an eighth encoding scheme defined there UTF-8NB which would be UTF-8 with BOM not allowed. Or call that one UTF-8, and the one with the marker can be UTF-8-MS-NOTEPAD. ChrisA --

Re: Python glob and raw string

2014-01-17 Thread Xaxa Urtiz
Le jeudi 16 janvier 2014 19:14:30 UTC+1, Neil Cerutti a écrit : On 2014-01-16, Xaxa Urtiz wrote: Hello everybody, i've got a little problem, i've made a script which look after some files in some directory, typically my folder are organized like this : [share] folder1

Re: Guessing the encoding from a BOM

2014-01-17 Thread Pete Forman
Chris Angelico ros...@gmail.com writes: On Fri, Jan 17, 2014 at 8:10 PM, Mark Lawrence breamore...@yahoo.co.uk wrote: Slight aside, any chance of changing the subject of this thread, or even ending the thread completely? Why? Every time I see it I picture Inspector Clouseau, A BOM!!! :)

Re: Guessing the encoding from a BOM

2014-01-17 Thread Chris Angelico
On Sat, Jan 18, 2014 at 3:30 AM, Rustom Mody rustompm...@gmail.com wrote: If you or I break a standard then, well, we broke a standard. If Microsoft breaks a standard the standard is obliged to change. Or as the saying goes, everyone is equal though some are more equal.

Re: Compiling main script into .pyc

2014-01-17 Thread Alister
On Thu, 16 Jan 2014 17:01:51 -0800, Sam wrote: One thing I observe about python byte-code compiling is that the main script does not gets compiled into .pyc. Only imported modules are compiled into .pyc. May I know how can I compile the main script into .pyc? It is to inconvenience

Graph or Chart Software for Django

2014-01-17 Thread San D
What is the best Graph or Chart software used with Django (libraries products), preferably open source? Need something stable and robust, and used by many developers, so active on community channels. Thanks. -- https://mail.python.org/mailman/listinfo/python-list

Templating engines that work very well with Python/Django

2014-01-17 Thread San D
Can someone suggest a few templating engines that work really well with Django and help in coding efficiency? Where can I fin comparison of tempating engines I can find to know their pros and cons? Thanks. -- https://mail.python.org/mailman/listinfo/python-list

Re: Graph or Chart Software for Django

2014-01-17 Thread Marc Aymerich
On Fri, Jan 17, 2014 at 6:18 PM, San D sda...@gmail.com wrote: What is the best Graph or Chart software used with Django (libraries products), preferably open source? Need something stable and robust, and used by many developers, so active on community channels. what I use is a JS library

Re: Templating engines that work very well with Python/Django

2014-01-17 Thread Marc Aymerich
On Fri, Jan 17, 2014 at 6:22 PM, San D sda...@gmail.com wrote: Can someone suggest a few templating engines that work really well with Django and help in coding efficiency? Where can I fin comparison of tempating engines I can find to know their pros and cons? I believe the most widely

Re: Python glob and raw string

2014-01-17 Thread Mark Lawrence
On 17/01/2014 16:45, Xaxa Urtiz wrote: [masses of double spaced lines snipped] Would you please read and action this https://wiki.python.org/moin/GoogleGroupsPython to prevent us seeing the double line spacing in your posts, thanks. -- My fellow Pythonistas, ask not what our language can do

Re: Guessing the encoding from a BOM

2014-01-17 Thread Ethan Furman
On 01/17/2014 08:46 AM, Pete Forman wrote: Chris Angelico ros...@gmail.com writes: On Fri, Jan 17, 2014 at 8:10 PM, Mark Lawrence breamore...@yahoo.co.uk wrote: Slight aside, any chance of changing the subject of this thread, or even ending the thread completely? Why? Every time I see it I

Re: python2.6 needed as an aptitude package as dependency

2014-01-17 Thread Asaf Las
On Friday, January 17, 2014 4:24:16 PM UTC+2, Jan Hapala wrote: Hello, I need to install a program (MACS: http://liulab.dfci.harvard.edu/MACS/) for which I need to have Python2.6 installed. I do have two other Pythons installed but not this version. I will be grateful for your suggestions,

Re: Guessing the encoding from a BOM

2014-01-17 Thread Tim Chase
On 2014-01-17 09:10, Mark Lawrence wrote: Slight aside, any chance of changing the subject of this thread, or even ending the thread completely? Why? Every time I see it I picture Inspector Clouseau, A BOM!!! :) In discussions regarding BOMs, I regularly get the All your base meme from a

Re: Python 3.x adoption

2014-01-17 Thread Grant Edwards
On 2014-01-17, Tim Chase python.l...@tim.thechases.com wrote: On 2014-01-17 15:27, Grant Edwards wrote: What's wrong?... Python 2.7 still does everything 99% of us need to do, and we're too lazy to switch. And in most distros, typing python invokes 2.x, and explicitly typing python3 is

Re: Compiling main script into .pyc

2014-01-17 Thread Grant Edwards
On 2014-01-17, Steven D'Aprano steve+comp.lang.pyt...@pearwood.info wrote: On Thu, 16 Jan 2014 23:43:02 -0500, Dave Angel wrote: [steve@ando ~]$ cat sample.py print(Hello!) [steve@ando ~]$ ls sample.pyc ls: sample.pyc: No such file or directory [steve@ando ~]$ python -m compileall

Re: Guessing the encoding from a BOM

2014-01-17 Thread Rotwang
On 17/01/2014 18:43, Tim Chase wrote: On 2014-01-17 09:10, Mark Lawrence wrote: Slight aside, any chance of changing the subject of this thread, or even ending the thread completely? Why? Every time I see it I picture Inspector Clouseau, A BOM!!! :) In discussions regarding BOMs, I

Re: Building and accessing an array of dictionaries

2014-01-17 Thread Grant Edwards
On 2014-01-16, Mark Lawrence breamore...@yahoo.co.uk wrote: On 16/01/2014 09:48, Chris Angelico wrote: On Thu, Jan 16, 2014 at 8:41 PM, Sam lightai...@gmail.com wrote: I would like to build an array of dictionaries. Most of the dictionary example on the net are for single dictionary. dict =

Re: doctests compatibility for python 2 python 3

2014-01-17 Thread Terry Reedy
On 1/17/2014 7:14 AM, Robin Becker wrote: I tried this approach with a few more complicated outcomes and they fail in python2 or 3 depending on how I try to render the result in the doctest. I never got how you are using doctests. There were certainly not meant for heavy-duty unit testing,

Re: interactive help on the base object

2014-01-17 Thread Terry Reedy
On 1/17/2014 7:25 AM, Jean-Michel Pichavant wrote: '''The default top superclass for all Python classes. http://bugs.python.org/issue20285 The issue is tagged 2.7. Is object the superclass of all classes in 2.7 ? 2.7 should say 'all new-style classes'. Thanks for noticing and reporting.

Re: Is it possible to protect python source code by compiling it to .pyc or .pyo?

2014-01-17 Thread Joshua Landau
On 17 January 2014 00:58, Sam lightai...@gmail.com wrote: I would like to protect my python source code. It need not be foolproof as long as it adds inconvenience to pirates. Is it possible to protect python source code by compiling it to .pyc or .pyo? Does .pyo offer better protection? If

Re: [newbie] advice and comment wanted on first tkinter program

2014-01-17 Thread Terry Reedy
On 1/17/2014 8:20 AM, Jean Dupont wrote: Dear all, I made a simple gui with tkinter. I can imagine there are things which I did which are not optimal. So what I ask is to comment on my code preferable with snippets of code which show how to do improve my code. #!/usr/bin/env python import

Re: Is it possible to protect python source code by compiling it to .pyc or .pyo?

2014-01-17 Thread Tim Delaney
On 18 January 2014 08:31, Joshua Landau jos...@landau.ws wrote: On 17 January 2014 00:58, Sam lightai...@gmail.com wrote: I would like to protect my python source code. It need not be foolproof as long as it adds inconvenience to pirates. Is it possible to protect python source code by

Re: Python 3.x adoption

2014-01-17 Thread Terry Reedy
On 1/17/2014 10:27 AM, Grant Edwards wrote: On 2014-01-14, Staszek nore...@eisenbits.com wrote: What's the problem with Python 3.x? The problem with Python 3.x is Python 2.7. ;) Cute. What's wrong?... Python 2.7 still does everything 99% of us need to do, and we're too lazy to switch.

Re: Python 3.x adoption

2014-01-17 Thread beliavsky
On Tuesday, January 14, 2014 2:38:29 PM UTC-5, Skip Montanaro wrote: What's the problem with Python 3.x? It was first released in 2008, but web hosting companies still seem to offer Python 2.x rather. For example, Google App Engine only offers Python 2.7. What's wrong?...

Re: Python 3.x adoption

2014-01-17 Thread Mark Lawrence
On 17/01/2014 22:16, beliav...@aol.com wrote: On Tuesday, January 14, 2014 2:38:29 PM UTC-5, Skip Montanaro wrote: What's the problem with Python 3.x? It was first released in 2008, but web hosting companies still seem to offer Python 2.x rather. For example, Google App Engine only

Re: Python 3.x adoption

2014-01-17 Thread Terry Reedy
On 1/17/2014 5:16 PM, beliav...@aol.com wrote: I don't think the Fortran analogy is valid. The appropriate analogy for the changes between Python 2.x and 3.x, which started about 1 and 2 decades after the original Python, are the changes between Fortran IV/66 and Fortran 77, also about 1

Re: Python 3.x adoption

2014-01-17 Thread MRAB
On 2014-01-17 23:03, Terry Reedy wrote: [snip] Since 3.0, we have added new syntax ('yield from', u'' for instance) but I do not believe we have deleted or changed any syntax (I might have forgotten something minor) and I do not know of any proposal to do so (except to re-delete u'', which

Re: Python 3.x adoption

2014-01-17 Thread Chris Angelico
On Sat, Jan 18, 2014 at 10:12 AM, MRAB pyt...@mrabarnett.plus.com wrote: On 2014-01-17 23:03, Terry Reedy wrote: [snip] Since 3.0, we have added new syntax ('yield from', u'' for instance) but I do not believe we have deleted or changed any syntax (I might have forgotten something minor) and

How to write this as a list comprehension?

2014-01-17 Thread Piet van Oostrum
Hi, I am looking for an elegant way to write the following code as a list comprehension: labels = [] for then, name in mylist: _, mn, dy, _, _, _, wd, _, _ = localtime(then) labels.append(somefunc(mn, day, wd, name)) So mylist is a list of tuples, the first member of the tuple is a time

Re: How to write this as a list comprehension?

2014-01-17 Thread Dan Stromberg
On Fri, Jan 17, 2014 at 3:19 PM, Piet van Oostrum p...@vanoostrum.org wrote: Hi, I am looking for an elegant way to write the following code as a list comprehension: labels = [] for then, name in mylist: _, mn, dy, _, _, _, wd, _, _ = localtime(then) labels.append(somefunc(mn,

Re: setup.py issue - some files are included as intended, but one is not

2014-01-17 Thread Dan Stromberg
On Wed, Jan 15, 2014 at 7:18 AM, Piet van Oostrum p...@vanoostrum.org wrote: Dan Stromberg drsali...@gmail.com writes: On Sat, Jan 11, 2014 at 2:04 PM, Dan Stromberg drsali...@gmail.com wrote: Hi folks. I have a setup.py problem that's driving me nuts. Anyone? I've received 0 responses.

Re: Python 3.x adoption

2014-01-17 Thread Ben Finney
Terry Reedy tjre...@udel.edu writes: Since 3.0, we have added new syntax ('yield from', u'' for instance) but I do not believe we have deleted or changed any syntax (I might have forgotten something minor) I'm aware of the removal of ‘`foo`’ (use ‘repr(foo)’ instead), and removal of ‘except

Re: Python 3.x adoption

2014-01-17 Thread Ben Finney
Ben Finney ben+pyt...@benfinney.id.au writes: Terry Reedy tjre...@udel.edu writes: Since 3.0, we have added new syntax ('yield from', u'' for instance) but I do not believe we have deleted or changed any syntax (I might have forgotten something minor) I'm aware of the removal of ‘`foo`’

numpy.where() and multiple comparisons

2014-01-17 Thread John Ladasky
Hi folks, I am awaiting my approval to join the numpy-discussion mailing list, at scipy.org. I realize that would be the best place to ask my question. However, numpy is so widely used, I figure that someone here would be able to help. I like to use numpy.where() to select parts of arrays.

Re: numpy.where() and multiple comparisons

2014-01-17 Thread duncan smith
On 18/01/14 01:51, John Ladasky wrote: Hi folks, I am awaiting my approval to join the numpy-discussion mailing list, at scipy.org. I realize that would be the best place to ask my question. However, numpy is so widely used, I figure that someone here would be able to help. I like to use

Re: Python 3.x adoption

2014-01-17 Thread Roy Smith
In article lbc296$itl$1...@reader1.panix.com, Grant Edwards invalid@invalid.invalid wrote: On 2014-01-17, Tim Chase python.l...@tim.thechases.com wrote: On 2014-01-17 15:27, Grant Edwards wrote: What's wrong?... Python 2.7 still does everything 99% of us need to do, and we're too

Re: How to write this as a list comprehension?

2014-01-17 Thread Rustom Mody
On Saturday, January 18, 2014 4:49:55 AM UTC+5:30, Piet van Oostrum wrote: Hi, I am looking for an elegant way to write the following code as a list comprehension: labels = [] for then, name in mylist: _, mn, dy, _, _, _, wd, _, _ = localtime(then) labels.append(somefunc(mn, day,

Re: numpy.where() and multiple comparisons

2014-01-17 Thread John Ladasky
On Friday, January 17, 2014 6:16:28 PM UTC-8, duncan smith wrote: a = np.arange(10) c = np.where((2 a) (a 7)) c (array([3, 4, 5, 6]),) Nice! Thanks! Now, why does the multiple comparison fail, if you happen to know? -- https://mail.python.org/mailman/listinfo/python-list

Re: Python Scalability TCP Server + Background Game

2014-01-17 Thread phiwer
Quick smoke test. How big are your requests/responses? You mention REST, which implies they're going to be based on HTTP. I would expect you would have some idea of the rough size. Multiply that by 50,000, and see whether your connection can handle it. For instance, if you have a

[issue20162] Test test_hash_distribution fails on RHEL 6.5 / ppc64

2014-01-17 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Well, then it LGTM. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue20162 ___ ___ Python-bugs-list mailing

[issue20086] test_locale fails with Turkish locale

2014-01-17 Thread Serhiy Storchaka
Changes by Serhiy Storchaka storch...@gmail.com: -- resolution: - fixed stage: patch review - committed/rejected status: open - closed ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue20086

[issue16572] Bad multi-inheritance support in some libs like threading or multiprocessing

2014-01-17 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Raymond, what do you think? -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue16572 ___ ___ Python-bugs-list

[issue20284] proof for concept patch for bytes formatting methods

2014-01-17 Thread Neil Schemenauer
Neil Schemenauer added the comment: I'm attaching v2 of my proposed patch. This one is quite a bit better, IMHO. - Introduce __ascii__ as a special method, like __str__ but required to exist only if an ASCII-only format exists. - Extract PyString_Format from Python 2.7 and update it for

[issue20284] proof for concept patch for bytes formatting methods

2014-01-17 Thread STINNER Victor
Changes by STINNER Victor victor.stin...@gmail.com: -- nosy: +haypo ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue20284 ___ ___ Python-bugs-list

[issue20284] proof for concept patch for bytes formatting methods

2014-01-17 Thread STINNER Victor
STINNER Victor added the comment: I reviewed your second patch on Rietveld. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue20284 ___ ___

[issue20162] Test test_hash_distribution fails on RHEL 6.5 / ppc64

2014-01-17 Thread STINNER Victor
STINNER Victor added the comment: @Christian: Are you ok with siphash_ppc64.patch? I'm going to push the fix. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue20162 ___

[issue20284] proof for concept patch for bytes formatting methods

2014-01-17 Thread Neil Schemenauer
Neil Schemenauer added the comment: Uploading new patch with the following changes: - Allow length 1 bytes object as argument to %c. - Make %r an alias for %a. I will upload a draft PEP (proposed as a replacement for 461). Victor, thanks for the review. My reply is: - regarding duplicated

[issue20284] proof for concept patch for bytes formatting methods

2014-01-17 Thread Neil Schemenauer
Changes by Neil Schemenauer nas-pyt...@arctrix.com: Added file: http://bugs.python.org/file33507/pep-draft.txt ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue20284 ___

[issue20283] Wrong keyword parameter name in regex pattern methods

2014-01-17 Thread Serhiy Storchaka
Changes by Serhiy Storchaka storch...@gmail.com: -- keywords: +patch Added file: http://bugs.python.org/file33508/sre_pattern_string_keyword.patch ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue20283

[issue20283] Wrong keyword parameter name in regex pattern methods

2014-01-17 Thread Serhiy Storchaka
Changes by Serhiy Storchaka storch...@gmail.com: Removed file: http://bugs.python.org/file33508/sre_pattern_string_keyword.patch ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue20283 ___

[issue20283] Wrong keyword parameter name in regex pattern methods

2014-01-17 Thread Serhiy Storchaka
Changes by Serhiy Storchaka storch...@gmail.com: Added file: http://bugs.python.org/file33509/sre_pattern_string_keyword.patch ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue20283 ___

[issue19936] Executable permissions of Python source files

2014-01-17 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Left files with mismatched executable bits and shebangs: Python 3.4: - ./Doc/includes/email-unpack.py - ./Doc/includes/email-alternative.py - ./Doc/includes/email-dir.py x ./Tools/scripts/pydocgui.pyw x ./Lib/idlelib/idle.bat -

[issue17849] Missing size argument in readline() method for httplib's class LineAndFileWrapper

2014-01-17 Thread Steve
Steve added the comment: I just noticed that this is reporducible consistently with the python requests[1] module, if you route your request through a proxy. I was wondering whether I should report this as a 'requests' bug or would this be the right place to add a 'me too' ? Here's the

[issue20287] Argument Clinic: support diverting output to buffer, external file, etc

2014-01-17 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Can Argument Clinic be simplified when drop support for all alternative outputs besides a side file? * args and kwargs variables in C renamed to _args and _kwargs Why this is needed? If buildin function has args or kwargs keyword arguments, C variables

[issue19936] Executable permissions of Python source files

2014-01-17 Thread Stefan Krah
Stefan Krah added the comment: IMO the .bat files should have the executable bit as a reminder that they're executable on Windows. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue19936 ___

[issue20288] HTMLParse handing of non-numeric charrefs broken

2014-01-17 Thread Anders Hammarquist
New submission from Anders Hammarquist: Python 2.7 HTMLParse.py lines 185-199 (similar lines still exist in Python 3.4) match = charref.match(rawdata, i) if match: ... else: if ; in rawdata[i:]: #bail by

[issue20288] HTMLParse handing of non-numeric charrefs broken

2014-01-17 Thread Ezio Melotti
Changes by Ezio Melotti ezio.melo...@gmail.com: -- assignee: - ezio.melotti nosy: +ezio.melotti ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue20288 ___

[issue20135] FAQ need list mutation answers

2014-01-17 Thread Ezio Melotti
Ezio Melotti added the comment: http://docs.python.org/3/faq/design.html#why-are-default-values-shared-between-objects -- nosy: +ezio.melotti ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue20135

[issue20289] Make cgi.FieldStorage a context manager

2014-01-17 Thread Brett Cannon
New submission from Brett Cannon: It has a file attribute which contains a file, so making it so it can be closed faster than cgi.FieldStorage.__del__ would be good. -- components: Library (Lib) messages: 208338 nosy: brett.cannon priority: normal severity: normal stage: test needed

[issue18394] cgi.FieldStorage triggers ResourceWarning sometimes

2014-01-17 Thread Brett Cannon
Brett Cannon added the comment: While you're right, Marcel, that code which pulls out the file object form FieldStorage would probably have the file closed from underneath it, I don't know if I agree that it's a bad thing. The FieldStorage object created that file, implicitly putting it in

[issue20266] Bring Doc/faq/windows up to date

2014-01-17 Thread Roundup Robot
Roundup Robot added the comment: New changeset c9706c13a005 by Zachary Ware in branch '3.3': Issue #20266: Update parts of the Windows FAQ http://hg.python.org/cpython/rev/c9706c13a005 New changeset 3cb048463ea7 by Zachary Ware in branch 'default': Issue #20266: Merge with 3.3

[issue17849] Missing size argument in readline() method for httplib's class LineAndFileWrapper

2014-01-17 Thread R. David Murray
R. David Murray added the comment: Requests may well want to put a workaround in place. To fix it in 2.7, we need a patch that actually respects the size argument, and a unit test. -- ___ Python tracker rep...@bugs.python.org

[issue20135] FAQ need list mutation answers

2014-01-17 Thread R. David Murray
R. David Murray added the comment: I *thought* there was a FAQ entry for that. Didn't think to look for it in the design section though :(. Nor is the title likely to catch the eye of someone wondering why their default argument modifications are being unexpectedly persistent. Also, the

[issue18394] cgi.FieldStorage triggers ResourceWarning sometimes

2014-01-17 Thread Brett Cannon
Changes by Brett Cannon br...@python.org: -- status: open - closed ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue18394 ___ ___ Python-bugs-list

[issue18394] cgi.FieldStorage triggers ResourceWarning sometimes

2014-01-17 Thread Roundup Robot
Roundup Robot added the comment: New changeset 13d04a8713ad by Brett Cannon in branch 'default': Issue #18394: Document that cgi.FieldStorage now cleans up after its http://hg.python.org/cpython/rev/13d04a8713ad -- ___ Python tracker

[issue20208] Clarify some things in porting HOWTO

2014-01-17 Thread Roundup Robot
Roundup Robot added the comment: New changeset 863b8e71cfee by Brett Cannon in branch 'default': Issue #20208: Clarify some things in the Python porting HOWTO. http://hg.python.org/cpython/rev/863b8e71cfee -- nosy: +python-dev ___ Python tracker

  1   2   >