ANN: Mahotas 0.5.3

2010-11-04 Thread Luis Pedro Coelho
Hi List, I'd like to announce the release of mahotas 0.5.3. Mahotas is an image processing library, which is mostly implemented in C++ for speed and complements scipy.ndimage and pymorph. Notable Algorithms -- - watershed. - thresholding. - convex points calculations. - hit

ANN: python-blosc 1.0.2

2010-11-04 Thread Francesc Alted
Announcing python-blosc 1.0.2 A Python wrapper for the Blosc compression library What is it? === Blosc (http://blosc.pytables.org) is a high performance compressor optimized for

cms 4 static pages?

2010-11-04 Thread Guido Stepken
hi folks! m looking 4 a framework, that allows to build static community software (similar to facebook) without having to start scripts, database connects, admin cookies, e.t.c. means - should be dynamic without really being dynamic, delivering just static pages. (yes, i know e.g. nginx

Re: Best method for a menu in a command line program?

2010-11-04 Thread Arnaud Delobelle
Ben Finney ben+pyt...@benfinney.id.au writes: [...] commands = { 'q': (lambda: quit()), 'c': (lambda: prompt_and_convert_temperature( [Celsius, Fahrenheit], celsius_to_fahrenheit)), 'f': (lambda: prompt_and_convert_temperature(

Re: Compare source code

2010-11-04 Thread Steven D'Aprano
On Wed, 03 Nov 2010 23:09:10 +, Seebs wrote: On 2010-11-03, Steven D'Aprano steve-remove-t...@cybersource.com.au wrote: Yes. How does that contradict what I said? Once you understand that you do have to break the rules occasionally, it is a good idea to design things that will be

Re: Compare source code

2010-11-04 Thread Steven D'Aprano
On Wed, 03 Nov 2010 23:42:55 +, Seebs wrote: No one has claimed that this is a problem *for everybody*. Just that there exist real-world workflows for which it is a problem, or people for whom it is a problem. And people have suggested that if your workflow leads to indentation being

Re: Subclassing unittest.TestCase?

2010-11-04 Thread Ulrich Eckhardt
Roy Smith wrote: I'm writing a test suite for a web application. There is a subclass of TestCase for each basic page type. [...] class CommonTestCase(unittest.TestCase): def test_copyright(self): self.assert_(find copyright notice in DOM tree) class

subprocess.Popen not replacing current process?

2010-11-04 Thread goodman
Note: Our server is a Linux machine, but we're restricted to Python 2.4. Hi, I'm wondering why subprocess.Popen does not seem to replace the current process, even when it uses os.execvp (according to the documentation: http://docs.python.org/library/subprocess.html#subprocess.Popen).

Re: Best method for a menu in a command line program?

2010-11-04 Thread brf256
Thanks for the help! Ill incorporate this into my menu. Thanks again, Braden Faulkner Sent wirelessly from my BlackBerry device on the Bell network. Envoyé sans fil par mon terminal mobile BlackBerry sur le réseau de Bell. -- http://mail.python.org/mailman/listinfo/python-list

Re: Compare source code

2010-11-04 Thread Seebs
On 2010-11-04, Steven D'Aprano steve-remove-t...@cybersource.com.au wrote: And people have suggested that if your workflow leads to indentation being mangled and your source code no longer running, the solution is to change the workflow. Yup. But it strikes me as unmistakably a shortcoming

Re: Must be a bug in the re module [was: Why this result with the re module]

2010-11-04 Thread Yingjie Lan
--- On Wed, 11/3/10, MRAB pyt...@mrabarnett.plus.com wrote: [snip] The outer group is repeated, so it can match again, but the inner group can't match again because it captured all it could the previous time. Therefore the outer group matches and captures an empty string and the inner

Is there a OrderedDict which can perform an iteritems() in order?

2010-11-04 Thread Jo Chan
Hello all, I have working on a program which need a ordered dictionary that could perform iteritems() sequentially. I found a package on : http://www.voidspace.org.uk/python/odict.html#creating-an-ordered-dictionary

Re: Is there a OrderedDict which can perform an iteritems() in order?

2010-11-04 Thread Vlastimil Brom
2010/11/4 Jo Chan csj...@gmail.com: Hello all,      I have working on a program which need a ordered dictionary that could perform iteritems() sequentially.      I found a package on : http://www.voidspace.org.uk/python/odict.html#creating-an-ordered-dictionary      but it  could only

openmp do loops

2010-11-04 Thread Pascal
Hi, I would like to parallelize this loop: do i=1,hklsize fcalctable(i)=structfact(hkltable(1,i),hkltable(2,i),hkltable(3,i)) end do I thought I would do this: !$OMP PARALLEL DO default(private) shared(hkltable, fcalctable,hklsize) do i=1,hklsize

Re: openmp do loops

2010-11-04 Thread Pascal
On 11/04/2010 11:13 AM, Pascal wrote: Hi, Oops, wrong group, sorry... Pascal -- http://mail.python.org/mailman/listinfo/python-list

Re: Best method for a menu in a command line program?

2010-11-04 Thread Michele Simionato
On Nov 4, 2:19 am, braden faulkner brf...@gmail.com wrote: I'm using a menu for my command line app using this method. choice = foobar while choice != q:     if choice == c:         temp = input(Celsius temperature:)         print Fahrenheit:,celsius_to_fahrenheit(temp)     elif choice ==

Re: openmp do loops

2010-11-04 Thread Stefan Behnel
Pascal, 04.11.2010 11:13: I would like to parallelize this loop: do i=1,hklsize fcalctable(i)=structfact(hkltable(1,i),hkltable(2,i),hkltable(3,i)) end do I thought I would do this: !$OMP PARALLEL DO default(private) shared(hkltable, fcalctable,hklsize) do i=1,hklsize

Re: What people are using to access this mailing list

2010-11-04 Thread tinnews
Tim Harig user...@ilthio.net wrote: On 2010-11-03, Grant Edwards inva...@invalid.invalid wrote: On 2010-11-03, Paul Rudin paul.nos...@rudin.co.uk wrote: John Bond li...@asd-group.com writes: On 3/11/2010 11:17 AM, Steven D'Aprano wrote: On Wed, 03 Nov 2010 08:02:29 +, John Bond

Re: Best method for a menu in a command line program?

2010-11-04 Thread Ben Finney
Arnaud Delobelle arno...@gmail.com writes: Ben Finney ben+pyt...@benfinney.id.au writes: [...] commands = { 'q': (lambda: quit()), 'c': (lambda: prompt_and_convert_temperature( [Celsius, Fahrenheit], celsius_to_fahrenheit)), 'f': (lambda:

python logging, handling multiline log entries

2010-11-04 Thread Jean-Michel Pichavant
Hi python fellows, I'm looking to do the following : import logging l = logging.getLogger('aHeader') l.handlers = [] l.addHandler(logging.StreamHandler()) l.handlers[-1].setFormatter(logging.Formatter(%(asctime)s - %(name)s - %(message)s)) l.error('1st line\n2nd line') output: 2010-11-04

Re: Best method for a menu in a command line program?

2010-11-04 Thread Ben Finney
brf...@gmail.com writes: Thanks again, Braden Faulkner Sent wirelessly from my BlackBerry device on the Bell network. Envoyé sans fil par mon terminal mobile BlackBerry sur le réseau de Bell. Please show your thanks by *not* spamming the forum with each message; compose your messages from

Re: Best method for a menu in a command line program?

2010-11-04 Thread Peter Otten
braden faulkner wrote: I'm using a menu for my command line app using this method. choice = foobar while choice != q: if choice == c: temp = input(Celsius temperature:) print Fahrenheit:,celsius_to_fahrenheit(temp) elif choice == f: temp =

Re: python logging, handling multiline log entries

2010-11-04 Thread Jean-Michel Pichavant
Jean-Michel Pichavant wrote: Hi python fellows, I'm looking to do the following : import logging l = logging.getLogger('aHeader') l.handlers = [] l.addHandler(logging.StreamHandler()) l.handlers[-1].setFormatter(logging.Formatter(%(asctime)s - %(name)s - %(message)s)) l.error('1st line\n2nd

Re: Compare source code

2010-11-04 Thread Antoon Pardon
On Wed, Nov 03, 2010 at 11:37:03AM +, Steven D'Aprano wrote: On Wed, 03 Nov 2010 12:01:06 +1300, Lawrence D'Oliveiro wrote: In message ianem3$cu...@reader1.panix.com, Grant Edwards wrote: Other languages have similar problems if you remove salient bits of syntax before comparing two

Re: Compare source code

2010-11-04 Thread Ethan Furman
Antoon Pardon wrote: Unless, your code is split over different pages, as when it is printed in a book. You also need to see the next piece of code to notice the dedention. e.g. I have the following code at the bottom of my editor. for i := 0 to 9 do some(code); more(code); end; I

Re: Compare source code

2010-11-04 Thread Grant Edwards
On 2010-11-04, Seebs usenet-nos...@seebs.net wrote: On 2010-11-04, Steven D'Aprano steve-remove-t...@cybersource.com.au wrote: And people have suggested that if your workflow leads to indentation being mangled and your source code no longer running, the solution is to change the workflow.

Re: Compare source code

2010-11-04 Thread Ethan Furman
Grant Edwards wrote: On 2010-11-04, Emile van Sebille em...@fenx.com wrote: On 11/3/2010 4:09 PM Seebs said... What's the token that marks the end of a block, corresponding to the colon used to introduce it? My thoughts tend more towards 'can we get Guido to eliminate the colon

Re: Compare source code

2010-11-04 Thread Antoon Pardon
On Fri, Nov 05, 2010 at 06:29:11AM -0700, Ethan Furman wrote: Antoon Pardon wrote: Unless, your code is split over different pages, as when it is printed in a book. You also need to see the next piece of code to notice the dedention. e.g. I have the following code at the bottom of my

Popen Question

2010-11-04 Thread moogyd
Hi, I usually use csh for my simulation control scripts, but these scripts are becoming more complex, so I plan to use python for the next project. To this end, I am looking at subprocess.Popen() to actually call the simulations, and have a very basic question which is demonstrated below.

Re: openmp do loops

2010-11-04 Thread Alain Ketterlin
Stefan Behnel stefan...@behnel.de writes: !$OMP PARALLEL DO default(private) shared(hkltable, fcalctable,hklsize) do i=1,hklsize fcalctable(i)=structfact(hkltable(1,i),hkltable(2,i),hkltable(3,i)) end do !$OMP END PARALLEL DO (This is Fortan, BTW.) Seeing this makes me seriously happy

Re: Compare source code

2010-11-04 Thread Neil Cerutti
On 2010-11-05, Ethan Furman et...@stoneleaf.us wrote: Grant Edwards wrote: On 2010-11-04, Emile van Sebille em...@fenx.com wrote: On 11/3/2010 4:09 PM Seebs said... What's the token that marks the end of a block, corresponding to the colon used to introduce it? My thoughts tend more towards

Compiling/Installing Python 2.7 on OSX 10.6

2010-11-04 Thread Jeremy
I'm having trouble installing Python 2.7 on OSX 10.6 I was able to successfully compile it from source, but ran into problems when I did make install. The error I got (I received many similar errors) was: /usr/bin/install -c -m 644 ../LICENSE /home/jlconlin/Library/

Re: Popen Question

2010-11-04 Thread Ravi
On Nov 4, 7:06 pm, moogyd moo...@yahoo.co.uk wrote: Hi, I usually use csh for my simulation control scripts, but these scripts are becoming more complex, so I plan to use python for the next project. To this end, I am looking at subprocess.Popen() to actually call the simulations, and have a

Re: cms 4 static pages?

2010-11-04 Thread Daniel Fetchinson
m looking 4 a framework, that allows to build static community software (similar to facebook) without having to start scripts, database connects, admin cookies, e.t.c. means - should be dynamic without really being dynamic, delivering just static pages. (yes, i know e.g. nginx does that by

Re: [ANN] pyOpenSSL 0.11 released

2010-11-04 Thread Giampaolo Rodolà
2010/11/1 exar...@twistedmatrix.com: Hello all, I'm happy to announce the release of pyOpenSSL 0.11.  The primary change from the last release is that Python 3.2 is now supported.  Python 2.4 through Python 2.7 are still supported as well.  This release also fixes a handful of bugs in error

execute shell script from python, needs sys.argv

2010-11-04 Thread Matt
Hi All, I am trying to execute a shell script from within python.. This shell script takes the format, where $1 and $2 are variables from the command line: cat $1 | Fastx_trimmer -n COUNT -o $2 straight into the cmd line it would be: cat file.1 | Fastx_trimmer -n COUNT -o file.2 So, know

Re: Popen Question

2010-11-04 Thread Alain Ketterlin
moogyd moo...@yahoo.co.uk writes: import os, subprocess os.environ['MYVAR'] = myval p = subprocess.Popen(['echo', '$MYVAR'],shell=True) p = subprocess.Popen(['echo', '$MYVAR']) $MYVAR p = subprocess.Popen('echo $MYVAR',shell=True) myval p = subprocess.Popen('echo $MYVAR') Traceback

Re: execute shell script from python, needs sys.argv

2010-11-04 Thread Benjamin Kaplan
On Thu, Nov 4, 2010 at 11:37 AM, Matt macma...@gmail.com wrote: Hi All, I am trying to execute a shell script from within python..  This shell script takes the format, where $1 and $2 are variables from the command line: cat $1 | Fastx_trimmer -n COUNT -o $2 straight into the cmd line it

Re: execute shell script from python, needs sys.argv

2010-11-04 Thread Peter Otten
Matt wrote: I am trying to execute a shell script from within python.. This shell script takes the format, where $1 and $2 are variables from the command line: cat $1 | Fastx_trimmer -n COUNT -o $2 straight into the cmd line it would be: cat file.1 | Fastx_trimmer -n COUNT -o file.2

Re: Allowing comments after the line continuation backslash

2010-11-04 Thread Lawrence D'Oliveiro
In message roy-df73a5.08174603112...@news.panix.com, Roy Smith wrote: http://github.com/ldo/dvd_menu_animator That URL takes me to a github page. Can you be more specific about which file I should be looking at? The extract I previously quoted was from dvd_menu_animator. 2) You have

Re: Man pages and info pages

2010-11-04 Thread Lawrence D'Oliveiro
In message 1bdce24e-4406-44c5-9133-bfd0acd02...@p1g2000yqm.googlegroups.com, rustom wrote: The printed python docs come to several thousand pages. Do we want them to be 1 manpage? a hundred? a thousand? Perl managed to condense a lot of useful information into a handful of man pages. --

Re: functions, list, default parameters

2010-11-04 Thread Lawrence D'Oliveiro
In message mailman.504.1288718704.2218.python-l...@python.org, Robert Kern wrote: On 11/2/10 2:12 AM, Lawrence D'Oliveiro wrote: In messagemailman.475.1288670833.2218.python-l...@python.org, Robert Kern wrote: Immutable objects are just those without an obvious API for modifying them.

Re: Compare source code

2010-11-04 Thread Lawrence D'Oliveiro
In message slrnid0ked.t7k.usenet-nos...@guild.seebs.net, Seebs wrote: It is extremely useful to me to have spaces converted to tabs for every other file I edit. I’m thinking of going the other way. After many years of treating tabs as four-column steps, I might give up on them and use spaces

Re: Allowing comments after the line continuation backslash

2010-11-04 Thread Lawrence D'Oliveiro
In message mailman.546.1288771350.2218.python-l...@python.org, Chris Rebert wrote: Actually, my PEP 8 reference was in regards to the (imo, terrible) UseOfCamelCaseForNonClasses (Python != C#), not the formatting of the for-loop; hence the In any case qualification. Hmm ... OK, I might

Re: Python documentation too difficult for beginners

2010-11-04 Thread Lawrence D'Oliveiro
In message mailman.580.1288818221.2218.python-l...@python.org, Cameron Simpson wrote: But its weakness is stuff like this: http://epydoc.sourceforge.net/stdlib/Canvas.Polygon-class.html Automatic docness, no useful information. But it Conforms to Documentation-Production Metrics as

Re: Compare source code

2010-11-04 Thread Lawrence D'Oliveiro
In message slrnid0pgs.1028.usenet-nos...@guild.seebs.net, Seebs wrote: The question is *why* diff has that option. The answer is because whitespace changes (spaces to tabs, different tab stops, etcetera) are an extremely common failure mode, such that it's quite common for files to end up

How find all childrens values of a nested dictionary, fast!

2010-11-04 Thread macm
Hi Folks How find all childrens values of a nested dictionary, fast! a = {'a' : {'b' :{'/' :[1,2,3,4], 'ba' :{'/' :[41,42,44]} ,'bc' :{'/':[51,52,54], 'bcd' :{'/':[68,69,66]}}},'c' :{'/' :[5,6,7,8]}}, 'ab' : {'/' :[12,13,14,15]}, 'ac' :{'/' :[21,22,23]}} a['a'] {'c': {'/': [5, 6, 7, 8]},

Re: Compare source code

2010-11-04 Thread D'Arcy J.M. Cain
On 04 Nov 2010 08:17:10 GMT Seebs usenet-nos...@seebs.net wrote: Outside of people who seem to be deeply emotionally invested in insisting that it is never, at all, in ANY way, for ANY person, annoying, it seems to be pretty consistent to observe that, benefits or no benefits, it has some kind

Final state of underlying sequence in islice

2010-11-04 Thread Shashank Singh
Hi, Apologies if this has been discussed in this list before. Google has not been very helpful in locating any such previous discussion. Are there any promises made with regard to final state of the underlying sequence that islice slices? for example consider this from itertools import * c =

Re: functions, list, default parameters

2010-11-04 Thread Robert Kern
On 11/4/10 2:07 AM, Lawrence D'Oliveiro wrote: In messagemailman.504.1288718704.2218.python-l...@python.org, Robert Kern wrote: On 11/2/10 2:12 AM, Lawrence D'Oliveiro wrote: In messagemailman.475.1288670833.2218.python-l...@python.org, Robert Kern wrote: Immutable objects are just those

Re: Compare source code

2010-11-04 Thread John Nagle
On 10/31/2010 6:52 AM, jf wrote: Le 31/10/2010 13:10, Martin v. Loewis a écrit : I've a project with tabs and spaces mixed (yes I know it's bad). I edit each file to remove tabs, but it's so easy to make a mistake. Do you know a tools to compare the initial file with the cleaned one to know if

Re: DateTime object

2010-11-04 Thread M.-A. Lemburg
jf wrote: Hi, I've a bug in my code and I'm trying de reproduce it. To trace the bug I print arguments, and it produces this: {'date': DateTime '20091020T00:00:00' at 558d128} My question is: what is: DateTime '20091020T00:00:00' at 558d128? I use mx.DateTime put if I print it I get:

sigaction?

2010-11-04 Thread Neal Becker
Why doesn't python signal support sigaction? I'm interested in trying sigaction with SA_RESTART to prevent interrupted system calls. Or, would the usage of SA_RESTART within python cause other problems? -- http://mail.python.org/mailman/listinfo/python-list

Re: Compare source code

2010-11-04 Thread Mark Wooding
Seebs usenet-nos...@seebs.net writes: Python's the only language I use where an obvious flaw, which is repeatedly observed by everyone I know who uses the language, is militantly and stridently defended by dismissing, insulting, and attacking the character and motives of anyone who suggests

Re: Compare source code

2010-11-04 Thread Mark Wooding
Tim Harig user...@ilthio.net writes: Python is the only language that I know that *needs* to specify tabs versus spaces since it is the only language I know of which uses whitespace formating as part of its syntax and structure. You need to get out more. Miranda, Gofer, Haskell, F#, make(1),

Re: Compare source code

2010-11-04 Thread Neil Cerutti
On 2010-11-04, D'Arcy J.M. Cain da...@druid.net wrote: * Not being able to write an auto-indenter, ever, because it is by design theoretically impossible: Annoying. Right. And in C you can never write an auto-bracer for exactly the same reason. It's not right, actually. Auto-indent is

Re: How find all childrens values of a nested dictionary, fast!

2010-11-04 Thread Diez B. Roggisch
macm moura.ma...@gmail.com writes: Hi Folks How find all childrens values of a nested dictionary, fast! There is no faster than O(n) here. a = {'a' : {'b' :{'/' :[1,2,3,4], 'ba' :{'/' :[41,42,44]} ,'bc' :{'/':[51,52,54], 'bcd' :{'/':[68,69,66]}}},'c' :{'/' :[5,6,7,8]}}, 'ab' : {'/'

Re: Compare source code

2010-11-04 Thread Grant Edwards
On 2010-11-04, Neil Cerutti ne...@norwich.edu wrote: On 2010-11-04, D'Arcy J.M. Cain da...@druid.net wrote: * Not being able to write an auto-indenter, ever, because it is by design theoretically impossible: Annoying. Right. And in C you can never write an auto-bracer for exactly the same

Re: How find all childrens values of a nested dictionary, fast!

2010-11-04 Thread Peter Otten
macm wrote: How find all childrens values of a nested dictionary, fast! a = {'a' : {'b' :{'/' :[1,2,3,4], 'ba' :{'/' :[41,42,44]} ,'bc' :{'/':[51,52,54], 'bcd' :{'/':[68,69,66]}}},'c' :{'/' :[5,6,7,8]}}, 'ab' : {'/' :[12,13,14,15]}, 'ac' :{'/' :[21,22,23]}} a['a'] {'c': {'/': [5, 6, 7,

Re: Compare source code

2010-11-04 Thread MRAB
On 04/11/2010 16:49, Mark Wooding wrote: Seebsusenet-nos...@seebs.net writes: Python's the only language I use where an obvious flaw, which is repeatedly observed by everyone I know who uses the language, is militantly and stridently defended by dismissing, insulting, and attacking the

Re: What people are using to access this mailing list

2010-11-04 Thread Peter Pearson
On Wed, 3 Nov 2010 08:02:29 + (UTC), John Bond li...@asd-group.com wrote: Hope this isn't too O/T - I was just wondering how people read/send to this mailing list, eg. normal email client, gmane, some other software or online service? Usenet via a server at news.individual.net, newsgroup

Re: Compare source code

2010-11-04 Thread Emile van Sebille
On 11/4/2010 7:15 AM Neil Cerutti said... The handsome ':' terminator of if/elif/if statements allows us to omit a newline, conserving vertical space. This improves the readability of certain constructs. if x: print(x) elif y: print(y) else: print() Analogously, x+=1;y=f(x);return We don't

Re: Compare source code

2010-11-04 Thread Tim Harig
On 2010-11-04, Mark Wooding m...@distorted.org.uk wrote: Tim Harig user...@ilthio.net writes: Python is the only language that I know that *needs* to specify tabs versus spaces since it is the only language I know of which uses whitespace formating as part of its syntax and structure. You

Re: Compare source code

2010-11-04 Thread Tim Harig
On 2010-11-04, Neil Cerutti ne...@norwich.edu wrote: On 2010-11-04, D'Arcy J.M. Cain da...@druid.net wrote: Seebs Wrote: * Not being able to write an auto-indenter, ever, because it is by design theoretically impossible: Annoying. Right. And in C you can never write an auto-bracer for

Re: How find all childrens values of a nested dictionary, fast!

2010-11-04 Thread macm
Hi Folks Thanks a lot Script from Diez works: print list(f(a)) but should be print list(f(a['a']['b'])) to fit my example. About Peter script I am receiving for v in f(a['a']['b']): ... b.extend(v) ... Traceback (most recent call last): File stdin, line 2, in module TypeError:

Re: Compare source code

2010-11-04 Thread Tim Harig
On 2010-11-04, MRAB pyt...@mrabarnett.plus.com wrote: On 04/11/2010 16:49, Mark Wooding wrote: Seebsusenet-nos...@seebs.net writes: * I don't have many problems with tools trashing whitespace in Python programs, though I have seen web forum software mangling indentation; since

Re: How find all childrens values of a nested dictionary, fast!

2010-11-04 Thread macm
Peter Ok! Both works fine! Thanks a lot! for v in f(a['a']['b']): ... b.extend(v) b Now I will try find which script is the fast! Regards macm On 4 nov, 15:56, macm moura.ma...@gmail.com wrote: Hi Folks Thanks a lot Script from Diez works: print list(f(a)) but should be

Re: How find all childrens values of a nested dictionary, fast!

2010-11-04 Thread Peter Otten
macm wrote: About Peter script I am receiving for v in f(a['a']['b']): ... b.extend(v) ... Traceback (most recent call last): File stdin, line 2, in module TypeError: 'int' object is not iterable I am trying understand this error. You are probably mixing Diez' implementation

Re: Allow multiline conditions and the like

2010-11-04 Thread Mark Wooding
Chris Rebert c...@rebertia.com writes: Or, if possible, refactor the conditional into a function (call) so it's no longer multiline in the first place. No! This /increases/ cognitive load for readers, because they have to deal with the indirection through the name. If you actually use the

Re: Compare source code

2010-11-04 Thread Neil Cerutti
On 2010-11-04, Grant Edwards inva...@invalid.invalid wrote: On 2010-11-04, Neil Cerutti ne...@norwich.edu wrote: On 2010-11-04, D'Arcy J.M. Cain da...@druid.net wrote: * Not being able to write an auto-indenter, ever, because it is by design theoretically impossible: Annoying. Right. And

Re: Compare source code

2010-11-04 Thread D'Arcy J.M. Cain
On Thu, 4 Nov 2010 17:55:55 + (UTC) Tim Harig user...@ilthio.net wrote: What Seebs is refering to is that it is difficult or impossible to re-indent Python source automatically after the indent structure has been broken (such as his email being converted to html on the server or a web

How convert list to nested dictionary?

2010-11-04 Thread macm
Hi Folks How convert list to nested dictionary? l ['k1', 'k2', 'k3', 'k4', 'k5'] result {'k1': {'k2': {'k3': {'k4': {'k5': {}} Regards macm -- http://mail.python.org/mailman/listinfo/python-list

Re: How convert list to nested dictionary?

2010-11-04 Thread Chris Rebert
On Thu, Nov 4, 2010 at 11:48 AM, macm moura.ma...@gmail.com wrote: Hi Folks How convert list to nested dictionary? l ['k1', 'k2', 'k3', 'k4', 'k5'] result {'k1': {'k2': {'k3': {'k4': {'k5': {}} We don't do homework. Hint: Iterate through the list in reverse order, building up your

Re: Compare source code

2010-11-04 Thread Mark Wooding
Tim Harig user...@ilthio.net writes: So, your telling me that mixing tabs and spaces is considered a good practice in Haskell? It doesn't seem to be a matter which is discussed much. I think Haskell programmers are used to worrying their brains with far more complicated things like wobbly[1]

Re: Best method for a menu in a command line program?

2010-11-04 Thread Ned Deily
In article 87wrotfhj2@benfinney.id.au, Ben Finney ben+pyt...@benfinney.id.au wrote: brf...@gmail.com writes: Thanks again, Braden Faulkner Sent wirelessly from my BlackBerry device on the Bell network. Envoyé sans fil par mon terminal mobile BlackBerry sur le réseau de Bell.

Re: Compiling/Installing Python 2.7 on OSX 10.6

2010-11-04 Thread Ned Deily
In article 3d9139ae-bd6f-4567-bb02-b21a8ba86...@o15g2000prh.googlegroups.com, Jeremy jlcon...@gmail.com wrote: I'm having trouble installing Python 2.7 on OSX 10.6 I was able to successfully compile it from source, but ran into problems when I did make install. The error I got (I received

Re: Compare source code

2010-11-04 Thread Tim Harig
On 2010-11-04, Mark Wooding m...@distorted.org.uk wrote: Tim Harig user...@ilthio.net writes: This is wishful thinking. Firstly, code written with a narrow indentation offset (e.g., two spaces) can take up an uncomfortable width when viewed with a wider offset. I can accept that as a

Re: Man pages and info pages

2010-11-04 Thread Mark Wooding
Tim Harig user...@ilthio.net writes: When the GNU folk decided to clone *nix they decided that they knew better and simply decided to create their own interfaces. This isn't the case. Actually Info has a long history prior to GNU: it was the way that the documentation was presented at the MIT

Re: Compiling/Installing Python 2.7 on OSX 10.6

2010-11-04 Thread Jeremy
On Nov 4, 1:23 pm, Ned Deily n...@acm.org wrote: In article 3d9139ae-bd6f-4567-bb02-b21a8ba86...@o15g2000prh.googlegroups.com,  Jeremy jlcon...@gmail.com wrote: I'm having trouble installing Python 2.7 on OSX 10.6  I was able to successfully compile it from source, but ran into

Re: Compare source code

2010-11-04 Thread Tim Harig
On 2010-11-04, D'Arcy J.M. Cain da...@druid.net wrote: On Thu, 4 Nov 2010 17:55:55 + (UTC) Tim Harig user...@ilthio.net wrote: What Seebs is refering to is that it is difficult or impossible to re-indent Python source automatically after the indent structure has been broken (such as his

Re: Final state of underlying sequence in islice

2010-11-04 Thread Ned Deily
In article aanlktin9fxc5wfttn=tjogk+frp14zbpbkrhqfg31...@mail.gmail.com, Shashank Singh shashank.sunny.si...@gmail.com wrote: Are there any promises made with regard to final state of the underlying sequence that islice slices? [...] While fixing this should be rather easy in terms of the

Re: Best method for a menu in a command line program?

2010-11-04 Thread Grant Edwards
On 2010-11-04, Ned Deily n...@acm.org wrote: Ben Finney ben+pyt...@benfinney.id.au wrote: brf...@gmail.com writes: Thanks again, Braden Faulkner Sent wirelessly from my BlackBerry device on the Bell network. Envoy?? sans fil par mon terminal mobile BlackBerry sur le r??seau de Bell.

Re: Python documentation too difficult for beginners

2010-11-04 Thread News123
On 11/02/2010 02:42 PM, Steven D'Aprano wrote: However, there is a Python wiki. It doesn't get anywhere near as much love as it deserves, and (I think) the consensus was that the official Python docs should stay official, but link to the wiki for user- contributed content. This hasn't

Re: Ways of accessing this mailing list?

2010-11-04 Thread Mark Wooding
John Bond li...@asd-group.com writes: Hope this isn't too O/T - I was just wondering how people read/send to this mailing list, eg. normal email client, gmane, some other software or online service? My normal inbox is getting unmanageable, and I think I need to find a new way of following

Re: Compiling/Installing Python 2.7 on OSX 10.6

2010-11-04 Thread Ned Deily
In article 238cec6d-2f47-4c97-8941-e28e68089...@a9g2000pro.googlegroups.com, Jeremy jlcon...@gmail.com wrote: [...] I downloaded the source from python.org and extracted with 'tar -xzvf Python-2.7.tgz' My home space is on some network somewhere. I think the network filesystem creates the ._

Re: Compare source code

2010-11-04 Thread D'Arcy J.M. Cain
On Thu, 4 Nov 2010 19:37:25 + (UTC) Tim Harig user...@ilthio.net wrote: On 2010-11-04, D'Arcy J.M. Cain da...@druid.net wrote: You are the one who seems to be on a crusade against against braces. It You totally misunderstand me. I am not on a crusade of any sort. I am happy with Python

Re: Best method for a menu in a command line program?

2010-11-04 Thread D'Arcy J.M. Cain
On Thu, 4 Nov 2010 19:46:28 + (UTC) Grant Edwards inva...@invalid.invalid wrote: I don't know whether it's that somebody is bragging about having a blackberry/iphone (whoop-de-friggin-do!), or that having one is somehow a valid excuse for poorly-written postings. I'm not It's really just

Re: Best method for a menu in a command line program?

2010-11-04 Thread Terry Reedy
On 11/3/2010 9:19 PM, braden faulkner wrote: I'm using a menu for my command line app using this method. choice = foobar while choice != q: if choice == c: temp = input(Celsius temperature:) print Fahrenheit:,celsius_to_fahrenheit(temp) elif choice == f:

Re: Compare source code

2010-11-04 Thread Seebs
On 2010-11-04, Mark Wooding m...@distorted.org.uk wrote: Seebs usenet-nos...@seebs.net writes: Python's the only language I use where an obvious flaw, which is repeatedly observed by everyone I know who uses the language, is militantly and stridently defended by dismissing, insulting, and

Re: Compare source code

2010-11-04 Thread Mark Wooding
Tim Harig user...@ilthio.net writes: I use simple comments that are not effected by white space. I don't waste my time trying to make comments look artistic. They are there to convey information; not to look pretty. I really detest having to edit other peoples comment formatting where you

Re: Compare source code

2010-11-04 Thread Seebs
On 2010-11-04, D'Arcy J.M. Cain da...@druid.net wrote: Right. If you mangle spaces in Python or mangle braces in C then recovery becomes impossible. I don't think anyone is contesting that. What we question is the idea that somehow Python is special in this regard. If you move files around

Re: Compare source code

2010-11-04 Thread Grant Edwards
On 2010-11-04, Seebs usenet-nos...@seebs.net wrote: On 2010-11-04, D'Arcy J.M. Cain da...@druid.net wrote: Right. If you mangle spaces in Python or mangle braces in C then recovery becomes impossible. I don't think anyone is contesting that. What we question is the idea that somehow Python

Re: Allow multiline conditions and the like

2010-11-04 Thread Chris Rebert
On Thu, Nov 4, 2010 at 11:09 AM, Mark Wooding m...@distorted.org.uk wrote: Chris Rebert c...@rebertia.com writes: Or, if possible, refactor the conditional into a function (call) so it's no longer multiline in the first place. No!  This /increases/ cognitive load for readers, because they

3rd party python module with pyd picking up wrong dlls

2010-11-04 Thread Pix
Hi, I'm trying to install OpenSSL by placing it in site-packages\OpenSSL. In the directory there the following files, crypto.pyd libeay32.dll rand.pyd SSL.pyd ssleay32.dll When i try to import the module by doing import OpenSSL i get an import error saying ImportError: DLL load failed: The

Re: Compare source code

2010-11-04 Thread Terry Reedy
On 11/4/2010 4:17 AM, Seebs wrote: I am sorry you feel compelled to use a language you so dislike. Not our fault though. Other languages I use are mostly amenable to the development of tools to automatically indent code. Makefiles and Python are the only two exceptions... If you add the

Re: Compiling/Installing Python 2.7 on OSX 10.6

2010-11-04 Thread Philip Semanchuk
On Nov 4, 2010, at 4:05 PM, Ned Deily wrote: In article 238cec6d-2f47-4c97-8941-e28e68089...@a9g2000pro.googlegroups.com, Jeremy jlcon...@gmail.com wrote: [...] I downloaded the source from python.org and extracted with 'tar -xzvf Python-2.7.tgz' My home space is on some network

Re: How convert list to nested dictionary?

2010-11-04 Thread macm
Hi Chris Thanks for your hint. I am reading this http://www.amk.ca/python/writing/functional Do you have good links or books to me learn Functional Programming? but I am not asking ...because is easy but because is hard. Show me, please! if you can. Thanks is advance. Best regards macm

Re: How find all childrens values of a nested dictionary, fast!

2010-11-04 Thread Arnaud Delobelle
macm moura.ma...@gmail.com writes: Hi Folks How find all childrens values of a nested dictionary, fast! a = {'a' : {'b' :{'/' :[1,2,3,4], 'ba' :{'/' :[41,42,44]} ,'bc' :{'/':[51,52,54], 'bcd' :{'/':[68,69,66]}}},'c' :{'/' :[5,6,7,8]}}, 'ab' : {'/' :[12,13,14,15]}, 'ac' :{'/'

Re: using google app through python

2010-11-04 Thread Steve Holden
On 11/1/2010 5:05 AM, charu gangal wrote: Hey! Can anyone help me with python script for reading google spreadsheets? what all packages do i need to import to make the code run successfully after deploying it on google environment..thnx in advance I've found the xlrd module very usable.

Re: Compare source code

2010-11-04 Thread Tim Harig
On 2010-11-04, Mark Wooding m...@distorted.org.uk wrote: Tim Harig user...@ilthio.net writes: I use simple comments that are not effected by white space. I don't waste my time trying to make comments look artistic. They are there to convey information; not to look pretty. I really detest

  1   2   3   >