[ANN] PyInstaller 2.0

2012-08-09 Thread Hartmut Goebel
Hello, on behalf of the PyInstaller development team I'm happy to announce PyInstaller 2.0. http://www.pyinstaller.org Special thanks to Martin Zibricky who did most of the development work for this release. === What it is === PyInstaller is a program that converts (packages) Python

Re: Beautiful Soup Table Parsing

2012-08-09 Thread Andreas Perstinger
On 09.08.2012 01:58, Tom Russell wrote: For instance this code below: soup = BeautifulSoup(urlopen('http://online.wsj.com/mdc/public/page/2_3021-tradingdiary2.html?mod=mdc_pastcalendar')) table = soup.find(table,{class: mdcTable}) for row in table.findAll(tr): for cell in

Re: Looking for a good introduction to object oriented programming with Python

2012-08-09 Thread lipska the kat
On 09/08/12 03:59, Dennis Lee Bieber wrote: On Wed, 08 Aug 2012 20:31:57 +0100, lipska the kat lipskathe...@yahoo.co.uk declaimed the following in gmane.comp.python.general: [snip] If a node is a father or mother, and it takes one of each to produce a leaf, your tree has just

Re: Is there a clever way to pass arguments

2012-08-09 Thread Jean-Michel Pichavant
bruceg113...@gmail.com wrote: Is there a way in Python to pass arguments without listing each argument? For example, my program does the following: testData (z[0], z[1], z[2], z[3], z[4], z[5], z[6], z[7]) Is there a clever way to pass arguments in a single statement knowing that each

Re: Is there a clever way to pass arguments

2012-08-09 Thread Chris Angelico
On Thu, Aug 9, 2012 at 7:05 PM, Jean-Michel Pichavant jeanmic...@sequans.com wrote: bruceg113...@gmail.com wrote: I cannot change the function definition. or better (imo) testData(z) and make testData handle a list (8 parameters, that's a lot of parameters). He can't change the function

Re: Is there a clever way to pass arguments

2012-08-09 Thread Jean-Michel Pichavant
Chris Angelico wrote: On Thu, Aug 9, 2012 at 7:05 PM, Jean-Michel Pichavant jeanmic...@sequans.com wrote: bruceg113...@gmail.com wrote: I cannot change the function definition. or better (imo) testData(z) and make testData handle a list (8 parameters, that's a lot of

pycups

2012-08-09 Thread loial
I am looking to monitor print jobs on linux via python. pycups looks a possibility, but I cannot find any useful tutorial, examples of how to use it. Can anyone help? -- http://mail.python.org/mailman/listinfo/python-list

Re: Getting started with IDLE and Python - no highlighting and no execution

2012-08-09 Thread soloflyr
On Sunday, August 5, 2012 7:46:54 PM UTC-4, PeterSo wrote: I am just starting to learn Python, and I like to use the editor instead of the interactive shell. So I wrote the following little program in IDLE # calculating the mean data1=[49, 66, 24, 98, 37, 64, 98, 27, 56, 93,

[ANN] PyInstaller 2.0

2012-08-09 Thread Hartmut Goebel
Hello, on behalf of the PyInstaller development team I'm happy to announce PyInstaller 2.0. http://www.pyinstaller.org Special thanks to Martin Zibricky who did most of the development work for this release. === What it is === PyInstaller is a program that converts (packages) Python

Python and OSX 10.8

2012-08-09 Thread David Thomas
Im looking to upgrade my Mac to 10.8 and I'm worried if Python and IDLE may not run on it. When I try to run this command in Terminal: python -m idlelib.idle I can not launch IDLE which comes bundled on Mac. On Lion it's been fine but I've tried it on my friend's copy of Mountain Lion and it

socketserver.BaseRequestHandler and socketserver.StreamRequestServer docs

2012-08-09 Thread lipska the kat
First of all sincere apologies if this is blindingly obvious and I just missed it In the documentation at http://docs.python.org/py3k/library/socketserver.html mention is made more than once of a class socketserver.StreamRequestHandler in the examples in this chapter we see usage examples

Re: Python and OSX 10.8

2012-08-09 Thread William R. Wing (Bill Wing)
On Aug 9, 2012, at 10:38 AM, David Thomas dthoma...@me.com wrote: Im looking to upgrade my Mac to 10.8 and I'm worried if Python and IDLE may not run on it. When I try to run this command in Terminal: python -m idlelib.idle I can not launch IDLE which comes bundled on Mac. On Lion it's been

Re: Is there a clever way to pass arguments

2012-08-09 Thread Alister
On Thu, 09 Aug 2012 19:13:31 +1000, Chris Angelico wrote: On Thu, Aug 9, 2012 at 7:05 PM, Jean-Michel Pichavant jeanmic...@sequans.com wrote: bruceg113...@gmail.com wrote: I cannot change the function definition. or better (imo) testData(z) and make testData handle a list (8 parameters,

Re: socketserver.BaseRequestHandler and socketserver.StreamRequestServer docs

2012-08-09 Thread lipska the kat
On 09/08/12 18:39, Dennis Lee Bieber wrote: On Thu, 09 Aug 2012 16:15:33 +0100, lipska the kat lipskathe...@yahoo.co.uk declaimed the following in gmane.comp.python.general: in the examples in this chapter we see usage examples for socketserver.BaseRequestHandler So far as I can

Re: socketserver.BaseRequestHandler and socketserver.StreamRequestServer docs

2012-08-09 Thread lipska the kat
On 09/08/12 18:39, Dennis Lee Bieber wrote: On Thu, 09 Aug 2012 16:15:33 +0100, lipska the kat lipskathe...@yahoo.co.uk declaimed the following in gmane.comp.python.general: in the examples in this chapter we see usage examples for socketserver.BaseRequestHandler So far as I can

Re: socketserver.BaseRequestHandler and socketserver.StreamRequestServer docs

2012-08-09 Thread Mark Lawrence
On 09/08/2012 19:37, lipska the kat wrote: On 09/08/12 18:39, Dennis Lee Bieber wrote: On Thu, 09 Aug 2012 16:15:33 +0100, lipska the kat lipskathe...@yahoo.co.uk declaimed the following in gmane.comp.python.general: in the examples in this chapter we see usage examples for

Re: socketserver.BaseRequestHandler and socketserver.StreamRequestServer docs

2012-08-09 Thread Peter Otten
lipska the kat wrote: If there isn't how does one go about contributing to the documentation. http://docs.python.org/dev/py3k/bugs.html A similar link should be right there in the footer of the socketserver documentation. -- http://mail.python.org/mailman/listinfo/python-list

Re: looking for a neat solution to a nested loop problem

2012-08-09 Thread 88888 Dihedral
Nobody於 2012年8月7日星期二UTC+8下午11時32分55秒寫道: On Mon, 06 Aug 2012 21:02:33 -0700, Larry Hudson wrote: for i in range(N,N+100): for j in range(M,M+100): do_something(i % 100 ,j % 100) Emile How about... for i in range(100):

Re: looking for a neat solution to a nested loop problem

2012-08-09 Thread 88888 Dihedral
Nobody於 2012年8月7日星期二UTC+8下午11時32分55秒寫道: On Mon, 06 Aug 2012 21:02:33 -0700, Larry Hudson wrote: for i in range(N,N+100): for j in range(M,M+100): do_something(i % 100 ,j % 100) Emile How about... for i in range(100):

Re: socketserver.BaseRequestHandler and socketserver.StreamRequestServer docs

2012-08-09 Thread lipska the kat
On 09/08/12 19:55, Mark Lawrence wrote: On 09/08/2012 19:37, lipska the kat wrote: On 09/08/12 18:39, Dennis Lee Bieber wrote: On Thu, 09 Aug 2012 16:15:33 +0100, lipska the kat lipskathe...@yahoo.co.uk declaimed the following in gmane.comp.python.general: in the examples in this chapter we

Re: socketserver.BaseRequestHandler and socketserver.StreamRequestServer docs

2012-08-09 Thread lipska the kat
On 09/08/12 20:07, Peter Otten wrote: lipska the kat wrote: If there isn't how does one go about contributing to the documentation. http://docs.python.org/dev/py3k/bugs.html A similar link should be right there in the footer of the socketserver documentation. It is indeed, thank you.

Re: socketserver.BaseRequestHandler and socketserver.StreamRequestServer docs

2012-08-09 Thread Dave Angel
On 08/09/2012 02:37 PM, lipska the kat wrote: On 09/08/12 18:39, Dennis Lee Bieber wrote: On Thu, 09 Aug 2012 16:15:33 +0100, lipska the kat lipskathe...@yahoo.co.uk declaimed the following in gmane.comp.python.general: in the examples in this chapter we see usage examples for

Re: socketserver.BaseRequestHandler and socketserver.StreamRequestServer docs

2012-08-09 Thread Terry Reedy
On 8/9/2012 1:39 PM, Dennis Lee Bieber wrote: On Thu, 09 Aug 2012 16:15:33 +0100, lipska the kat lipskathe...@yahoo.co.uk declaimed the following in gmane.comp.python.general: in the examples in this chapter we see usage examples for socketserver.BaseRequestHandler So far as I can

Re: Is there a clever way to pass arguments

2012-08-09 Thread GangGreene
Alister wrote: [putolin] some people read these threads to learn general concepts not to find answers to a single explicit case. Some people (me) don't know the first thing about python and are in the learning/exploratory phase. -- http://mail.python.org/mailman/listinfo/python-list

Re: Is there a clever way to pass arguments

2012-08-09 Thread Terry Reedy
On 8/9/2012 5:50 AM, Jean-Michel Pichavant wrote: Chris Angelico wrote: On Thu, Aug 9, 2012 at 7:05 PM, Jean-Michel Pichavant jeanmic...@sequans.com wrote: bruceg113...@gmail.com wrote: I cannot change the function definition. or better (imo) testData(z) and make testData handle a list (8

Re: no data exclution and unique combination.

2012-08-09 Thread giuseppe . amatulli
Terry and MRAB, thanks for yours suggestions, in the end i found this solution mask=( a != 0 ) ( b != 0 ) a_mask=a[mask] b_mask=b[mask] array2D = np.array(zip(a_mask,b_mask)) unique=dict() for row in array2D : row = tuple(row) if row in unique: unique[row] += 1 else:

save dictionary to a file without brackets.

2012-08-09 Thread giuseppe . amatulli
Hi, I have a dict() unique like this {(4, 5): 1, (5, 4): 1, (4, 4): 2, (2, 3): 1, (4, 3): 2} and i want to print to a file without the brackets comas and semicolon in order to obtain something like this? 4 5 1 5 4 1 4 4 2 2 3 1 4 3 2 Any ideas? Thanks in advance Giuseppe --

Re: save dictionary to a file without brackets.

2012-08-09 Thread Roman Vashkevich
for key in dict: print key[0], key[1], dict[key] 10.08.2012, в 0:11, giuseppe.amatu...@gmail.com написал(а): Hi, I have a dict() unique like this {(4, 5): 1, (5, 4): 1, (4, 4): 2, (2, 3): 1, (4, 3): 2} and i want to print to a file without the brackets comas and semicolon in order to

Re: save dictionary to a file without brackets.

2012-08-09 Thread Oscar Benjamin
On Aug 9, 2012 9:17 PM, giuseppe.amatu...@gmail.com wrote: Hi, I have a dict() unique like this {(4, 5): 1, (5, 4): 1, (4, 4): 2, (2, 3): 1, (4, 3): 2} and i want to print to a file without the brackets comas and semicolon in order to obtain something like this? 4 5 1 5 4 1 4 4 2 2 3 1

Re: save dictionary to a file without brackets.

2012-08-09 Thread Tim Chase
On 08/09/12 15:22, Roman Vashkevich wrote: {(4, 5): 1, (5, 4): 1, (4, 4): 2, (2, 3): 1, (4, 3): 2} and i want to print to a file without the brackets comas and semicolon in order to obtain something like this? 4 5 1 5 4 1 4 4 2 2 3 1 4 3 2 for key in dict: print key[0], key[1],

Re: save dictionary to a file without brackets.

2012-08-09 Thread Giuseppe Amatulli
thanks for the fast replies my testing were very closed to yours but i did not know how On 9 August 2012 15:25, Oscar Benjamin oscar.j.benja...@gmail.com wrote: On Aug 9, 2012 9:17 PM, giuseppe.amatu...@gmail.com wrote: Hi, I have a dict() unique like this {(4, 5): 1, (5, 4): 1, (4, 4): 2,

Re: save dictionary to a file without brackets.

2012-08-09 Thread Giuseppe Amatulli
thanks for the fast replies my testing were very closed to yours but i did not know how to print the the number after the semicolon! thanks! On 9 August 2012 15:25, Oscar Benjamin oscar.j.benja...@gmail.com wrote: On Aug 9, 2012 9:17 PM, giuseppe.amatu...@gmail.com wrote: Hi, I have a

Re: save dictionary to a file without brackets.

2012-08-09 Thread Gelonida N
On 08/09/2012 10:11 PM, giuseppe.amatu...@gmail.com wrote: Hi, I have a dict() unique like this {(4, 5): 1, (5, 4): 1, (4, 4): 2, (2, 3): 1, (4, 3): 2} and i want to print to a file without the brackets comas and semicolon in order to obtain something like this? 4 5 1 5 4 1 4 4 2 2 3 1 4 3 2

Re: save dictionary to a file without brackets.

2012-08-09 Thread Roman Vashkevich
dict.items() is a list - linear access time whereas with 'for key in dict:' access time is constant: http://python.net/~goodger/projects/pycon/2007/idiomatic/handout.html#use-in-where-possible-1 10.08.2012, в 0:35, Tim Chase написал(а): On 08/09/12 15:22, Roman Vashkevich wrote: {(4, 5): 1,

Re: save dictionary to a file without brackets.

2012-08-09 Thread Mark Lawrence
On 09/08/2012 21:41, Roman Vashkevich wrote: dict.items() is a list - linear access time whereas with 'for key in dict:' access time is constant: http://python.net/~goodger/projects/pycon/2007/idiomatic/handout.html#use-in-where-possible-1 10.08.2012, в 0:35, Tim Chase написал(а): On

Re: save dictionary to a file without brackets.

2012-08-09 Thread Tim Chase
On 08/09/12 15:41, Roman Vashkevich wrote: 10.08.2012, в 0:35, Tim Chase написал(а): On 08/09/12 15:22, Roman Vashkevich wrote: {(4, 5): 1, (5, 4): 1, (4, 4): 2, (2, 3): 1, (4, 3): 2} and i want to print to a file without the brackets comas and semicolon in order to obtain something like

Re: no data exclution and unique combination.

2012-08-09 Thread Dave Angel
On 08/09/2012 04:06 PM, giuseppe.amatu...@gmail.com wrote: SNIP print unique {(4, 5): 1, (5, 4): 1, (4, 4): 2, (2, 3): 1, (4, 3): 2} I choose this solution because i could not install from collections import Counter. Nothing to install, at least for Python 2.7. collections is in the

Re: save dictionary to a file without brackets.

2012-08-09 Thread Roman Vashkevich
Actually, they are different. Put a dict.{iter}items() in an O(k^N) algorithm and make it a hundred thousand entries, and you will feel the difference. Dict uses hashing to get a value from the dict and this is why it's O(1). 10.08.2012, в 1:21, Tim Chase написал(а): On 08/09/12 15:41, Roman

Re: no data exclution and unique combination.

2012-08-09 Thread Terry Reedy
On 8/9/2012 4:06 PM, giuseppe.amatu...@gmail.com wrote: Terry and MRAB, thanks for yours suggestions, in the end i found this solution mask=( a != 0 ) ( b != 0 ) a_mask=a[mask] b_mask=b[mask] array2D = np.array(zip(a_mask,b_mask)) unique=dict() for row in array2D : row = tuple(row)

Re: save dictionary to a file without brackets.

2012-08-09 Thread Terry Reedy
On 8/9/2012 5:21 PM, Tim Chase wrote: On 08/09/12 15:41, Roman Vashkevich wrote: 10.08.2012, в 0:35, Tim Chase написал(а): On 08/09/12 15:22, Roman Vashkevich wrote: {(4, 5): 1, (5, 4): 1, (4, 4): 2, (2, 3): 1, (4, 3): 2} and i want to print to a file without the brackets comas and semicolon

Re: save dictionary to a file without brackets.

2012-08-09 Thread Dave Angel
On 08/09/2012 05:34 PM, Roman Vashkevich wrote: Actually, they are different. Put a dict.{iter}items() in an O(k^N) algorithm and make it a hundred thousand entries, and you will feel the difference. Dict uses hashing to get a value from the dict and this is why it's O(1). Sure, that's why

Re: save dictionary to a file without brackets.

2012-08-09 Thread Chris Kaynor
I realized, I should have done 10, 100, 1000 rather than 1, 10, 100 for better results, so here are the results for 1000 items. It still maintains the same pattern: timeit.timeit('for i in d: pass', 'd=dict.fromkeys(range(1000))') 10.166595947685153 timeit.timeit('for i in d.iteritems(): pass',

Re: save dictionary to a file without brackets.

2012-08-09 Thread Chris Kaynor
On Thu, Aug 9, 2012 at 2:34 PM, Roman Vashkevich vashkevic...@gmail.com wrote: Actually, they are different. Put a dict.{iter}items() in an O(k^N) algorithm and make it a hundred thousand entries, and you will feel the difference. Dict uses hashing to get a value from the dict and this is

trying to create simple py script

2012-08-09 Thread Smaran Harihar
Hi Guys, I am trying to create a simple cgi-script to receive a Ajax call, manipulate the string received and send it back as JSON. Most of the people I have spoken to, seemed to be against using the cgi script, but most of the documentation and tutorials seem to point to cgi for AJAX calls. They

Re: save dictionary to a file without brackets.

2012-08-09 Thread Giuseppe Amatulli
Thanks a lot for the clarification. Actually my problem is giving to raster dataset in geo-tif format find out unique pair combination, count the number of observation unique combination in rast1, count the number of observation unique combination in rast2, count the number of observation I try

Re: save dictionary to a file without brackets.

2012-08-09 Thread Roman Vashkevich
10.08.2012, в 1:47, Dave Angel написал(а): On 08/09/2012 05:34 PM, Roman Vashkevich wrote: Actually, they are different. Put a dict.{iter}items() in an O(k^N) algorithm and make it a hundred thousand entries, and you will feel the difference. Dict uses hashing to get a value from the dict

Re: save dictionary to a file without brackets.

2012-08-09 Thread Andrew Cooper
On 09/08/2012 22:34, Roman Vashkevich wrote: Actually, they are different. Put a dict.{iter}items() in an O(k^N) algorithm and make it a hundred thousand entries, and you will feel the difference. Dict uses hashing to get a value from the dict and this is why it's O(1). Sligtly off topic,

Re: save dictionary to a file without brackets.

2012-08-09 Thread Dave Angel
On 08/09/2012 06:03 PM, Andrew Cooper wrote: On 09/08/2012 22:34, Roman Vashkevich wrote: Actually, they are different. Put a dict.{iter}items() in an O(k^N) algorithm and make it a hundred thousand entries, and you will feel the difference. Dict uses hashing to get a value from the dict and

Re: save dictionary to a file without brackets.

2012-08-09 Thread Tim Chase
On 08/09/12 17:26, Dave Angel wrote: On 08/09/2012 06:03 PM, Andrew Cooper wrote: I'm glad you're wrong for CPython's dictionaries. The only time the lookup would degenerate to O[n] would be if the hash table had only one slot. CPython sensibly increases the hash table size when it becomes

Re: save dictionary to a file without brackets.

2012-08-09 Thread Chris Kaynor
On Thu, Aug 9, 2012 at 3:26 PM, Dave Angel d...@davea.name wrote: On 08/09/2012 06:03 PM, Andrew Cooper wrote: On 09/08/2012 22:34, Roman Vashkevich wrote: Actually, they are different. Put a dict.{iter}items() in an O(k^N) algorithm and make it a hundred thousand entries, and you will feel

Re: save dictionary to a file without brackets.

2012-08-09 Thread Chris Angelico
On Fri, Aug 10, 2012 at 8:26 AM, Dave Angel d...@davea.name wrote: On 08/09/2012 06:03 PM, Andrew Cooper wrote: O(n) for all other entries in the dict which suffer a hash collision with the searched entry. True, a sensible choice of hash function will reduce n to 1 in common cases, but it

Re: save dictionary to a file without brackets.

2012-08-09 Thread Andrew Cooper
On 09/08/2012 23:26, Dave Angel wrote: On 08/09/2012 06:03 PM, Andrew Cooper wrote: On 09/08/2012 22:34, Roman Vashkevich wrote: Actually, they are different. Put a dict.{iter}items() in an O(k^N) algorithm and make it a hundred thousand entries, and you will feel the difference. Dict uses

Re: save dictionary to a file without brackets.

2012-08-09 Thread Chris Angelico
On Fri, Aug 10, 2012 at 8:39 AM, Tim Chase python.l...@tim.thechases.com wrote: On 08/09/12 17:26, Dave Angel wrote: On 08/09/2012 06:03 PM, Andrew Cooper wrote: I'm glad you're wrong for CPython's dictionaries. The only time the lookup would degenerate to O[n] would be if the hash table had

Re: save dictionary to a file without brackets.

2012-08-09 Thread Oscar Benjamin
What do you think? is there a way to speed up the process? Thanks Giuseppe Which part is slow? How slow is it? A simple test to find the slow part of your code is to print messages between the commands so that you can see how long it takes between each message. Oscar. --

Re: save dictionary to a file without brackets.

2012-08-09 Thread Roy Smith
In article ucXUr.1030527$2z2.380746@fx19.am4, Andrew Cooper am...@cam.ac.uk wrote: As for poor implementations, class Foo(object): def __hash__(self): return 0 I seriously found that in some older code I had the misfortune of reading. Python assumes you are a consenting

Re: save dictionary to a file without brackets.

2012-08-09 Thread Chris Angelico
On Fri, Aug 10, 2012 at 9:05 AM, Roy Smith r...@panix.com wrote: Python assumes you are a consenting adult. If you wish to engage in activities which are hazardous to your health, so be it. ... you mean, Python lets you make a hash of it? *ducks for cover* ChrisA --

Re: save dictionary to a file without brackets.

2012-08-09 Thread Roy Smith
In article mailman.3135.1344554073.4697.python-l...@python.org, Chris Angelico ros...@gmail.com wrote: On Fri, Aug 10, 2012 at 9:05 AM, Roy Smith r...@panix.com wrote: Python assumes you are a consenting adult. If you wish to engage in activities which are hazardous to your health, so be

Re: save dictionary to a file without brackets.

2012-08-09 Thread Mark Lawrence
On 10/08/2012 00:24, Roy Smith wrote: In article mailman.3135.1344554073.4697.python-l...@python.org, Chris Angelico ros...@gmail.com wrote: On Fri, Aug 10, 2012 at 9:05 AM, Roy Smith r...@panix.com wrote: Python assumes you are a consenting adult. If you wish to engage in activities which

Re: save dictionary to a file without brackets.

2012-08-09 Thread Dave Angel
On 08/09/2012 06:54 PM, Andrew Cooper wrote: On 09/08/2012 23:26, Dave Angel wrote: On 08/09/2012 06:03 PM, Andrew Cooper wrote: On 09/08/2012 22:34, Roman Vashkevich wrote: Actually, they are different. Put a dict.{iter}items() in an O(k^N) algorithm and make it a hundred thousand entries,

Re: save dictionary to a file without brackets.

2012-08-09 Thread Dave Angel
On 08/09/2012 06:53 PM, Chris Angelico wrote: On Fri, Aug 10, 2012 at 8:26 AM, Dave Angel d...@davea.name wrote: On 08/09/2012 06:03 PM, Andrew Cooper wrote: O(n) for all other entries in the dict which suffer a hash collision with the searched entry. True, a sensible choice of hash function

Re: save dictionary to a file without brackets.

2012-08-09 Thread Oscar Benjamin
On Aug 10, 2012 12:34 AM, Giuseppe Amatulli giuseppe.amatu...@gmail.com wrote: Ciao, is 12 minutes for 5000x5000 pixel image. half of the time is for reading the arrays. and the other half for making the loop. I will try again to incorporate the mask action in the loop and read the image

Re: save dictionary to a file without brackets.

2012-08-09 Thread Tim Chase
On 08/09/12 18:33, Mark Lawrence wrote: On 10/08/2012 00:24, Roy Smith wrote: ... you mean, Python lets you make a hash of it? Only if you order it with spam, spam, spam, spam, spam, spam, and spam. Now now gentlemen we're getting slightly off topic here and wouldn't want to upset the

Re: save dictionary to a file without brackets.

2012-08-09 Thread Dave Angel
On 08/09/2012 08:16 PM, Tim Chase wrote: On 08/09/12 18:33, Mark Lawrence wrote: On 10/08/2012 00:24, Roy Smith wrote: ... you mean, Python lets you make a hash of it? Only if you order it with spam, spam, spam, spam, spam, spam, and spam. Now now gentlemen we're getting slightly off topic

Re: save dictionary to a file without brackets.

2012-08-09 Thread Chris Angelico
On Fri, Aug 10, 2012 at 10:16 AM, Tim Chase python.l...@tim.thechases.com wrote: We apologise for the off-topicness in the thread. Those responsible have been sacked... So if you take every mapping variable in your program and name them dFoo, dBar, dQuux, etc, for dict... would that be a dirty

Re: save dictionary to a file without brackets.

2012-08-09 Thread 88888 Dihedral
Andrew Cooper於 2012年8月10日星期五UTC+8上午6時03分26秒寫道: On 09/08/2012 22:34, Roman Vashkevich wrote: Actually, they are different. Put a dict.{iter}items() in an O(k^N) algorithm and make it a hundred thousand entries, and you will feel the difference. Dict uses hashing to get a value from

[issue15602] zipfile: wrong encoding charset of member filename

2012-08-09 Thread monson
New submission from monson: In /cpython/Lib/zipfile.py, there are some codes like if flags 0x800: # UTF-8 file names extension filename = filename.decode('utf-8') else: # Historical ZIP filename encoding

[issue12834] memoryview.to_bytes() and PyBuffer_ToContiguous() incorrect for non-contiguous arrays

2012-08-09 Thread Martin v . Löwis
Martin v. Löwis added the comment: Removing 3.1, since its addition was apparently done by mistake. Again, I wonder why this is marked release-critical. It's not a regression from previous versions, is it? Please use release-critical only if not making a release at a certain point in the

[issue12834] memoryview.to_bytes() and PyBuffer_ToContiguous() incorrect for non-contiguous arrays

2012-08-09 Thread Nick Coghlan
Nick Coghlan added the comment: Since the next release of 3.2 is the *last* release of 3.2, yet it will remain supported by distros well beyond that, yes, I think this should block the final 3.2 release. -- ___ Python tracker rep...@bugs.python.org

[issue15601] tkinter test_variables fails with OS X Aqua Tk 8.4

2012-08-09 Thread Martin v . Löwis
Martin v. Löwis added the comment: The purpose of the test is to test whether get works on a string variable. Any boolean/string conversions aren't really relevant here, so we should just use a second string in the test (e.g. def), instead of True. -- nosy: +loewis

[issue12834] memoryview.to_bytes() and PyBuffer_ToContiguous() incorrect for non-contiguous arrays

2012-08-09 Thread Martin v . Löwis
Martin v. Löwis added the comment: Since the next release of 3.2 is the *last* release of 3.2, yet it will remain supported by distros well beyond that, yes, I think this should block the final 3.2 release. But the same will be true for any other bug that 3.2 has. If they don't get fixed

[issue12834] memoryview.to_bytes() and PyBuffer_ToContiguous() incorrect for non-contiguous arrays

2012-08-09 Thread Stefan Krah
Stefan Krah added the comment: Removing 3.1, since its addition was apparently done by mistake. I'm unable to set 2.7 and 3.2 in my browser without also setting 3.1 (using the Shift key to mark multiple fields). -- ___ Python tracker

[issue15586] Provide some examples for usage of ElementTree methods/attributes

2012-08-09 Thread Eli Bendersky
Eli Bendersky added the comment: I provided some comments on your patch in the code-review tool. Thanks for the contribution, Daniel. It's fine to first apply these changes to 3.3 and then backport to 2.7 (I don't think 3.2 is necessary because most users use the online docs anyway).

[issue15586] Provide some examples for usage of ElementTree methods/attributes

2012-08-09 Thread Eli Bendersky
Changes by Eli Bendersky eli...@gmail.com: -- versions: +Python 2.7 ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue15586 ___ ___ Python-bugs-list

[issue15586] Provide some examples for usage of ElementTree methods/attributes

2012-08-09 Thread Eli Bendersky
Eli Bendersky added the comment: Sarbjit, if you look at the docs of 3.3, I think most of what you're asking for is there (especially once you count Daniel's commit). What else is missing in your opinion? -- ___ Python tracker

[issue15231] update PyPI upload doc to say --no-raw passed to rst2html.py

2012-08-09 Thread Eli Bendersky
Eli Bendersky added the comment: My job is done here. Éric - assigning to you for distutils2, once it becomes relevant. -- assignee: docs@python - eric.araujo ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue15231

[issue15231] update PyPI upload doc to say --no-raw passed to rst2html.py

2012-08-09 Thread Eli Bendersky
Changes by Eli Bendersky eli...@gmail.com: -- nosy: -eli.bendersky ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue15231 ___ ___ Python-bugs-list

[issue15599] test_circular_imports() of test_threaded_import fails on FreeBSD 9.0

2012-08-09 Thread Stefan Krah
Stefan Krah added the comment: The buildbot is running inside kvm on a heavily loaded machine. Perhaps some timeout is too low. -- nosy: +skrah ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue15599

[issue15586] Provide some examples for usage of ElementTree methods/attributes

2012-08-09 Thread Eli Bendersky
Eli Bendersky added the comment: Sarbjit: first of all, look at the up-to-date documentation for 3.3 (it's available online at http://docs.python.org/dev/ Then, on a checkout of the 3.3 code (default branch) you can apply Daniel's patch (it's in the Files section in this Issue) and look at

[issue15457] consistent treatment of generator terminology

2012-08-09 Thread Chris Jerdonek
Chris Jerdonek added the comment: Note to reviewers: changing to needs patch because I want to make changes to the latest patch before this is reviewed (e.g. to the index directives). I should be able to do this by the end of the weekend. -- stage: - needs patch

[issue15216] Support setting the encoding on a text stream after creation

2012-08-09 Thread STINNER Victor
STINNER Victor added the comment: Victor proposes that it's acceptable to simply disallow changing the encoding of a stream that isn't seekable. It is no what I said. My patch raises an exception if you already started to read stdin. It should work fine if stdin is a pipe but the read buffer

[issue14814] Implement PEP 3144 (the ipaddress module)

2012-08-09 Thread Eli Bendersky
Eli Bendersky added the comment: Here's a patch adding documentation to the *Interface classes. I must say I'm not very psyched about the with_* methods. Their outputs are inconsistent, unlike in *Network, where all return strings. -- ___ Python

[issue14814] Implement PEP 3144 (the ipaddress module)

2012-08-09 Thread Eli Bendersky
Changes by Eli Bendersky eli...@gmail.com: Added file: http://bugs.python.org/file26736/ipaddr_refdoc_interface.1.patch ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue14814 ___

[issue15355] generator docs should mention already-executing exception

2012-08-09 Thread Chris Jerdonek
Chris Jerdonek added the comment: Nick, would you be able to take a look at this minor documentation patch re: generators? Would you prefer this blanket statement, or an explicit (possibly repeated) statement inside the documentation of each method? -- versions: +Python 2.7, Python

[issue15602] zipfile: wrong encoding charset of member filename

2012-08-09 Thread Martin v . Löwis
Martin v. Löwis added the comment: You are mistaken: there *is* a character set specification for file names in zip files, see http://www.pkware.com/documents/casestudies/APPNOTE.TXT Appendix D says The ZIP format has historically supported only the original IBM PC character encoding set,

[issue15600] expose the finder details used by the FileFinder path hook

2012-08-09 Thread Chris Jerdonek
Chris Jerdonek added the comment: It seems like a test and documentation for this would be beneficial (for the usual reasons, etc). -- nosy: +cjerdonek ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue15600

[issue15589] Bus error on Debian sparc

2012-08-09 Thread Stefan Krah
Stefan Krah added the comment: If disabling faulthandler avoids new issues, you can add 'if [not] sys.thread_info.version.startswith(linuxthreads)' That suppresses some bus errors. However, they still occur without being raised (some print statements and a WIFSIGNALED test inserted in

[issue15151] Documentation for Signature, Parameter and signature in inspect module

2012-08-09 Thread Andrew Svetlov
Andrew Svetlov added the comment: Update patch -- Added file: http://bugs.python.org/file26737/inspect.pep362.4.patch ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue15151 ___

[issue15216] Support setting the encoding on a text stream after creation

2012-08-09 Thread Nick Coghlan
Nick Coghlan added the comment: Ah, you're right - peeking into the underlying buffer would be enough to handle encoding detection. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue15216 ___

[issue15501] Document exception classes in subprocess module

2012-08-09 Thread Anton Barkovsky
Changes by Anton Barkovsky swarmer...@gmail.com: Added file: http://bugs.python.org/file26738/subprocess_doc_2.7_v2.patch ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue15501 ___

[issue15501] Document exception classes in subprocess module

2012-08-09 Thread Anton Barkovsky
Changes by Anton Barkovsky swarmer...@gmail.com: Added file: http://bugs.python.org/file26739/subprocess_doc_3.2_v2.patch ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue15501 ___

[issue15501] Document exception classes in subprocess module

2012-08-09 Thread Anton Barkovsky
Changes by Anton Barkovsky swarmer...@gmail.com: Added file: http://bugs.python.org/file26740/subprocess_doc_3.3_v2.patch ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue15501 ___

[issue15501] Document exception classes in subprocess module

2012-08-09 Thread Anton Barkovsky
Anton Barkovsky added the comment: Updated. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue15501 ___ ___ Python-bugs-list mailing list

[issue15151] Documentation for Signature, Parameter and signature in inspect module

2012-08-09 Thread Yury Selivanov
Yury Selivanov added the comment: Thanks a lot for the patch update, Andrew! Please let me glance over it once again today/tomorrow before you commit it. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue15151

[issue15501] Document exception classes in subprocess module

2012-08-09 Thread Roundup Robot
Roundup Robot added the comment: New changeset b863e231ad9f by Andrew Svetlov in branch 'default': Issue #15501: Document exception classes in subprocess module. http://hg.python.org/cpython/rev/b863e231ad9f New changeset 1e8f6d8e5c0e by Andrew Svetlov in branch '3.2': Issue #15501: Document

[issue14966] Fully document subprocess.CalledProcessError

2012-08-09 Thread Andrew Svetlov
Andrew Svetlov added the comment: Documented in #15501. I like to close this issue as duplicate. If anybody don't agree with closing feel free to reopen this one. -- nosy: +asvetlov resolution: - duplicate stage: - committed/rejected status: open - closed

[issue15501] Document exception classes in subprocess module

2012-08-09 Thread Andrew Svetlov
Andrew Svetlov added the comment: Fixed. Thank you, Anton. -- resolution: - fixed stage: patch review - committed/rejected status: open - closed superseder: - Fully document subprocess.CalledProcessError ___ Python tracker rep...@bugs.python.org

[issue15527] Double parens in functions references

2012-08-09 Thread Andrew Svetlov
Changes by Andrew Svetlov andrew.svet...@gmail.com: -- nosy: +asvetlov ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue15527 ___ ___

[issue15557] Tests for webbrowser module

2012-08-09 Thread Andrew Svetlov
Changes by Andrew Svetlov andrew.svet...@gmail.com: -- dependencies: +A file is not properly closed by webbrowser._invoke, webbrowser.open sometimes passes zero-length argument to the browser. versions: +Python 3.4 -Python 3.3 ___ Python tracker

[issue4966] Improving Lib Doc Sequence Types Section

2012-08-09 Thread Ezio Melotti
Changes by Ezio Melotti ezio.melo...@gmail.com: -- versions: +Python 3.4 ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue4966 ___ ___

[issue15561] update subprocess docs to reference io.TextIOWrapper

2012-08-09 Thread Andrew Svetlov
Changes by Andrew Svetlov andrew.svet...@gmail.com: -- nosy: +asvetlov ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue15561 ___ ___

  1   2   >