pyCologne Python User Group Cologne - Meeting, May 11, 2011, 6.30pm

2011-05-09 Thread Andi Albrecht
The next meeting of pyCologne will take place: Wednesday, May, 11th starting about 6.30 pm - 6.45 pm at Room 0.14, Benutzerrechenzentrum (RRZK-B) University of Cologne, Berrenrather Str. 136, 50937 Köln, Germany On this month's agenda: - PythonCamp Review (everyone) - Lightning Talks

Re: PIL: The _imaging C module is not installed

2011-05-09 Thread Nico Grubert
I had this happening to me as well someday. I recall that first installing it (python setup.py install), and then rerunning selftest, solved that error. I tried that as well. Here is the summary of the install process: build/temp.linux-x86_64-2.4/libImaging/ZipEncode.o -L/usr/local/lib

Re: What other languages use the same data model as Python?

2011-05-09 Thread Hans Georg Schaathun
On Sat, 07 May 2011 21:21:45 +1200, Gregory Ewing greg.ew...@canterbury.ac.nz wrote: : You can manipulate them just fine by moving them : from one place to another: : : a = b : : You can use them to get at stuff they refer to: : : a = b.c : a[:] = b[:] Surely you can refer

Re: How to access elemenst in a list of lists?

2011-05-09 Thread Antonio CHESSA
Just learning python. I can see that I can address an individual element of a list of lists by doing something like: row = list[5] element = row[3] But is there a way to directly address an entry in a single statement? Thanks for any help. Regards Chris Roy-Smith suppose you have a list like

Re: scipy

2011-05-09 Thread pb
On May 9, 12:29 am, Terry Reedy tjre...@udel.edu wrote: On 5/8/2011 6:44 AM, pb wrote: Hi, I', having trouble with scipy. If you do not get an answer here, try the scipy list where scipy experts hang out. You might also try searching the archives of that list or the scipy bug tracker.

HELP ME, PLEASE. SCRIP EXPORT TO .TM

2011-05-09 Thread EnyGmA Más Pro
Good morning Python community, I need help to develop or create a script to export to. tmb but blender, there is to import. tmb in blender (look here: http://www.mediafire.com/?2g20yymmxam) this and I have, but need one to export in a blender. tmb. Windows platform (XP, Windows 7 and Windows

FW: AYUDA PORFAVOR. HELP ME, PLEASE. SCRIP EXPORT TO .TM

2011-05-09 Thread EnyGmA Más Pro
aYudenme porfavor. Gracias. From: jean_p...@hotmail.es To: python-list@python.org; h...@python.org; pycolom...@listas.el-directorio.org Subject: HELP ME, PLEASE. SCRIP EXPORT TO .TM Date: Mon, 9 May 2011 03:56:40 -0500 Good morning Python community, I need help to develop or create a

RE: Coolest Python recipe of all time

2011-05-09 Thread Trent Nelson
What are your favorites? I think I've posted this before, but I love my 3-lines-if-you-ignore-the-scaffolding language translator. Not because it's clever code -- quite the opposite, the code is dead simple -- but because it encompasses one of the things I love about Python the most: it gets

Re: PIL: The _imaging C module is not installed

2011-05-09 Thread Christian Heimes
Am 09.05.2011 08:22, schrieb Nico Grubert: $ python selftest.py *** The _imaging C module is not installed It works for me after an inplace installation of the C extensions with python setup.py build_ext -i. With build_ext -i the C extension is installed inside the source tree so selftest can

Re: FW: AYUDA PORFAVOR. HELP ME, PLEASE. SCRIP EXPORT TO .TM

2011-05-09 Thread Felipe Vinturini
On Mon, May 9, 2011 at 6:05 AM, EnyGmA Más Pro jean_p...@hotmail.es wrote: aYudenme porfavor. Gracias. -- From: jean_p...@hotmail.es To: python-list@python.org; h...@python.org; pycolom...@listas.el-directorio.org Subject: HELP ME, PLEASE. SCRIP EXPORT TO .TM

Re: What other languages use the same data model as Python?

2011-05-09 Thread Hans Georg Schaathun
On Mon, 09 May 2011 12:52:27 +1200, Gregory Ewing greg.ew...@canterbury.ac.nz wrote: : Let me save you from guessing. I'm thinking of a piece of paper with : a little box on it and the name 'a' written beside it. There is an : arrow from that box to a bigger box. : :

Re: What other languages use the same data model as Python?

2011-05-09 Thread Chris Angelico
On Mon, May 9, 2011 at 8:38 PM, Hans Georg Schaathun h...@schaathun.net wrote: The flaw of this model, and I am not discounting its merits, just pointing out that it isn't perfect, is that it creates the illusion that references are boxes (objects) just like data objects, leading the reader to

input() or raw_input() in Console module.

2011-05-09 Thread ander2_1434
I'm using Console module (doc: http://effbot.org/zone/console-handbook.htm, like nCurses) on Windows, but I don't know how to call a keyboard input like input() or raw_input(). What to do? -- http://mail.python.org/mailman/listinfo/python-list

Re: What other languages use the same data model as Python?

2011-05-09 Thread Steven D'Aprano
On Mon, 09 May 2011 12:52:27 +1200, Gregory Ewing wrote: Steven D'Aprano wrote: Since you haven't explained what you think is happening, I can only guess. Let me save you from guessing. I'm thinking of a piece of paper with a little box on it and the name 'a' written beside it. There is

Re: scipy

2011-05-09 Thread Robert Kern
On 5/9/11 3:35 AM, pb wrote: On May 9, 12:29 am, Terry Reedytjre...@udel.edu wrote: On 5/8/2011 6:44 AM, pb wrote: Hi, I', having trouble with scipy. If you do not get an answer here, try the scipy list where scipy experts hang out. You might also try searching the archives of that list or

Re: What other languages use the same data model as Python?

2011-05-09 Thread Tim Golden
On 09/05/2011 15:29, Steven D'Aprano wrote: [... snippage galore ...] Slightly abstract comment: while I don't usually get much enjoyment out of the regular Python is call-by-value; no it isn't; yes it is debates, I always enjoy reading Steven D'Aprano's responses. Thanks, Mr D'A. :) TJG --

Re: A suggestion for an easy logger

2011-05-09 Thread TheSaint
Vinay Sajip wrote: logging.basicConfig(level=logging.DEBUG, format='%(message)s') logging.basicConfig(format='%(message)s', level=logging.DEBUG) I formulated in the reverse order of arguments, may that cause an unpredicted result? The other points became clearer.. Once again Thank You --

RE: setuptools for 64-bit 2.7.1 on 64-bit Windows 7?

2011-05-09 Thread Dick Bridges
David, Thanks for the link. I'd scanned but skipped it because it was third-party. This time I started following some of the links and finally found the link for distutils: http://pypi.python.org/pypi/distribute#installation-instructions. Works like a charm. Thanks for pointing me back to that

Re: A suggestion for an easy logger

2011-05-09 Thread Vinay Sajip
On May 9, 3:53 pm, TheSaint nob...@nowhere.net.no wrote: Vinay Sajip wrote: logging.basicConfig(level=logging.DEBUG, format='%(message)s') logging.basicConfig(format='%(message)s', level=logging.DEBUG) I formulated in the reverse order of arguments, may that cause an unpredicted result?

Re: What other languages use the same data model as Python?

2011-05-09 Thread Ethan Furman
Steven D'Aprano wrote: But that's wrong! Names (little boxes) can't point to *slots in a list*, any more than they can point to other names! This doesn't work: -- L = [None, 42, None] -- a = L[0] -- L[0] = 23 -- print(a) # This doesn't work! 23 Minor nitpick -- having a comment saying

Re: Zope with mySQL

2011-05-09 Thread Chris Withers
Hi Harry, You'd be better off asking this on the z...@zope.org mailing list... cheers, Chris On 28/04/2011 20:19, harryjatt wrote: Hi, i am doing web development with Zope. My connected database is mySQL. I am new to this combination.I have to upload the files to mySQL with programming in

Re: What other languages use the same data model as Python?

2011-05-09 Thread Mel
Steven D'Aprano wrote: It's not an awful model for Python: a name binding a = obj is equivalent to sticking a reference (a pointer?) in box a that points to obj. Certainly there are advantages to it. But one problem is, the model is ambiguous with b = a. You've drawn little boxes a and b

Inconsistency with split() - Script, OS, or Package Problem?

2011-05-09 Thread James Wright
Hello, I have been using a script on several boxes that have been around for a while, and everything works just fine. I am finding though, that on some new OS installs the script fails with: Traceback (most recent call last): File render4.py, line 114, in module

Re: scipy

2011-05-09 Thread pb
On May 9, 3:34 pm, Robert Kern robert.k...@gmail.com wrote: On 5/9/11 3:35 AM, pb wrote: On May 9, 12:29 am, Terry Reedytjre...@udel.edu  wrote: On 5/8/2011 6:44 AM, pb wrote: Hi, I', having trouble with scipy. If you do not get an answer here, try the scipy list where scipy experts

Re: PIL: The _imaging C module is not installed

2011-05-09 Thread Irmen de Jong
On 9-5-2011 8:22, Nico Grubert wrote: I had this happening to me as well someday. I recall that first installing it (python setup.py install), and then rerunning selftest, solved that error. I tried that as well. Here is the summary of the install process:

can't get urllib2 or httplib to work with tor privoxy

2011-05-09 Thread Bob Fnord
Here's my python code: import httplib, urllib2 proxy_handler = {'http' : 'localhost:8118', 'https' : 'localhost:8118'} def connect_u2(url = 'http://ipid.shat.net/iponly/'):, proxied = urllib2.ProxyHandler(proxy_handler) opnr = urllib2.build_opener(proxied)

Re: Inconsistency with split() - Script, OS, or Package Problem?

2011-05-09 Thread Ian Kelly
On Mon, May 9, 2011 at 12:10 PM, James Wright jamfwri...@gmail.com wrote: Hello, I have been using a script on several boxes that have been around for a while, and everything works just fine.  I am finding though, that on some new OS installs the script fails with: Traceback (most recent

Re: Inconsistency with split() - Script, OS, or Package Problem?

2011-05-09 Thread Ethan Furman
James Wright wrote: Hello, Howdy! def create_report_index(report): #Here we are creating a simple index.html file from data in a text file newfile = open(report + '.html', 'w') #Create the index file using report name for each_value in D4[report]: [clean_name, _] =

Re: Inconsistency with split() - Script, OS, or Package Problem?

2011-05-09 Thread Steven D'Aprano
On Mon, 09 May 2011 14:10:21 -0400, James Wright wrote: Hello, I have been using a script on several boxes that have been around for a while, and everything works just fine. I am finding though, that on some new OS installs the script fails with: Traceback (most recent call last):

Re: Inconsistency with split() - Script, OS, or Package Problem?

2011-05-09 Thread James Wright
Thank you Ethan, This is what I see now: # python render4.py current each_value is: vsr Traceback (most recent call last): File render4.py, line 115, in module create_report_index(each_item) File render4.py, line 26, in create_report_index [clean_name, _] = each_value.split('_', 1)

Re: Inconsistency with split() - Script, OS, or Package Problem?

2011-05-09 Thread James Wright
Thank you Steven, I will take your advice :) In this particular case though, I do not think a lack of underscore is the issue, at least as far as I can understand the issue. Please see my reply to Ethan. Thanks, James On Mon, May 9, 2011 at 2:43 PM, Steven D'Aprano

Re: Inconsistency with split() - Script, OS, or Package Problem?

2011-05-09 Thread James Wright
Hello Ian, It does indeed to seem that way. However the script works just fine on other machines, with the same input file. Thanks, James On Mon, May 9, 2011 at 2:41 PM, Ian Kelly ian.g.ke...@gmail.com wrote: On Mon, May 9, 2011 at 12:10 PM, James Wright jamfwri...@gmail.com wrote: Hello,

Missing 'line' event when writing to frame.f_lineno in trace function

2011-05-09 Thread CTS
Hello all, I've been playing with sys.settrace() in an attempt to better understand how trace functions (and debugging) work. I'm running Python3.2 on Windows, which I installed by running the installer package (i.e. I did not compile from source code). Here's my code, some of which I borrowed

Re: Inconsistency with split() - Script, OS, or Package Problem?

2011-05-09 Thread Ethan Furman
James Wright wrote: Thank you Ethan, This is what I see now: # python render4.py current each_value is: vsr Traceback (most recent call last): File render4.py, line 115, in module create_report_index(each_item) File render4.py, line 26, in create_report_index [clean_name, _] =

Re: How to access elemenst in a list of lists?

2011-05-09 Thread Terry Reedy
On 5/9/2011 4:25 AM, Antonio CHESSA wrote: apple = [[a,b,c],[1,2,3,4,5,6],[antony,max,sandra,sebastian]] apple[0] = [a,b,c] apple[1] = [1,2,3,4,5,6] apple[2] = [antony,max,sandra,sebastian] apple[0][1] = b apple[2][3] = sebastian to view all videos in a loop so you can set: for i in

Re: Inconsistency with split() - Script, OS, or Package Problem?

2011-05-09 Thread MRAB
On 09/05/2011 20:10, James Wright wrote: On Mon, May 9, 2011 at 2:41 PM, Ian Kellyian.g.ke...@gmail.com wrote: On Mon, May 9, 2011 at 12:10 PM, James Wrightjamfwri...@gmail.com wrote: Hello, I have been using a script on several boxes that have been around for a while, and everything works

Re: Inconsistency with split() - Script, OS, or Package Problem?

2011-05-09 Thread James Wright
On Mon, May 9, 2011 at 3:36 PM, Ethan Furman et...@stoneleaf.us wrote: James Wright wrote: Thank you Ethan, This is what I see now: # python render4.py current each_value is: vsr Traceback (most recent call last):  File render4.py, line 115, in module    create_report_index(each_item)  

Re: Custom string joining

2011-05-09 Thread Martineau
On May 7, 5:31 am, Claudiu Popa cp...@bitdefender.com wrote: Hello Python-list, I  have  an object which defines some methods. I want to join a list or an iterable of those objects like this: new_string = |.join(iterable_of_custom_objects) What   is   the   __magic__  function that needs

Re: Inconsistency with split() - Script, OS, or Package Problem?

2011-05-09 Thread Ian Kelly
On Mon, May 9, 2011 at 1:29 PM, James Wright jamfwri...@gmail.com wrote: It does not appear to show a key: D4[] = vsr Traceback (most recent call last):  File render4.py, line 115, in module    create_report_index(each_item)  File render4.py, line 26, in create_report_index    [clean_name,

Re: Inconsistency with split() - Script, OS, or Package Problem?

2011-05-09 Thread Ethan Furman
James Wright wrote: On Mon, May 9, 2011 at 3:36 PM, Ethan Furman et...@stoneleaf.us wrote: Change your print line to: print(D4[%s] = %s % (report, each_value)) After that, you'll have to track down how D4 is being created to see where 'vsr' is coming from. It does not appear to show a

Re: Inconsistency with split() - Script, OS, or Package Problem?

2011-05-09 Thread Alex Willmer
(Direct reply to me, reposted on Jame's behalf) Hi Alex, On Mon, May 9, 2011 at 3:21 PM, Alex Willmer a...@moreati.org.uk wrote: On May 9, 8:10 pm, James Wright jamfwri...@gmail.com wrote: Hello Ian, It does indeed to seem that way. However the script works just fine on other machines,

Re: Custom string joining

2011-05-09 Thread Ian Kelly
On Mon, May 9, 2011 at 1:26 PM, Martineau ggrp2.20.martin...@dfgh.net wrote: Instead of join() here's a function that does something similar to what the string join() method does. The first argument can be a list of any type of objects and the second separator argument can likewise be any

Re: Inconsistency with split() - Script, OS, or Package Problem?

2011-05-09 Thread James Wright
Hello Ethan, On Mon, May 9, 2011 at 4:04 PM, Ethan Furman et...@stoneleaf.us wrote: James Wright wrote: On Mon, May 9, 2011 at 3:36 PM, Ethan Furman et...@stoneleaf.us wrote: Change your print line to:   print(D4[%s] = %s % (report, each_value)) After that, you'll have to track down how

Re: Inconsistency with split() - Script, OS, or Package Problem?

2011-05-09 Thread James Wright
Sorry Alex, and thank you. On Mon, May 9, 2011 at 4:02 PM, Alex Willmer a...@moreati.org.uk wrote: (Direct reply to me, reposted on Jame's behalf) Hi Alex, On Mon, May 9, 2011 at 3:21 PM, Alex Willmer a...@moreati.org.uk wrote: On May 9, 8:10 pm, James Wright jamfwri...@gmail.com wrote:

Re: Custom string joining

2011-05-09 Thread Karim
On 05/07/11 16:25, Chris Rebert wrote: On Sat, May 7, 2011 at 5:31 AM, Claudiu Popacp...@bitdefender.com wrote: Hello Python-list, I have an object which defines some methods. I want to join a list or an iterable of those objects like this: new_string = |.join(iterable_of_custom_objects)

Re: What other languages use the same data model as Python?

2011-05-09 Thread Terry Reedy
On 5/9/2011 10:29 AM, Steven D'Aprano wrote: If people then ask, how does the interpreter know the names?, I can add more detail: names are actually strings in a namespace, which is usually nothing more than a dict. Oh, and inside functions, it's a bit more complicated still. And so on. Which

Re: Custom string joining

2011-05-09 Thread Claudiu Popa
Hello Karim, You just have to implement __str__() python special method for your custom_objects. Regards Karim Cheers, Chris -- http://rebertia.com I already told in the first post that I've implemented __str__ function, but it doesn't seems to be automatically called. For instance,

Re: Inconsistency with split() - Script, OS, or Package Problem?

2011-05-09 Thread Ethan Furman
James Wright wrote: On Mon, May 9, 2011 at 4:04 PM, Ethan Furman wrote: James Wright wrote: On Mon, May 9, 2011 at 3:36 PM, Ethan Furman wrote: Change your print line to: print(D4[%s] = %s % (report, each_value)) After that, you'll have to track down how D4 is being created to see where

Re: Inconsistency with split() - Script, OS, or Package Problem?

2011-05-09 Thread Terry Reedy
On 5/9/2011 2:10 PM, James Wright wrote: Hello, I have been using a script on several boxes that have been around for a while, and everything works just fine. I am finding though, that on some new OS installs the script fails with: Traceback (most recent call last): File render4.py, line

Finding the bitness of an arbitrary executable with Python

2011-05-09 Thread Andrew Berg
I need to find whether a given file is 32-bit or 64-bit (and raise an exception if the file doesn't exist or isn't an executable file). I thought platform.architecture() would do this, but it returns ('64bit', '') no matter what value I assign to the executable parameter (looks like it uses the

Re: What other languages use the same data model as Python?

2011-05-09 Thread Hans Georg Schaathun
On Mon, 9 May 2011 21:18:29 +1000, Chris Angelico ros...@gmail.com wrote: : Analogies are like diagrams. Not all of them are perfect or useful. : : The boxes are different sizes. If you really want them to look : different, do one as squares and one as circles, but don't try that in : plain

Re: Finding the bitness of an arbitrary executable with Python

2011-05-09 Thread Richard Thomas
On May 9, 9:52 pm, Andrew Berg bahamutzero8...@gmail.com wrote: I need to find whether a given file is 32-bit or 64-bit (and raise an exception if the file doesn't exist or isn't an executable file). I thought platform.architecture() would do this, but it returns ('64bit', '') no matter what

Re: Finding the bitness of an arbitrary executable with Python

2011-05-09 Thread Irmen de Jong
On 9-5-2011 22:52, Andrew Berg wrote: I need to find whether a given file is 32-bit or 64-bit (and raise an exception if the file doesn't exist or isn't an executable file). I thought platform.architecture() would do this, but it returns ('64bit', '') no matter what value I assign to the

Re: Coolest Python recipe of all time

2011-05-09 Thread Raymond Hettinger
On May 9, 2:31 am, Trent Nelson tr...@snakebite.org wrote: What are your favorites? I think I've posted this before, but I love my 3-lines-if-you-ignore-the-scaffolding language translator.  Not because it's clever code -- quite the opposite, the code is dead simple -- but because it

Re: Finding the bitness of an arbitrary executable with Python

2011-05-09 Thread Robert Kern
On 5/9/11 3:52 PM, Andrew Berg wrote: I need to find whether a given file is 32-bit or 64-bit (and raise an exception if the file doesn't exist or isn't an executable file). I thought platform.architecture() would do this, but it returns ('64bit', '') no matter what value I assign to the

Re: What other languages use the same data model as Python?

2011-05-09 Thread harrismh777
Gregory Ewing wrote: +-+ +---+ | | a | --+| | +---+ | | +-+ ^ +---+

Re: checking if a list is empty

2011-05-09 Thread Terry Reedy
On 5/8/2011 7:36 PM, Dan Stromberg wrote: On Sun, May 8, 2011 at 3:41 PM, Terry Reedy tjre...@udel.edu mailto:tjre...@udel.edu wrote: Because inductive algorithms commonly branch on 'input is something' (not done, change args toward 'nothing'and recurse or iterate) versus 'input

Re: Custom string joining

2011-05-09 Thread Martineau
On May 9, 1:25 pm, Claudiu Popa cp...@bitdefender.com wrote: Hello Karim, You just have to implement __str__() python special method for your custom_objects. Regards Karim Cheers, Chris -- http://rebertia.com I  already told in the first post that I've implemented __str__

Re: Finding the bitness of an arbitrary executable with Python

2011-05-09 Thread Andrew Berg
On 2011.05.09 04:10 PM, Irmen de Jong wrote: http://stackoverflow.com/questions/1345632/determine-if-an-executable-or-library-is-32-or-64-bits-on-windows The code using struct doesn't look terribly complicated, so that could work. I might need to inspect other executable types, but I don't see it

Re: checking if a list is empty

2011-05-09 Thread harrismh777
Ian Kelly wrote: bool(list) describes whether the list contains something. Not being a logical operator, it stands to reason that not list should mean the same thing as not bool(list). Ian, James, Agreed, and thank you. This *is* the explanation I was trying to prompt D'Aprano for,

Re: Custom string joining

2011-05-09 Thread Terry Reedy
On 5/9/2011 4:25 PM, Claudiu Popa wrote: I already told in the first post that I've implemented __str__ function, but it doesn't seems to be automatically called. No, Python does not auto-coerce to strings (only between numbers). You have to be explicit by calling str. Karim's statement You

Re: checking if a list is empty

2011-05-09 Thread Steven D'Aprano
On Mon, 09 May 2011 16:58:14 -0500, harrismh777 wrote: Ian Kelly wrote: bool(list) describes whether the list contains something. Not being a logical operator, it stands to reason that not list should mean the same thing as not bool(list). Ian, James, Agreed, and thank you. This

Re: checking if a list is empty

2011-05-09 Thread Ben Finney
Steven D'Aprano steve+comp.lang.pyt...@pearwood.info writes: I'm sorry that I failed to make that more explicit. If I were talking to a programming n00b, I would have been more careful, but you've made numerous references to your long, long programming experience and I thought you would be

Re: Inconsistency with split() - Script, OS, or Package Problem?

2011-05-09 Thread Steven D'Aprano
On Mon, 09 May 2011 15:09:32 -0400, James Wright wrote: Thank you Steven, I will take your advice :) In this particular case though, I do not think a lack of underscore is the issue, at least as far as I can understand the issue. Please see my reply to Ethan. In your reply to Ethan, you

Re: checking if a list is empty

2011-05-09 Thread harrismh777
Steven D'Aprano wrote: Python uses a boolean algebra where there are many ways of spelling the true and false values. The not operator returns the canonical bool values: Take note of the distinction between lower-case true/false, which are adjectives, and True/False,

Re: checking if a list is empty

2011-05-09 Thread harrismh777
Steven D'Aprano wrote: If I were talking to a programming n00b, I would have been more careful, but you've made numerous references to your long, long programming experience and I thought you would be able to draw the obvious connection without me insulting you by stating the obvious.

Re: scipy

2011-05-09 Thread Algis Kabaila
On Tuesday 10 May 2011 04:13:55 pb wrote: On May 9, 3:34 pm, Robert Kern robert.k...@gmail.com wrote: On 5/9/11 3:35 AM, pb wrote: On May 9, 12:29 am, Terry Reedytjre...@udel.edu wrote: On 5/8/2011 6:44 AM, pb wrote: Hi, I', having trouble with scipy. If you do not get an

Overuse of try/except/else?

2011-05-09 Thread Kyle T. Jones
It has been hard for me to determine what would constitute overuse. Cheers. -- http://mail.python.org/mailman/listinfo/python-list

Re: How to access elemenst in a list of lists?

2011-05-09 Thread Algis Kabaila
On Tuesday 10 May 2011 05:24:16 Terry Reedy wrote: On 5/9/2011 4:25 AM, Antonio CHESSA wrote: apple = [[a,b,c],[1,2,3,4,5,6],[antony,max,sandra,seb astian]] for j in range (len(apple[i])): print apple[i][j] While this illustrate double indexing, it can be simplified to

Re: Overuse of try/except/else?

2011-05-09 Thread James Mills
On Tue, May 10, 2011 at 10:40 AM, Kyle T. Jones onexpadrem...@evomeryahoodotyouknow.com wrote: It has been hard for me to determine what would constitute overuse. A rule of thumb I always follow and practice is: Let the error lie where it occurred. or Don't hide errors.. It's good practice

Re: How to access elemenst in a list of lists?

2011-05-09 Thread Terry Reedy
On 5/9/2011 8:44 PM, Algis Kabaila wrote: The method of double indexing in the manner a[i][j] for the (i, j) -th element of multi-dimensional array is well known and widely used. But how to enable the standard matrix notation a[i, j] in Python 3.2 in the manner of numpy (and other matrix

Re: Dictionary from String?

2011-05-09 Thread python
On May 8, 12:43 pm, Benjamin Kaplan benjamin.kap...@case.edu wrote: On Sun, May 8, 2011 at 8:20 AM, Greg Lindstrom gslindst...@gmail.com wrote: Is it possible to create a dictionary from a string value?  Something along these lines (but that works): mystring = {'name':'greg','hatsize':'7

Re: Dictionary from String?

2011-05-09 Thread python
On May 9, 9:33 pm, python w.g.sned...@gmail.com wrote: On May 8, 12:43 pm, Benjamin Kaplan benjamin.kap...@case.edu wrote: On Sun, May 8, 2011 at 8:20 AM, Greg Lindstrom gslindst...@gmail.com wrote: Is it possible to create a dictionary from a string value?  Something along

Re: What other languages use the same data model as Python?

2011-05-09 Thread Gregory Ewing
Steven D'Aprano wrote: It's just that the term variable is so useful and so familiar that it's easy to use it even for languages that don't have variables in the C/ Pascal/Fortran/etc sense. Who says it has to have the Pascal/Fortran/etc sense? Why should static languages have a monopoly on

Re: What other languages use the same data model as Python?

2011-05-09 Thread Gregory Ewing
Steven D'Aprano wrote: Or Chinese Gooseberries, better known by the name thought up by a marketing firm, kiwi fruit. And I'm told that there is a language (one of the Nordic ones, IIRC) where kiwi means stone. So in that country they wonder why they should be getting so excited about

codecs.open() doesn't handle platform-specific line terminator

2011-05-09 Thread John Machin
According to the 3.2 docs (http://docs.python.org/py3k/library/codecs.html#codecs.open), Files are always opened in binary mode, even if no binary mode was specified. This is done to avoid data loss due to encodings using 8-bit values. This means that no automatic conversion of b'\n' is done on

Re: What other languages use the same data model as Python?

2011-05-09 Thread MRAB
On 10/05/2011 02:51, Gregory Ewing wrote: Steven D'Aprano wrote: Or Chinese Gooseberries, better known by the name thought up by a marketing firm, kiwi fruit. And I'm told that there is a language (one of the Nordic ones, IIRC) where kiwi means stone. So in that country they wonder why they

Re: What other languages use the same data model as Python?

2011-05-09 Thread Steven D'Aprano
On Tue, 10 May 2011 13:49:04 +1200, Gregory Ewing wrote: Steven D'Aprano wrote: It's just that the term variable is so useful and so familiar that it's easy to use it even for languages that don't have variables in the C/ Pascal/Fortran/etc sense. Who says it has to have the

Re: input() or raw_input() in Console module.

2011-05-09 Thread alex23
On May 9, 10:13 pm, ander2_1...@hotmail.com wrote: I'm using Console module (doc:http://effbot.org/zone/console-handbook.htm, like nCurses) on Windows, but I don't know how to call a keyboard input like input() or raw_input(). What to do? Maybe read the docs, specifically the section titled

Re: Testing tools classification

2011-05-09 Thread Gabriel Genellina
En Sat, 07 May 2011 02:21:02 -0300, rusi rustompm...@gmail.com escribió: There is this nice page of testing tools taxonomy: http://pycheesecake.org/wiki/PythonTestingToolsTaxonomy But it does not list staf: http://staf.sourceforge.net/index.php. The good thing about wikis is, you can add it

Re: Custom string joining

2011-05-09 Thread Claudiu Popa
Hello Terry, Thanks, I understand now. Tuesday, May 10, 2011, 2:16:24 AM, you wrote: On 5/9/2011 4:25 PM, Claudiu Popa wrote: I already told in the first post that I've implemented __str__ function, but it doesn't seems to be automatically called. No, Python does not auto-coerce to

[issue11164] xml shouldn't use _xmlplus

2011-05-09 Thread Martin v . Löwis
Martin v. Löwis mar...@v.loewis.de added the comment: allnodes was deleted in 5b3fbff05ffd -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue11164 ___

[issue11164] xml shouldn't use _xmlplus

2011-05-09 Thread Roundup Robot
Roundup Robot devnull@devnull added the comment: New changeset 61798f076676 by Martin v. Löwis in branch '3.1': Stop trying to use _xmlplus in the xml module. Closes #11164. http://hg.python.org/cpython/rev/61798f076676 -- nosy: +python-dev resolution: - fixed stage: -

[issue11164] xml shouldn't use _xmlplus

2011-05-09 Thread Roundup Robot
Roundup Robot devnull@devnull added the comment: New changeset 6c7984bae459 by Martin v. Löwis in branch '2.7': Issue 11164: Remove obsolete allnodes test from minidom test. http://hg.python.org/cpython/rev/6c7984bae459 -- ___ Python tracker

[issue11888] Add C99's log2() function to the math library

2011-05-09 Thread Mark Dickinson
Mark Dickinson dicki...@gmail.com added the comment: Thanks, Victor. You caught me by surprise a bit: I had some more minor changes to that patch pending, so I've committed those separately. Any news from the buildbots? -- ___ Python tracker

[issue12035] problem with installing validator.nu on windows

2011-05-09 Thread sulakshana
New submission from sulakshana sulakshana...@gmail.com: I tried following instructions given in http://about.validator.nu/#src to install validator.nu on windows. 1. changed hg clone https://bitbucket.org/validator/build build to hg.py clone https://bitbucket.org/validator/build build as HG

[issue12035] problem with installing validator.nu on windows

2011-05-09 Thread Amaury Forgeot d'Arc
Amaury Forgeot d'Arc amaur...@gmail.com added the comment: This is not a python issue. Please report your problem to the validator project. -- nosy: +amaury.forgeotdarc resolution: - invalid status: open - closed ___ Python tracker

[issue11888] Add C99's log2() function to the math library

2011-05-09 Thread STINNER Victor
STINNER Victor victor.stin...@haypocalc.com added the comment: Thanks, Victor. You caught me by surprise a bit Oh, I thought that the patch was ready to be commited. I had some more minor changes to that patch pending, so I've committed those separately. You should add Issue #11888:

[issue11877] Change os.fsync() to support physical backing store syncs

2011-05-09 Thread Steffen Daode Nurpmeso
Steffen Daode Nurpmeso sdao...@googlemail.com added the comment: Ronald Oussoren wrote (2011-05-08 10:33+0200): Steffen, I don't understand your comment about auto. Declaring variables as auto is not necessary in C code and not used anywhere else in Python's source code. Well, as long as i

[issue10811] sqlite segfault with generators

2011-05-09 Thread Roundup Robot
Roundup Robot devnull@devnull added the comment: New changeset c6523d6faef4 by Gerhard Haering in branch 'default': #10811: Fix recursive usage of cursors. Instead of crashing, raise a ProgrammingError now. http://hg.python.org/cpython/rev/c6523d6faef4 -- nosy: +python-dev

[issue11888] Add C99's log2() function to the math library

2011-05-09 Thread STINNER Victor
STINNER Victor victor.stin...@haypocalc.com added the comment: we have to wait 12 hours or maybe one day to wait for all buildbots Oh, it's faster than expected: test_math passed on FreeBSD 6.4 3.x buildbot. I was waiting for this one because it's an old OS and many tests fail on this

[issue11888] Add C99's log2() function to the math library

2011-05-09 Thread Roundup Robot
Roundup Robot devnull@devnull added the comment: New changeset 565f43f6bed4 by Victor Stinner in branch 'default': Issue #11888: Use system log2() when available http://hg.python.org/cpython/rev/565f43f6bed4 -- ___ Python tracker

[issue11888] Add C99's log2() function to the math library

2011-05-09 Thread STINNER Victor
STINNER Victor victor.stin...@haypocalc.com added the comment: Issue #11888: Use system log2() when available http://hg.python.org/cpython/rev/565f43f6bed4 I expect the system libc to use more accurate functions than Python. You know what? Mac OS X log2 is less accurate than Python log2! A

[issue11888] Add C99's log2() function to the math library

2011-05-09 Thread Mark Dickinson
Mark Dickinson dicki...@gmail.com added the comment: You know what? Mac OS X log2 is less accurate than Python log2! That doesn't surprise me much. Though it's probably still true that log2 from OS X is more accurate than our log2 for some other values. It's just that getting the answer

[issue11888] Add C99's log2() function to the math library

2011-05-09 Thread Mark Dickinson
Mark Dickinson dicki...@gmail.com added the comment: One other thought: we should check that it's not pow that's at fault here, rather than log2. The test uses math.log2(2.0**n). It would probably be better off using math.log2(ldexp(1.0, n)), or similar: the libm pow operation is also

[issue8407] expose signalfd(2) and pthread_sigmask in the signal module

2011-05-09 Thread Stefan Krah
Stefan Krah stefan-use...@bytereef.org added the comment: There are warnings on the FreeBSD and OSX buildbots, where pthread_t is not a long. http://www.python.org/dev/buildbot/all/builders/AMD64%20FreeBSD%208.2%203.x/builds/237/steps/compile/logs/warnings%20%283%29

[issue10811] sqlite segfault with generators

2011-05-09 Thread Roundup Robot
Roundup Robot devnull@devnull added the comment: New changeset 2fdabf0dc8f7 by Victor Stinner in branch 'default': Issue #10811: Use TestCase.assertRaises() in the new test http://hg.python.org/cpython/rev/2fdabf0dc8f7 -- ___ Python tracker

[issue8407] expose signalfd(2) and pthread_sigmask in the signal module

2011-05-09 Thread Roundup Robot
Roundup Robot devnull@devnull added the comment: New changeset 2e0d3092249b by Victor Stinner in branch 'default': Issue #8407: Use an explicit cast for FreeBSD http://hg.python.org/cpython/rev/2e0d3092249b -- ___ Python tracker

[issue11888] Add C99's log2() function to the math library

2011-05-09 Thread STINNER Victor
STINNER Victor victor.stin...@haypocalc.com added the comment: we should check that it's not pow that's at fault here Some tests on Mac OS X Tiger: (2.0 ** -255).hex() '0x1.0p-255' = pow is correct import ctypes; import ctypes.util, math libc =

[issue11188] test_time error on AIX

2011-05-09 Thread Roundup Robot
Roundup Robot devnull@devnull added the comment: New changeset 1f23d63b578c by Mark Dickinson in branch 'default': Issue #11188: In log2 tests, create powers of 2 using ldexp(1, n) instead of the less reliable 2.0**n. http://hg.python.org/cpython/rev/1f23d63b578c -- nosy: +python-dev

  1   2   3   >