Re: and [True,True] --> [True, True]?????

2009-04-23 Thread Lie Ryan
Gerhard Häring wrote: len() make it clear that the argument is a sequence. Not necessarily. Classes that overrides __len__ may fool that assumption (well, in python classes that overrides special functions may do anything it is never intended to do). I often think an "if item:" as "is item

Re: Presentation software for Python code

2009-04-23 Thread Michael Hoffman
alex23 wrote: How do you feel about reStructuredText? If you're open to it, I highly recommend Bruce: http://pypi.python.org/pypi/bruce That looks like it would be perfect. Unfortunately it doesn't seem to work on my Windows laptop: C:\Documents and Settings\Michael\Desktop\bruce-3.2.1>C:\

Re: and [True,True] --> [True, True]?????

2009-04-23 Thread Lie Ryan
Steven D'Aprano wrote: On Mon, 20 Apr 2009 15:13:15 -0500, Grant Edwards wrote: I fail to see the difference between "length greater than 0" and "list is not empty". They are, by definition, the same thing, aren't they? For built-in lists, but not necessarily for arbitrary list-like sequenc

Re: relation class

2009-04-23 Thread Aaron Brady
On Apr 22, 11:34 pm, Aaron Brady wrote: > On Apr 22, 11:52 am, Aaron Brady wrote: > > > On Apr 22, 12:09 am, Chris Rebert wrote: > > > > On Tue, Apr 21, 2009 at 5:51 PM, Aaron Brady wrote: > > > > Hi all, > > > > > I think Python should have a relation class in the standard library. > > > > Fat

Re: best way to compare contents of 2 lists?

2009-04-23 Thread bearophileHUGS
Esmail: > oh, I forgot to mention that each list may contain duplicates. Comparing the sorted lists is a possible O(n ln n) solution: a.sort() b.sort() a == b Another solution is to use frequency dicts, O(n): from itertools import defaultdict d1 = defaultdict(int) for el in a: d1[el] += 1 d

Re: can't find the right simplification

2009-04-23 Thread Lie Ryan
Stef Mientki wrote: hello, I've a program where you can connect snippets of code (which I call a "Brick") together to create a program. To make it easier to create these code snippets, I need some simplifications. For simple parameters ( integer, tupple, list etc) this works ok, and is done

Re: Strange problem when using imp.load_module

2009-04-23 Thread pythoncurious
Well spotted :) That does seem to be the problem. Adding removal of the .pyc file will make the tests pass. I guess that python doesn't use the higher resolution timestamp you can get from at least Solaris when doing 'stat' on a file. Thanks for the help. /Mattias On Apr 23, 10:28 pm, Arnaud

DigitalSigner in Python

2009-04-23 Thread Good Z
Hello All, I need to digitally sign a document in python. Is there any equivalent directory in Python like the DigitalSigner we have in Java. Best Regards, Mike -- http://mail.python.org/mailman/listinfo/python-list

Re: Python, MS SQL, and batch inserts

2009-04-23 Thread Lawrence D'Oliveiro
In message , Dennis Lee Bieber wrote: > On Thu, 23 Apr 2009 21:00:48 +1200, Lawrence D'Oliveiro > declaimed the following in > gmane.comp.python.general: >> >> Nothing wrong with that >> . > > Eeeek! That whole page seems to take

Re: can't find the right simplification

2009-04-23 Thread Peter Otten
Stef Mientki wrote: > I've a program where you can connect snippets of code (which I call a > "Brick") together to create a program. > To make it easier to create these code snippets, I need some > simplifications. > For simple parameters ( integer, tupple, list etc)  this works ok, > and is don

(UPDATE) Memory problems (garbage collection)

2009-04-23 Thread Carbon Man
Thanks for the replies. I got my program working but the memory problem remains. When the program finishes and I am brought back to the PythonWin the memory is still tied up until I run gc.collect(). While my choice of platform for XML processing may not be the best one (I will change it later)

Re: Unicode in writing to a file

2009-04-23 Thread Carbon Man
Thanks yes that did it. "Peter Otten" <__pete...@web.de> wrote in message news:gspmrf$qlq$0...@news.t-online.com... > Carbon Man wrote: > >> Py 2.5 >> Trying to write a string to a file. >> self.dataUpdate.write(u"\nentry."+node.tagName+ u" = " + cValue) >> cValue contains a unicode character. no

Re: Configuring pylint for local conventions

2009-04-23 Thread Ben Finney
David Stanek writes: > I find that the comments in the file it generates are enough. I > haven't needed any more documentation than that. I'll take that as a data point in support of “there is no documentation for pylint except the configuration file itself”. Thanks. -- \ “Dvorak

Re: Configuring pylint for local conventions

2009-04-23 Thread David Stanek
On Thu, Apr 23, 2009 at 10:21 PM, Ben Finney wrote: > Ben Finney writes: > >> David Stanek writes: >> >> > I believe you just: >> >   pylint --generate-rcfile > ~/.pylintrc >> > and then customize that file. >> >> This is the part that I'm asking how to do. What documentation is there >> on this

Re: Numpy Performance

2009-04-23 Thread Robert Kern
On 2009-04-23 10:32, timlash wrote: Still fairly new to Python. I wrote a program that used a class called RectangularArray as described here: class RectangularArray: def __init__(self, rows, cols, value=0): self.arr = [None]*rows self.row = [value]*cols def __getitem__(se

Re: Configuring pylint for local conventions

2009-04-23 Thread Ben Finney
Ben Finney writes: > David Stanek writes: > > > I believe you just: > > pylint --generate-rcfile > ~/.pylintrc > > and then customize that file. > > This is the part that I'm asking how to do. What documentation is there > on this configuration file and recommendations on how to modify it?

Re: ANN: PyGUI 2.0.4

2009-04-23 Thread rzed
David Robinow wrote in news:mailman.4403.1240449918.11746.python-l...@python.org: > On Wed, Apr 22, 2009 at 8:50 PM, rzed wrote: >> Greg Ewing wrote in >> news:49edb69f.7070...@canterbury.ac.nz: >> >>> PyGUI 2.0.4 is available: >>> >>>    http://www.cosc.canterbury.ac.nz/greg.ewing/python_gui/

Re: best way to compare contents of 2 lists?

2009-04-23 Thread John Yeung
Esmail wrote: > What is the best way to compare the *contents* of two different > lists regardless of their respective order? The lists will have > the same number of items, and be of the same type. "Best" can mean different things. Fastest? Shortest code? Most readable? > David Robinow wrote

Re: Configuring pylint for local conventions

2009-04-23 Thread Ben Finney
David Stanek writes: > I believe you just: > > pylint --generate-rcfile > ~/.pylintrc That's the easy part, yes. > and then customize that file. This is the part that I'm asking how to do. What documentation is there on this configuration file and recommendations on how to modify it? --

Re: best way to compare contents of 2 lists?

2009-04-23 Thread Esmail
Hans DushanthaKumar wrote: 'set' comes to mind, Yes, I thought about that, but I wasn't sure how to potentially deal with different number of duplicates in the lists. The post by David seems to address that issue nicely. though I'm not sure if there are performance inplications with large amo

Re: best way to compare contents of 2 lists?

2009-04-23 Thread MRAB
Esmail wrote: Esmail wrote: What is the best way to compare the *contents* of two different lists regardless of their respective order? The lists will have the same number of items, and be of the same type. E.g. a trivial example (my lists will be larger), a=[1, 2, 3] b=[2, 3, 1] should yiel

Re: best way to compare contents of 2 lists?

2009-04-23 Thread Esmail
David Robinow wrote: On Thu, Apr 23, 2009 at 9:31 PM, Esmail wrote: What is the best way to compare the *contents* of two different lists regardless of their respective order? The lists will have the same number of items, and be of the same type. E.g. a trivial example (my lists will be larger

Re: best way to compare contents of 2 lists?

2009-04-23 Thread Esmail
Esmail wrote: What is the best way to compare the *contents* of two different lists regardless of their respective order? The lists will have the same number of items, and be of the same type. E.g. a trivial example (my lists will be larger), a=[1, 2, 3] b=[2, 3, 1] should yield true if a==b

Re: best way to compare contents of 2 lists?

2009-04-23 Thread David Robinow
On Thu, Apr 23, 2009 at 9:31 PM, Esmail wrote: > What is the best way to compare the *contents* of two different > lists regardless of their respective order? The lists will have > the same number of items, and be of the same type. > > E.g. a trivial example (my lists will be larger), > > a=[1, 2,

RE: sorting two corresponding lists?

2009-04-23 Thread Hans DushanthaKumar
Just being pedantic here :) [items[x] for x in [i for i in map(values.index, new_values)]] Is the same as [items[x] for x in map(values.index, new_values)] -Original Message- From: python-list-bounces+hans.dushanthakumar=hcn.com...@python.org [mailto:python-list-bounces+hans.dushantha

RE: best way to compare contents of 2 lists?

2009-04-23 Thread Hans DushanthaKumar
'set' comes to mind, though I'm not sure if there are performance inplications with large amopunts of data. >>> a=[1, 2, 3] >>> b=[2, 3, 1] >>> set(a) == set(b) True Cheers, Hans -Original Message- From: python-list-bounces+hans.dushanthakumar=hcn.com...@python.org [mailto:python-list-

Re: [Python-Dev] PEP 383: Non-decodable Bytes in System Character Interfaces

2009-04-23 Thread MRAB
Martin v. Löwis wrote: MRAB wrote: Martin v. Löwis wrote: [snip] To convert non-decodable bytes, a new error handler "python-escape" is introduced, which decodes non-decodable bytes using into a private-use character U+F01xx, which is believed to not conflict with private-use characters that cu

Re: Configuring pylint for local conventions (was: pyflakes, pylint, pychecker - and other tools)

2009-04-23 Thread David Stanek
On Thu, Apr 23, 2009 at 12:00 PM, Aahz wrote: > In article <874owf4gky.fsf...@benfinney.id.au>, > Ben Finney   wrote: >>a...@pythoncraft.com (Aahz) writes: >>> >>> Second, you can configure pylint to respect your personal style >> >>How? I haven't seen any decent documentation on doing so. > > Act

best way to compare contents of 2 lists?

2009-04-23 Thread Esmail
What is the best way to compare the *contents* of two different lists regardless of their respective order? The lists will have the same number of items, and be of the same type. E.g. a trivial example (my lists will be larger), a=[1, 2, 3] b=[2, 3, 1] should yield true if a==b I suppose I co

Re: Essential tools for Python development

2009-04-23 Thread Ben Finney
Phillip B Oldham writes: > On Apr 22, 5:00 am, Ben Finney wrote: > > code each module so that the behaviour is easily introspected and > > tested from outside the module. If I'm not able to easily introspect > > the code at an interactive prompt, that's a clear sign that the code > > interface i

Re: Presentation software for Python code

2009-04-23 Thread Neal Becker
John Reid wrote: > > > Scott David Daniels wrote: >> Michael Hoffman wrote: >> You might take a look at Crunchy, and just do up your talk there. >> Crunchy is a Python program that combines an otherwise static html >> document with an interactive Python session within a browser >> http://cod

Re: [Python-Dev] PEP 383: Non-decodable Bytes in System Character Interfaces

2009-04-23 Thread James Y Knight
On Apr 22, 2009, at 2:50 AM, Martin v. Löwis wrote: I'm proposing the following PEP for inclusion into Python 3.1. Please comment. +1. Even if some people still want a low-level bytes API, it's important that the easy case be easy. That is: the majority of Python applications should *just

Re: Presentation software for Python code

2009-04-23 Thread alex23
On Apr 24, 3:52 am, Michael Hoffman <4g4trz...@sneakemail.com> wrote: > Does anyone here have software they would suggest for making a > presentation that includes Python code? Other than that it would > probably be mainly bullet points. I'm willing to consider TeX- and > HTML-based approaches. Ho

Re: can't find the right simplification

2009-04-23 Thread ma
Not sure I understand what is self.P, but look at the __getitem__ and __setitem__ overloads --Sent from my iPhone On Apr 23, 2009, at 7:10 PM, Stef Mientki wrote: hello, I've a program where you can connect snippets of code (which I call a "Brick") together to create a program. To mak

Re: Regular expression to capture model numbers

2009-04-23 Thread John Machin
On Apr 24, 1:29 am, Piet van Oostrum wrote: > > John Machin (JM) wrote: > >JM> On Apr 23, 8:01 am, krishnaposti...@gmail.com wrote: > >>> Requirements: > >>>   The text must contain a combination of numbers, alphabets and hyphen > >>> with at least two of the three elements present. > >JM> Un

Re: [False,True] and [True,True] --> [True, True]?????

2009-04-23 Thread Lawrence D'Oliveiro
In message , Steven D'Aprano wrote: > On Thu, 23 Apr 2009 13:40:47 +1200, Lawrence D'Oliveiro wrote: > >> In message <25f4735b-52a2-4d53-9097- >> e623655ca...@k19g2000prh.googlegroups.com>, bdb112 wrote: >> >>> Is there any obvious reason why >>> [False,True] and [True,True] >>> gives [True, Tr

Re: http web fetch question

2009-04-23 Thread grocery_stocker
On Apr 23, 3:29 pm, Chris Rebert wrote: > On Thu, Apr 23, 2009 at 3:21 PM, grocery_stocker wrote: > > Say I have a script that fetches data from a website every hour. Is > > there a general solution or is the solution operating system specific? > > WRT the periodic operation part of your task, th

Re: Presentation software for Python code

2009-04-23 Thread Michael Hoffman
Thanks for the suggestions. And if you do use Crunchy for a presentation, you might be interested in the html style used for Crunchy's own talk at the latest Pycon: http://us.pycon.org/media/2009/talkdata/PyCon2009/012/crunchy_.html H, I have to click on the next link every time? The best

Re: Large data arrays?

2009-04-23 Thread John Machin
On Apr 23, 8:22 pm, Ole Streicher wrote: > Hi, > > for my application, I need to use quite large data arrays > (100.000 x 4000 values) with floating point numbers where I need a fast > row-wise and column-wise access (main case: return a column with the sum > over a number of selected rows, and vi

Re: PEP 383: Non-decodable Bytes in System Character Interfaces

2009-04-23 Thread Cameron Simpson
On 24Apr2009 09:27, I wrote: | If I'm writing a general purpose UNIX tool like chmod or find, I expect | it to work reliably on _any_ UNIX pathname. It must be totally encoding | blind. If I speak to the os.* interface to open a file, I expect to hand | it bytes and have it behave. As an explicit e

Re: mailbox.mbox.add() sets access time as well as modification time

2009-04-23 Thread MRAB
tinn...@isbd.co.uk wrote: It seems to me that mailbox.mbox.add() sets the access time of a mbox file as well as the modification time. This is not good for MUAs that detect new mail by looking to see if the access time is before the modification time. Have I done something wrong somewhere or is

Re: PEP 383: Non-decodable Bytes in System Character Interfaces

2009-04-23 Thread Cameron Simpson
On 22Apr2009 08:50, Martin v. L�wis wrote: | File names, environment variables, and command line arguments are | defined as being character data in POSIX; Specific citation please? I'd like to check the specifics of this. | the C APIs however allow | passing arbitrary bytes - whether these confo

Re: Presentation software for Python code

2009-04-23 Thread André
On Apr 23, 4:16 pm, Scott David Daniels wrote: > Michael Hoffman wrote: > >... Does anyone here have software they would suggest for making a > > presentation that includes Python code? Other than that it would > > probably be mainly bullet points. I'm willing to consider TeX- and > > HTML-based a

Re: Python Packages : A looming problem? packages might no longer work? (well not on your platform or python version anyway)

2009-04-23 Thread David Lyon
On Thu, 23 Apr 2009 14:02:19 -0700, norseman wrote: > If you think I'm somehow able to take a look at a plain piece of code > you posted yesterday and know that it was written 26 years ago on a CP/M > 2.0 dual HD DS 8" floppy drive system using Microsoft Assembly for the > Z80 chip, intended as

can't find the right simplification

2009-04-23 Thread Stef Mientki
hello, I've a program where you can connect snippets of code (which I call a "Brick") together to create a program. To make it easier to create these code snippets, I need some simplifications. For simple parameters ( integer, tupple, list etc) this works ok, and is done like this: class _S

mailbox.mbox.add() sets access time as well as modification time

2009-04-23 Thread tinnews
It seems to me that mailbox.mbox.add() sets the access time of a mbox file as well as the modification time. This is not good for MUAs that detect new mail by looking to see if the access time is before the modification time. Have I done something wrong somewhere or is mailbox.mbox.add() really a

Re: http web fetch question

2009-04-23 Thread Chris Rebert
On Thu, Apr 23, 2009 at 3:21 PM, grocery_stocker wrote: > Say I have a script that fetches data from a website every hour. Is > there a general solution or is the solution operating system specific? WRT the periodic operation part of your task, there's the `sched` module -- http://docs.python.org

Re: http web fetch question

2009-04-23 Thread Jean-Paul Calderone
On Thu, 23 Apr 2009 15:21:21 -0700 (PDT), grocery_stocker wrote: Say I have a script that fetches data from a website every hour. Is there a general solution or is the solution operating system specific? General solution to what problem? Jean-Paul -- http://mail.python.org/mailman/listinfo/p

Re: http web fetch question

2009-04-23 Thread Philip Semanchuk
On Apr 23, 2009, at 6:21 PM, grocery_stocker wrote: Say I have a script that fetches data from a website every hour. Is there a general solution or is the solution operating system specific? It's not OS-specific. See the Python standard library modules urllib, urllib2, or just run a command

http web fetch question

2009-04-23 Thread grocery_stocker
Say I have a script that fetches data from a website every hour. Is there a general solution or is the solution operating system specific? -- http://mail.python.org/mailman/listinfo/python-list

Re: What is the best framework or module in Python for a small GUI based application development?

2009-04-23 Thread Peter Decker
On Wed, Apr 22, 2009 at 12:40 PM, John Fabiani wrote: > You might consider Dabo (www.dabodev.com) if access to data is required. You might also consider it if you like a simple, Pythonic UI. I don't work with databases, and I love Dabo for creating lots of utilities for interfacing with, say, te

Re: first, second, etc line of text file

2009-04-23 Thread Scott David Daniels
Gabriel Genellina wrote: En Wed, 25 Jul 2007 19:14:28 -0300, James Stroud escribió: Daniel Nogradi wrote: A very simple question: I currently use a cumbersome-looking way of getting the first, second, etc. line of a text file: to_get = [0, 3, 7, 11, 13] got = dict((i,s) for (i,s) in enumerate

Re: Why can function definitions only use identifiers, and not attribute references or any other primaries?

2009-04-23 Thread Jeremy Banks
On Apr 23, 5:23 pm, Terry Reedy wrote: > Jeremy Banks wrote: > > Hi. I'm sure there've been debates about this before, but I can't seem > > to figure out what to search for to pull them up, so I'm asking here. > > > It seems to me that a lot of things could be made much easier if you > > could use

Re: Python Packages : A looming problem? packages might no longer work? (well not on your platform or python version anyway)

2009-04-23 Thread norseman
David Stanek wrote: On Thu, Apr 23, 2009 at 1:12 PM, norseman wrote: BB's, User Lists, all repositories can make these required before acceptance. This is open source. I volunteer my time on the projects that I maintain. If you don't like the quality or lack of documentations, tests, etc. C

Re: value error

2009-04-23 Thread Terry Reedy
Francesco Pietra wrote: hi: with script data = open('134-176_rectified_edited.pdb', 'r') outp = open('134-176_renumbered.pdb', 'w') for L in data: if L[3] == 'M': L = L[:24] + "%4d" % (int(L[24-28])+133) + L[28:] outp.write(L) i wanted to modify lines of the type: ATOM 1 HH31

Re: Cython + tuple unpacking

2009-04-23 Thread Stefan Behnel
Hugues Salamin wrote: > The following code will crash with a segfault when compiled using cython > (v0.11) > > def func(): > for (a, b) ,c ,d in zip(zip(range(3), range(3)), range(3), range(3)): > print a, b > print c > print d # This line segfault > > Compilation is

Re: Strange problem when using imp.load_module

2009-04-23 Thread Arnaud Delobelle
pythoncuri...@gmail.com writes: > Hi, Hi, I have a guess at explaining the behaviour you describe - see below. > I'm having problem when I'm trying to import modules using the > imp.load_module function. > At the end of this post there's some code I wrote to illustrate the > problem. > The code

Re: Presentation software for Python code

2009-04-23 Thread John Reid
Scott David Daniels wrote: Michael Hoffman wrote: You might take a look at Crunchy, and just do up your talk there. Crunchy is a Python program that combines an otherwise static html document with an interactive Python session within a browser http://code.google.com/p/crunchy/ IPython off

Re: Why can function definitions only use identifiers, and not attribute references or any other primaries?

2009-04-23 Thread Terry Reedy
Jeremy Banks wrote: Hi. I'm sure there've been debates about this before, but I can't seem to figure out what to search for to pull them up, so I'm asking here. It seems to me that a lot of things could be made much easier if you could use primaries other than basic identifiers for the target of

Strange problem when using imp.load_module

2009-04-23 Thread pythoncurious
Hi, I'm having problem when I'm trying to import modules using the imp.load_module function. At the end of this post there's some code I wrote to illustrate the problem. The code istself doesn't make much sense, but what I'm trying to do in reality is allow people to customize an application by wr

Re: JOB: Statistical Programmer | LOCATION: London, England, UK

2009-04-23 Thread Aahz
In article , Scott David Daniels wrote: >jt wrote: >> >> JOB: Statistical Programmer ... > >Job postings are not in order here, they are off-topic. >If you go to > http://www.python.org/community/jobs/ >You will see a jobs posting board that will happily post your job. Wrong, there's no Pyt

Re: Cython + tuple unpacking

2009-04-23 Thread Aahz
In article , Hugues Salamin wrote: > >The following code will crash with a segfault when compiled using >cython (v0.11) > >def func(): >for (a, b) ,c ,d in zip(zip(range(3), range(3)), range(3), range(3)): >print a, b >print c >print d # This line segfault Does this c

Re: Cython + tuple unpacking

2009-04-23 Thread Terry Reedy
Hugues Salamin wrote: Hello, The following code will crash with a segfault when compiled using cython (v0.11) def func(): for (a, b) ,c ,d in zip(zip(range(3), range(3)), range(3), range(3)): print a, b print c print d # This line segfault Compilation is done using

Re: Using optparse

2009-04-23 Thread Aahz
In article , loial wrote: > >A shell script is passing parameters to my python script in the >following format > >-PARAM1 12345 -PARAM2 67890 > >Can I parse these with optparse ? If so how? You might try using shlex instead. -- Aahz (a...@pythoncraft.com) <*> http://www.pytho

Re: Large data arrays?

2009-04-23 Thread Aahz
In article , Ole Streicher wrote: > >for my application, I need to use quite large data arrays >(100.000 x 4000 values) with floating point numbers where I need a fast >row-wise and column-wise access (main case: return a column with the sum >over a number of selected rows, and vice versa). > >

Re: Windows Shell Extensions - Out of Proc

2009-04-23 Thread Thomas Heller
Ralf schrieb: >> I think that for whatever reasons, explorer always tries to create >> shell extensions as InProc. CoCreateInstance, which is the usual >> API to create COM instances, allows to specify which one you want. >> >> Thomas > > So there is no way to do this, other than to create a "pro

Re: OT: a metacomment on feedback comments

2009-04-23 Thread Aaron Watters
On Apr 23, 11:54 am, Johannes Bauer wrote: > To sum it up, I think it's a neat idea, but it's not really intuitive. > After being quite startled at first it got better after I read the "why > it's cool" page. Thanks for taking the time to check it out and comment, Johannes. I think you bring

Re: Windows Shell Extensions - Out of Proc

2009-04-23 Thread Ralf
> I think that for whatever reasons, explorer always tries to create > shell extensions as InProc.  CoCreateInstance, which is the usual > API to create COM instances, allows to specify which one you want. > > Thomas So there is no way to do this, other than to create a "proxy" COM object as InPr

Re: Cleaning out the cobwebs in the PEP cupboard

2009-04-23 Thread Terry Reedy
Larry Hastings wrote: There are some PEPs that seem to be stuck in a perpetual limbo, never to be decided upon. Some of them seem hopelessly antiquated now--they were proposed long ago and the language has moved on. With every passing day it becomes less likely they will ever be Accepted.

Re: Large data arrays?

2009-04-23 Thread Nick Craig-Wood
Ole Streicher wrote: > Hi Nick, > > Nick Craig-Wood writes: > > mmaps come out of your applications memory space, so out of that 3 GB > > limit. You don't need that much RAM of course but it does use up > > address space. > > Hmm. So I have no chance to use >= 2 of these arrays simultanious

Re: Presentation software for Python code

2009-04-23 Thread Scott David Daniels
Michael Hoffman wrote: ... Does anyone here have software they would suggest for making a presentation that includes Python code? Other than that it would probably be mainly bullet points. I'm willing to consider TeX- and HTML-based approaches. You might take a look at Crunchy, and just do up

Re: Presentation software for Python code

2009-04-23 Thread John Reid
Michael Hoffman wrote: Does anyone here have software they would suggest for making a presentation that includes Python code? Other than that it would probably be mainly bullet points. I'm willing to consider TeX- and HTML-based approaches. I like pygments for formatting python code. It can g

Re: Python Packages : A looming problem? packages might no longer work? (well not on your platform or python version anyway)

2009-04-23 Thread David Stanek
On Thu, Apr 23, 2009 at 1:12 PM, norseman wrote: > > BB's, User Lists, all repositories can make these required before > acceptance. > > This is open source. I volunteer my time on the projects that I maintain. If you don't like the quality or lack of documentations, tests, etc. Contribute. Or ju

Re: Windows Shell Extensions - Out of Proc

2009-04-23 Thread Thomas Heller
Ralf schrieb: > I'm trying to develop Windows Shell Extensions with the Python Win32 > Extensions. Most of the samples are working. However, I have a > slightly different need: I want the Python COM server to run as a > separate process ("LocalServer" or "OutOfProc"). > > As I understand, both the

Presentation software for Python code

2009-04-23 Thread Michael Hoffman
I mean to give a presentation next week to my workgroup on good Python programming practice. Last time I did a Python presentation I used PowerPoint which was not totally well-suited for the task. In particular, formatting code snippets was a pain, and they weren't even prettyprinted. Does an

Re: Why can function definitions only use identifiers, and not attribute references or any other primaries?

2009-04-23 Thread Scott David Daniels
Jeremy Banks wrote: (proposing def (): ... On Thu, Apr 23, 2009 at 11:52, Gary Herron wrote: Try this: def foo_bar(): return(...) foo.bar = foo_bar and this: def foo_bar(): return(...) foo["bar"] = foo_bar I understand that this is possible now, but I just don't see why it'

Re: JOB: Statistical Programmer | LOCATION: London, England, UK

2009-04-23 Thread Scott David Daniels
jt wrote: JOB: Statistical Programmer ... Job postings are not in order here, they are off-topic. If you go to http://www.python.org/community/jobs/ You will see a jobs posting board that will happily post your job. --Scott David Daniels scott.dani...@acm.org -- http://mail.python.org/mail

Windows Shell Extensions - Out of Proc

2009-04-23 Thread Ralf
I'm trying to develop Windows Shell Extensions with the Python Win32 Extensions. Most of the samples are working. However, I have a slightly different need: I want the Python COM server to run as a separate process ("LocalServer" or "OutOfProc"). As I understand, both the InProc and LocalServer ve

Re: Large data arrays?

2009-04-23 Thread Scott David Daniels
Ole Streicher wrote: Nick Craig-Wood writes: mmaps come out of your applications memory space, so out of that 3 GB limit. You don't need that much RAM of course but it does use up address space. Hmm. So I have no chance to use >= 2 of these arrays simultaniously? ... That would be a solution

Re: Python Packages : A looming problem? packages might no longer work? (well not on your platform or python version anyway)

2009-04-23 Thread norseman
: It would be nice to have access to an OS (and or machine architecture) not in possession for testing compatibility in cases where it's an issue. But then just asking usually gets it done. :) Today is: 20090423 Steve -- http://mail.python.org/mailman/listinfo/python-list

Re: Python Packages : A looming problem? packages might no longer work? (well not on your platform or python version anyway)

2009-04-23 Thread Scott David Daniels
Daniel Fetchinson wrote: I don't think every package should work on every platform and with every version of python. But I do think that many developers want to support more platforms and versions than what they have access to. Having a test farm would be beneficial to these developers and their

Re: sorting two corresponding lists?

2009-04-23 Thread Esmail
My solution, I know the 'zip' version is more elegant, this is just for fun:) >>> items = ['apple', 'car', 'town', 'phone'] >>> values = [5, 2, 7, 1] >>> new_values = sorted(values, reverse = True) >>> new_items = [items[x] for x in [i for i in map(values.index, new_values)]] >>> print

Re: Python Packages : A looming problem? packages might no longer work? (well not on your platform or python version anyway)

2009-04-23 Thread Paul Boddie
On 23 Apr, 17:46, Daniel Fetchinson wrote: > > You and I probably have a different approach to posts to c.l.p. I try > to interpret things in the best possible light and get the most out of > a suggestion. There may be merit in the suggestion, but there also has to be skepticism, even if it is re

Re: Essential tools for Python development

2009-04-23 Thread Esmail
Alex VanderWoude wrote: I really like using Winpdb (http://winpdb.org/) which provides a GUI for pdb. It allows you to single-step your code and inspect objects in memory. What exactly is in that silly nextOne variable? Hey, it's a list rather but it's supposed to be a number! You get the

Re: Essential tools for Python development

2009-04-23 Thread Esmail
Jeremiah Dodds wrote: pdb is good if you need to do step-through debugging. What I normally do in emacs is the following (while working on python script, and with the python-mode that comes with emacs22): C-x 3 #splits the screen into two vertical columns C-c C-c #fires up python and

Re: pylab quick reference? (matplotlib)

2009-04-23 Thread Esmail
Arnaud Delobelle wrote: python -c 'import pylab; help(pylab)' > pylab.txt Do you know pydoc? From the (shell) command line, try: $ pydoc pylab # piped through less $ pydoc pylab > pylab.txt # stored in a file $ pydoc -w pylab # Creates a 'pylab.html' file wrote pyl

Re: Why can function definitions only use identifiers, and not attribute references or any other primaries?

2009-04-23 Thread Marco Mariani
Jeremy Banks wrote: I've read those discussion before, but somehow never made the connection between those and this. I'll give that article a read, it probably details exactly the perspective I'm looking for. Thank you! You could also read this: http://unlimitednovelty.com/2009/03/indentation

Re: Supply a plugin interface

2009-04-23 Thread Aahz
In article <75akp8f17g29...@mid.dfncis.de>, Johannes Bauer wrote: > >the GUI application should now browse the plugin directory and read >those plugin python files and somehow incorporate (i.e. discover what >modules are there, instanciate, etc.) > >How do I do that at runtime with Python? You m

Re: Numpy Performance

2009-04-23 Thread Peter Otten
timlash wrote: > Still fairly new to Python. I wrote a program that used a class > called RectangularArray as described here: > > class RectangularArray: >def __init__(self, rows, cols, value=0): > self.arr = [None]*rows > self.row = [value]*cols >def __getitem__(self, (i, j)

Re: Why can function definitions only use identifiers, and not attribute references or any other primaries?

2009-04-23 Thread John Krukoff
On Thu, 2009-04-23 at 12:26 -0300, Jeremy Banks wrote: > > Things like your suggestion are called "syntactic-sugar" -- syntax that > > adds a convenience, but *no* new functionality. Python has plenty of > > "syntactic-sugar"s, and more will be added in the future. To make an > > argument for su

Re: Why can function definitions only use identifiers, and not attribute references or any other primaries?

2009-04-23 Thread Jeremy Banks
On Thu, Apr 23, 2009 at 13:03, John Krukoff wrote: > You probably want to be searching for multi-line lambda to find the past > decade or so of this argument, as that's where most people who argued > for this came from. But, if you'd just like a bit of discouragement, > here's GvR arguing that the

Re: Configuring pylint for local conventions (was: pyflakes, pylint, pychecker - and other tools)

2009-04-23 Thread Aahz
In article <874owf4gky.fsf...@benfinney.id.au>, Ben Finney wrote: >a...@pythoncraft.com (Aahz) writes: >> >> Second, you can configure pylint to respect your personal style > >How? I haven't seen any decent documentation on doing so. Actually, I don't know how, I'm just repeating what was claime

Re: OT: a metacomment on feedback comments

2009-04-23 Thread Johannes Bauer
Aaron Watters schrieb: > This was posted just after someone on the same > computer (somewhere in Texas) > tried and failed to inject some javascript > into the page using a comment. Script-kid moron. Delete and enjoy your life. > I don't see how this comment is helpful to > me or anyone reading

Re: Python Packages : A looming problem? packages might no longer work? (well not on your platform or python version anyway)

2009-04-23 Thread Daniel Fetchinson
>> The OP is just thinking out loud that it would be great if developers >> could count on some help for testing various platforms and versions. >> And I agree, it would indeed be great. >> > > I think you interpreted the OP differently. As I said before the idea > is not a bad one, but as a packag

Re: Python Packages : A looming problem? packages might no longer work? (well not on your platform or python version anyway)

2009-04-23 Thread Daniel Fetchinson
> Why? Why should every package on PyPI need to support all those > Python versions? That should be the decision of the package > maintainer. If they want to support every version of Python back to > 1.0, they can, and if they want to only support version 2.5 that's > fine too.

Re: Using optparse

2009-04-23 Thread Piet van Oostrum
> loial (L) wrote: >L> A shell script is passing parameters to my python script in the >L> following format >L> -PARAM1 12345 -PARAM2 67890 >L> Can I parse these with optparse ? If so how? >L> I can't seem to get it to work. It seems to expect --PARAM1 and -- >L> PARAM2 See the doc: Som

Numpy Performance

2009-04-23 Thread timlash
Still fairly new to Python. I wrote a program that used a class called RectangularArray as described here: class RectangularArray: def __init__(self, rows, cols, value=0): self.arr = [None]*rows self.row = [value]*cols def __getitem__(self, (i, j)): return (self.arr[i] or

Re: Regular expression to capture model numbers

2009-04-23 Thread Piet van Oostrum
> John Machin (JM) wrote: >JM> On Apr 23, 8:01 am, krishnaposti...@gmail.com wrote: >>> Requirements: >>>   The text must contain a combination of numbers, alphabets and hyphen >>> with at least two of the three elements present. >JM> Unfortunately(?), regular expressions can't express comp

Re: Why can function definitions only use identifiers, and not attribute references or any other primaries?

2009-04-23 Thread Jeremy Banks
> Things like your suggestion are called "syntactic-sugar"  -- syntax that > adds a convenience, but *no* new functionality.  Python has plenty of > "syntactic-sugar"s, and more will be added in the future.  To make an > argument for such an addition, one would have to describe some compelling > (a

Re: Why can function definitions only use identifiers, and not attribute references or any other primaries?

2009-04-23 Thread Gary Herron
Jeremy Banks wrote: Thanks for your comments. On Thu, Apr 23, 2009 at 11:52, Gary Herron wrote: [...] There's no need for a specific addition to the syntax to do this. Try this: def foo_bar(): return(...) foo.bar = foo_bar [...] and this: def foo_bar():

  1   2   >