Re: Extended slicing and Ellipsis - where are they used?

2007-09-13 Thread Robert Kern
"", line 1, in > TypeError: list indices must be integers >>>> l[...] > Traceback (most recent call last): > File "", line 1, in > TypeError: list indices must be integers > > So where is this extended slicing used? numpy for multidimensional a

Re: Is numeric keys of Python's dictionary automatically sorted?

2007-03-07 Thread Robert Kern
John wrote: > Then is there anyway to sort the numeric keys and avoid future implemetation > confusion? sorted(mydict.keys()) -- Robert Kern "I have come to believe that the whole world is an enigma, a harmless enigma that is made terrible by our own mad attempt to interpret it a

Re: pylint: don't warn about tabs

2007-03-08 Thread Robert Kern
Alan Isaac wrote: > I am brand new to pylint. > As a tab user, I want the tabs warning turned off. > How? > > Larger question: > where is the config file format documented? doc/features.txt examples/pylintrc -- Robert Kern "I have come to believe that the whole world i

Re: 2 new comment-like characters in Python to aid development?

2007-03-09 Thread Robert Marshall
On Fri, 09 Mar 2007, Bruno Desthuilliers wrote: > > Nick Craig-Wood a écrit : >> [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: >>> What if 2 new 'special' comment-like characters were added to >>> Python?: >>> >>> >>> 1. The WIP (Work In Progress) comment: >> >> I use # FIXME for this purpose o

Re: 2 new comment-like characters in Python to aid development?

2007-03-09 Thread Robert Marshall
python mode separately from emacs? I've got the latest emacs cvs (well a week old) and it doesn't have it, or is it very,very recent? Robert -- La grenouille songe..dans son château d'eau Links and things http://rmstar.blogspot.com/ -- http://mail.python.org/mailman/listinfo/python-list

Re: distributed queue?

2007-03-10 Thread Robert Kern
t > already exists. I see a little bit of discussion in the newsgroup > archive but no obvious pointers to code. Take a look at the work being done on IPython: http://ipython.scipy.org/moin/Parallel_Computing -- Robert Kern "I have come to believe that the whole world is an enigm

Re: nonlinear interpolation

2007-03-12 Thread Robert Kern
up.cru.fr/projects/scientific-py/ scipy also has a variety of curve fitting routines at the expense of a more involved install. scipy.optimize.leastsq() might be sufficient for you, but the scipy.odr package is much more flexible (but get scipy from SVN for that; the latest release has some unfortun

Re: Questions on migrating from Numeric/Scipy to Numpy

2007-03-13 Thread Robert Kern
ray([[1, 2, 3], [4, 4, 4], [4, 5, 6], [5, 5, 5], [7, 8, 9]]) The behaviour that you seem to want would be accomplished with the following: In [3]: a = zeros(5) In [4]: mask = zeros(5, dtype=bool) In [5]: mask[1] = True In [6]: mask Out[6]: array([False

Re: Questions on migrating from Numeric/Scipy to Numpy

2007-03-13 Thread Robert Kern
back. Hmm. Odd. I just tried to register and haven't gotten a confirmation email, yet, either. I'll get our sysadmin on it. -- Robert Kern "I have come to believe that the whole world is an enigma, a harmless enigma that is made terrible by our own mad attempt to interpret it as though

Re: Questions on migrating from Numeric/Scipy to Numpy

2007-03-13 Thread Robert Kern
a > array([ 100., 100.,0.,0.,0.]) > > I found this strange. It should just give an error if you try to use a > mask array of non booleans. No, it simply does something different. Boolean arrays apply as a mask. Integer arrays apply as indices into the array. -- Robert Ker

Re: Questions on migrating from Numeric/Scipy to Numpy

2007-03-14 Thread Robert Kern
ght; it is much improved), then that should be all that you need to do to get your old extension modules running with numpy. -- Robert Kern "I have come to believe that the whole world is an enigma, a harmless enigma that is made terrible by our own mad attempt to interpret it as though it ha

Re: Python eggs and openSuse 10.2 errors

2007-03-14 Thread Robert Kern
/usr/lib/ > python2.5/config/Makefile (No such file or directory) > > The /usr/lib/python2.5/config directory didnt exist, so I tried > creating it but with no change in results. You need to install the development package for python. It should be called python2.5-devel or something

Re: newb: Python Floating Point

2007-03-15 Thread Robert Kern
johnny wrote: > When I do the following, rounding to 2 decimal places doesn't seem to > work. I should get 0.99 : > >>>> a =0.99 >>>> a > 0.98999 >>>> round(a,2) > 0.98999 http://docs.python.org/tut/node16.html

Re: distributing python software in jar like fashion

2007-03-16 Thread Robert Kern
ools. Squisher is good for distributing an application with all of its dependencies in a single file; it is not a packager or installer for libraries. Eggs are good for distributing libraries and plugins and their dependencies. -- Robert Kern "I have come to believe that the whole world is a

Re: Weekly Python Patch/Bug Summary

2007-03-17 Thread Robert Kern
e code that you will > have to compile. If TortoiseSVN only copies repositories and reads and > does not update, then you need svn itself. But I know almost nothing about > it except the name. It's a fully-functional SVN client. It can update. -- Robert Kern "I have com

Building several parsing modules

2007-03-18 Thread Robert Neville
Basically, I want to create a table in html, xml, or xslt; with any number of regular expressions; a script (Perl or Python) which reads each table row (regex and replacement); and performs the replacement on any file name, folder, or text file (e.g. css, php, html). For example, I often rename my

Re: design question: generator object with other attributes

2007-03-22 Thread Robert Kern
his class will have a ``next`` method that simply > returns the value the object get by calling the wrapped > generator. You will probably also need to define def __iter__(self): return self if I remember correctly. -- Robert Kern "I have come to believe that the whole world is an

Re: How to receive a FILE* from Python under MinGW?

2007-03-22 Thread Robert Kern
I can't make your GCC tools work until the MinGW > runtime is patched? Not with that particular extension module. -- Robert Kern "I have come to believe that the whole world is an enigma, a harmless enigma that is made terrible by our own mad attempt to interpret it as though it had

Removing Python 2.4.4 on OSX

2007-03-24 Thread Robert Hicks
I want to upgrade to 2.5 but I don't see any unistall instructions anywhere. Robert -- http://mail.python.org/mailman/listinfo/python-list

Re: Removing Python 2.4.4 on OSX

2007-03-24 Thread Robert Hicks
On Mar 24, 2:09 pm, "Greg Donald" <[EMAIL PROTECTED]> wrote: > On 24 Mar 2007 10:30:28 -0700, Robert Hicks <[EMAIL PROTECTED]> wrote: > > > I want to upgrade to 2.5 but I don't see any unistall instructions > > anywhere. > > You're not requ

Re: Removing Python 2.4.4 on OSX

2007-03-24 Thread Robert Hicks
On Mar 24, 2:06 pm, "Diez B. Roggisch" <[EMAIL PROTECTED]> wrote: > Robert Hicks schrieb: > > > I want to upgrade to 2.5 but I don't see any unistall instructions > > anywhere. > > Don't do it. OSX uses the shipped version for its own purpo

Re: Removing Python 2.4.4 on OSX

2007-03-25 Thread Robert Hicks
er, Perl is already at 5.8 so what the hey! It isn't the first time I have been hit with that either. Robert -- http://mail.python.org/mailman/listinfo/python-list

Re: Removing Python 2.4.4 on OSX

2007-03-25 Thread Robert Hicks
On Mar 25, 7:08 am, "has" <[EMAIL PROTECTED]> wrote: > On 24 Mar, 18:30, "Robert Hicks" <[EMAIL PROTECTED]> wrote: > > > I want to upgrade to 2.5 but I don't see any unistall instructions > > anywhere. > > To repeat what others

Re: Fortran vs Python - Newbie Question

2007-03-26 Thread Robert Kern
t's the safest choice (but it's a HUGE download, as it comes > with a lot of stuff -- I don't think Apple offers a simple way to > install "just" gcc and minimal supporting tools). Here are some more instructions for building the usual suspects: numpy, scipy, VTK, PIL

Re: Does Numpy work on QNX 4.25 with Python 2.2?

2007-03-26 Thread Robert Kern
ly the for python > version 2.2). numpy requires Python 2.3+. I haven't heard of anyone trying QNX. -- Robert Kern "I have come to believe that the whole world is an enigma, a harmless enigma that is made terrible by our own mad attempt to interpret it as though it had an underlying trut

Re: Numeric Soup

2007-03-27 Thread Robert Kern
iPy numpy is the current array package and supercedes Numeric and numarray. scipy provides a bunch of computational routines (linear algebra, optimization, statistics, signal processing, etc.) built on top of numpy. -- Robert Kern "I have come to believe that the whole world is an enigma, a harml

Re: Numeric Soup

2007-03-27 Thread Robert Kern
Ene wrote: > As it stands Matplotlib does not > support numpy (thus my suggestion to install two of the three - my > choice: numarray + numpy) matplotlib certainly supports numpy. -- Robert Kern "I have come to believe that the whole world is an enigma, a harmless enigma that is

Re: Indentation for code readability

2007-03-30 Thread Robert Kern
ation of Python 2.5's "with" statement and its context managers. The indentation is meaningful and useful. > Some people > have a strange > idea of > "increase > readability". Please contain the snark. You didn't understand why some

Re: Finding a module's sub modules at runtime

2007-04-02 Thread Robert Kern
t what version of Python is that? > http://docs.python.org/lib/module-pkgutil.html only shows one function (and > that's 2.5) and my python 2.4 installation is similarly lacking an > iter_modules() function for the pkgutil module. Is this a 2.6 thing? No, 2.5. The documentation is

Re: Numeric compiling problem under QNX 4.25

2007-04-03 Thread Robert Kern
ut numpy. He is stuck with 2.2. -- Robert Kern "I have come to believe that the whole world is an enigma, a harmless enigma that is made terrible by our own mad attempt to interpret it as though it had an underlying truth." -- Umberto Eco -- http://mail.python.org/mailman/listinfo/python-list

Re: numpy performance and list comprehension

2007-04-03 Thread Robert Kern
p.newaxis] # VT.shape == (3, 1) W = np.array([[1,2,3], [4,5,6], [7,8,9]]) dWdt = alpha * VT*(V - W*VT) -- Robert Kern "I have come to believe that the whole world is an enigma, a harmless enigma that is made terrible by our own mad attempt to interpret it as though it had an underlying truth." -- Umberto Eco -- http://mail.python.org/mailman/listinfo/python-list

Re: Numeric compiling problem under QNX 4.25

2007-04-03 Thread Robert Kern
It looks like it can't find the command ld. Can you compile any other extension modules? -- Robert Kern "I have come to believe that the whole world is an enigma, a harmless enigma that is made terrible by our own mad attempt to interpret it as though it had an underlying truth." -- Umberto Eco -- http://mail.python.org/mailman/listinfo/python-list

Re: Numeric compiling problem under QNX 4.25

2007-04-03 Thread Robert Kern
party extension modules. Did you install Python from source? When building extension modules, Python uses whatever linker was used to build itself. -- Robert Kern "I have come to believe that the whole world is an enigma, a harmless enigma that is made terrible by our own mad attempt to interpr

Re: os.popen--which one to use?

2007-04-03 Thread Robert Kern
popen2, 3 etc. are: they seem a lot more complicated. Use the subprocess module, instead. It makes all of the popen functions more or less obsolete (it used to be called popen5 before it got moved into the standard library). -- Robert Kern "I have come to believe that the whole world is an eni

Re: Numeric compiling problem under QNX 4.25

2007-04-03 Thread Robert Kern
ZMY wrote: > On Apr 3, 10:51 am, Robert Kern <[EMAIL PROTECTED]> wrote: >> ZMY wrote: >>> Is "ld" part of make command? I am not familiar with compiling with >>> make in general. >> No, it's the linker. I takes the object files (.o) which are

Re: Calling Fortran from Python

2007-04-03 Thread Robert Kern
ing auto-logging. Current session state plus future input saved. Filename : /Users/rkern/.ipython/ipython.log Mode : backup Output logging : False Raw input log : False Timestamping : False State : active In [1]: import sample In [2]: sample.sample([1, 2, 3]) Out[2]: (0,

Re: os.popen--which one to use?

2007-04-04 Thread Robert Kern
zoo will disappear in favor of subprocess. -- Robert Kern "I have come to believe that the whole world is an enigma, a harmless enigma that is made terrible by our own mad attempt to interpret it as though it had an underlying truth." -- Umberto Eco -- http://mail.python.org/mailman/listinfo/python-list

Re: Calling Fortran from Python

2007-04-04 Thread Robert Kern
Mangabasi wrote: > Robert, > > Thanks for your prompt response. I think I got a lot closer but no > cigar yet. > > This is the output > > C:\fortrandll>f2py -c -m sample sample.pyf sample.for > numpy_info: > FOUND: > define_mac

Re: BeautifulSoup vs. real-world HTML comments

2007-04-04 Thread Robert Kern
ess to duplicate that work in the Python > standard library; let HTMLParser be small and tight, and outsource the > handling of floozy input to a dedicated program. Well, BeautifulSoup is just such a dedicated library. However, it defers its handling of comments to HTMLParser. That's th

Re: BeautifulSoup vs. real-world HTML comments

2007-04-04 Thread Robert Kern
Carl Banks wrote: > On Apr 4, 2:43 pm, Robert Kern <[EMAIL PROTECTED]> wrote: >> Carl Banks wrote: >>> On Apr 4, 2:08 pm, John Nagle <[EMAIL PROTECTED]> wrote: >>>> BeautifulSoup can't parse this page usefully at all. >>>> It treats the

Re: Calling Fortran from Python

2007-04-04 Thread Robert Kern
use gfortran. http://www.develer.com/oss/GccWinBinaries -- Robert Kern "I have come to believe that the whole world is an enigma, a harmless enigma that is made terrible by our own mad attempt to interpret it as though it had an underlying truth." -- Umberto Eco -- http://mail.pyth

Re: Numeric compiling problem under QNX 4.25

2007-04-04 Thread Robert Kern
hat you need to use Numeric because you are on Python 2.2 to hold off the inevitable, "you should really migrate to numpy," spiel. http://www.scipy.org/Mailing_Lists -- Robert Kern "I have come to believe that the whole world is an enigma, a harmless enigma that is made terribl

Re: BeautifulSoup vs. real-world HTML comments

2007-04-04 Thread Robert Kern
Carl Banks wrote: > On Apr 4, 4:55 pm, Robert Kern <[EMAIL PROTECTED]> wrote: >> Carl Banks wrote: >>> On Apr 4, 2:43 pm, Robert Kern <[EMAIL PROTECTED]> wrote: >>>> Carl Banks wrote: >>>>> On Apr 4, 2:08 pm, John Nagle <[EMAIL PROTECTED]

Re: Calling Fortran from Python

2007-04-04 Thread Robert Kern
Mangabasi wrote: > Would Python 2.5 work with Visual Studio 6.6? No. -- Robert Kern "I have come to believe that the whole world is an enigma, a harmless enigma that is made terrible by our own mad attempt to interpret it as though it had an underlying truth." -- Umberto

Re: Basic Serialization - a design decision question

2007-04-06 Thread Robert Kern
ull module devoted to it just in terms of being able to implement it. Trying to stuff all of it into a builtin is asking for trouble. Of course, you can always do this: from cPickle import dumps ... conn.send(dumps(myClass)) -- Robert Kern "I have come to believe that the whole world

Re: python, wxpython and Mac OS X

2007-04-08 Thread Robert Kern
ython 2.4. It's not that you need a newer version of wxPython; it's that you need to install one for Python 2.4 period. > Also, what wxPython download should I install? For 2.4: http://prdownloads.sourceforge.net/wxpython/wxPython2.8-osx-unicode-2.8.3.0-universal10.4-py2.4.dmg For 2.5: h

Re: python, wxpython and Mac OS X

2007-04-09 Thread Robert Kern
7stud wrote: > On Apr 8, 8:46 pm, Robert Kern <[EMAIL PROTECTED]> wrote: >> Why 2.4.4 instead of the official 2.5 binary fromwww.python.org? >> >> http://www.python.org/download/ > > 1) On some download page that listed both python 2.5 and 2.4, it said &g

Re: About Trolltech QT OpenSource license.

2007-04-11 Thread Robert Kern
m it, you don't need Trolltech's "commercial" license. Just be sure that you do obey the terms of the GPL; it's not entirely trivial to build a business model around it. Such a business will be somewhat different from one that uses proprietary licenses. -- Robert Kern

Re: About Trolltech QT OpenSource license.

2007-04-11 Thread Robert Kern
king kikapu wrote: > On Apr 11, 10:56 am, Robert Kern <[EMAIL PROTECTED]> wrote: >> Others have given good answers. I would only like to clarify what I think is >> the >> source of confusion here. While the FSF and many open source advocates make a >> distinct

Re: About Trolltech QT OpenSource license.

2007-04-11 Thread Robert Kern
Jorge Godoy wrote: > Robert Kern <[EMAIL PROTECTED]> writes: > >> I don't recommend it. You are talking to their salesman, not your lawyer. You >> are being given a sales pitch, not legal advice. > > On the other hand, he's stating Trolltech's

Re: About Trolltech QT OpenSource license.

2007-04-11 Thread Robert Kern
king kikapu wrote: > Ο/Η Robert Kern έγραψε: >> It's a bit more complicated than that. There are good resources for >> understanding the implications of the GPL on the FSF's site which other >> people >> have pointed out. > >>From what i can underst

Re: About Trolltech QT OpenSource license.

2007-04-12 Thread Robert Kern
king kikapu wrote: > On Apr 12, 1:02 am, Robert Kern <[EMAIL PROTECTED]> wrote: >> All parts of the software have to be licensed compatibly with the GPL. The >> FSF >> has a fairly comprehensive list of the licenses they believe are >> GPL-compatible. >>

Re: Portably generating infinity and NaN

2007-04-12 Thread Robert Kern
nf *= mul if inf == tmp: break tmp = inf nan = inf / inf -- Robert Kern "I have come to believe that the whole world is an enigma, a harmless enigma that is made terrible by our own mad attempt to interpret it as though it had an underlying truth." -- Umberto Eco -- http://mail.python.org/mailman/listinfo/python-list

Re: tuples, index method, Python's design

2007-04-12 Thread Robert Kern
ts a missing > method, does it not? Who has not done this? > Name yourself! I'm pretty sure I've never done this either. -- Robert Kern "I have come to believe that the whole world is an enigma, a harmless enigma that is made terrible by our own mad attempt to interpre

Re: UnicodeDecodeError when importing random? (running with -U)

2007-04-12 Thread Robert Kern
s type to replace non-text strings like those read from /dev/urandom in that piece of code. os.urandom() and the random module will have to be modified to use it instead of a string. Looking at the Python 3.0 branch, I see that this hasn't quite happened, yet. -- Robert Kern "I have come t

Re: Problem with algorithm

2007-04-13 Thread Robert Kern
Paul McGuire wrote: > If I see farther, it is because I stand on the shoulders of an > infinite number of monkeys. If I ever get around to writing a book on numerical methods/computational science/whatever, this will be the chapter quote for my chapter on Monte Carlo algorithms. -- Rober

Re: Portably generating infinity and NaN

2007-04-15 Thread Robert Kern
Paul Rubin wrote: > I doubt any Crays are still running, or at least > running any numerical code written in Python. You are wrong. > Same for VMS. Also wrong. -- Robert Kern "I have come to believe that the whole world is an enigma, a harmless enigma that is made terrible

Re: working of round()

2007-04-15 Thread Robert Kern
.6299 round(x, n) essentially does the following: math.floor(x * 10**n + 0.5) / 10**n Since (5.25/2)*100 == 262.5, adding 0.5 gives 263.0 and ultimately 2.63 as the rounded number. round() does not do anything more complicated like round-to-even. Use the decimal module if you

Re: working of round()

2007-04-15 Thread Robert Kern
Steven Bethard wrote: > I'm not sure why you would have expected 2.62 for the latter when:: > > >>> 5.25 / 2 > 2.625 Round-to-nearest-even is a valid, and oft-recommended rounding mode for numbers exactly halfway between two round numbers. -- Robert Ker

Re: The smallest and largest values of numeric types

2007-04-17 Thread Robert Kern
? Or what might replace it. It > is very useful. It used to be distributed with Numeric. http://numpy.cvs.sourceforge.net/numpy/kinds/ numpy exposes the same information for floating point types with its finfo class. Nothing particular for ints. -- Robert Kern "I have come to b

Re: Numpy problem: Arrays in a list of dictionaries

2007-04-17 Thread Robert Kern
; > So the strings can be assigned seperately but arrays can not. What is > the problem here? When you call dict.copy(), all it does is make a copy of the dictionary; each copy of the dictionary still refers to the same objects. list1[i][1] refers to the same array for all i, so when you mo

Re: scipy 0.52 det crashes python

2007-04-17 Thread Robert Kern
/Mailing_Lists -- Robert Kern "I have come to believe that the whole world is an enigma, a harmless enigma that is made terrible by our own mad attempt to interpret it as though it had an underlying truth." -- Umberto Eco -- http://mail.python.org/mailman/listinfo/python-list

Re: how to join array of integers?

2007-09-15 Thread Robert Kern
ySequence_Fast() on the argument. Looking in Objects/abstract.c, we see that PySequence_Fast() short-circuits lists and tuples but builds a full list from the iterable otherwise. map() seems to reliably be the fastest option, and list comprehensions seem to slightly edge out generator comprehension

Re: how to join array of integers?

2007-09-15 Thread Robert Kern
Grant Edwards wrote: > On 2007-09-15, Robert Kern <[EMAIL PROTECTED]> wrote: >> Grant Edwards wrote: >>> On 2007-09-15, Erik Jones <[EMAIL PROTECTED]> wrote: >>> >>>>>> print ''.join([str(i) for i in [1,2,3]]) >>>>>

Re: Pseudo-Private Class Attributes

2007-09-18 Thread Robert Kern
s right? Multiple inheritance isn't *all* that common, and haphazard multiple inheritance is even less common. Don't use __attr unless if you have a *specific* need in front of you, not just an abstract fear of rogue subclassers. -- Robert Kern "I have come to believe that the whole world

Re: distutils, extensions, and missing headers

2007-09-20 Thread Robert Kern
es floating around to do so more nicely. http://docs.python.org/dist/node12.html For other things (and hopefully, you can live with package data), use "data_files": http://docs.python.org/dist/node13.html -- Robert Kern "I have come to believe that the whole world is an enigma

Re: distutils, extensions, and missing headers

2007-09-20 Thread Robert Kern
Gary Jefferson wrote: > On Sep 20, 1:22 am, Robert Kern <[EMAIL PROTECTED]> wrote: >> Use the "headers" keyword to setup() to list the header files you want >> installed. > > I've tried "headers=['header1.h', 'header2.h']&q

validating parser

2007-09-20 Thread Robert Schweikert
Is there a Python module which will do XSD validation? Thanks, Robert -- Robert Schweikert MAY THE SOURCE BE WITH YOU ([EMAIL PROTECTED]) LINUX -- http://mail.python.org/mailman/listinfo/python-list

Re: Odd files; just left behind?

2007-09-21 Thread Robert Kern
ere's > the question of why this folder has to be obfuscated (name starts with .). > Even > if these files are "resources" why should they be assumed to belong to the > user? Because they are unpacked at runtime by the user that imported the module. Usually, they won

Re: Getting rid of bitwise operators in Python 3?

2007-09-22 Thread Robert Kern
e the "and"/"or"/"not" keywords since they can't be overloaded, but they bitwise operators fill the need fairly well. We've had logical_and()/logical_or()/logical_not() functions since forever, too, and they're a pain in the ass. -- Robert Kern "I ha

Re: Odd files; just left behind?

2007-09-22 Thread Robert Kern
Robin Becker wrote: > Robert Kern wrote: > ... >> They're a cache. > > they're actually the files that get used by the installed extension in > this case (MySQLdb). Yes. They are extracted from the zipfile at runtime and left there so they don't have

Python script to optimize XML text

2007-09-24 Thread Robert Dailey
Hi, I'm currently seeking a python script that provides a way of optimizing out useless characters in an XML document to provide the optimal size for the file. For example, assume the following XML script: By running this through an XML optimizer, the file would appear as: N

Regular Expressions: Can't quite figure this problem out

2007-09-24 Thread Robert Dailey
Hi, I'm attempting to create a regular expression that removes redundancy in empty XML elements. For example: The regular expression would convert the XML above into: And another complex example: would be: So far I've been unsuccessful in creating a regular expression to do this. Belo

Re: Regular Expressions: Can't quite figure this problem out

2007-09-24 Thread Robert Dailey
Thanks. Any easier way to do a 'replace' then using start(), end(), and slicing operations? I'm currently doing it manually. On 9/24/07, Miles <[EMAIL PROTECTED]> wrote: > > On 9/24/07, Robert Dailey <[EMAIL PROTECTED]> wrote: > > Hi, > > > >

Re: Regular Expressions: Can't quite figure this problem out

2007-09-24 Thread Robert Dailey
On 9/24/07, Gabriel Genellina <[EMAIL PROTECTED]> wrote: > > Yes: forget about regular expressions. ElementTree does that for free: > That's not an option. -- http://mail.python.org/mailman/listinfo/python-list

re: Confused about 'positive lookbehind assertion'

2007-09-24 Thread Robert Dailey
Hi, I've been reading the python documentation on 'positive lookbehind assertion' and I don't understand at all how it works. The python docs give the following example: "**(?<=abc)def will find a match in "abcdef", since the lookbehind will back up 3 characters and check if the contained pattern

Re: Regular Expressions: Can't quite figure this problem out

2007-09-24 Thread Robert Dailey
What I meant was that it's not an option because I'm trying to learn regular expressions. RE is just as built in as anything else. On 9/24/07, Steve Holden <[EMAIL PROTECTED]> wrote: > > Robert Dailey wrote: > > > > > > On 9/24/07, *Gabriel Genellin

Re: Python script to optimize XML text

2007-09-25 Thread Robert Dailey
the ideas mentioned here concerning using the XML parser to do the job for me. Thanks again everyone, I think I'll be going with the XML parser to do what I need. Have a good day everyone. On 9/25/07, Stefan Behnel <[EMAIL PROTECTED]> wrote: > > Gabriel Genellina wrote: > > En Mon, 2

Re: Confused about 'positive lookbehind assertion'

2007-09-25 Thread Robert Dailey
I think I get it... it's really just a way (so it seems) to make characters get added to the found groups as they're matched. Thanks for your help. On 9/25/07, Andrew Durdin <[EMAIL PROTECTED]> wrote: > > On 9/25/07, Robert Dailey <[EMAIL PROTECTED]> wrote: > >

Re: Regular Expressions: Can't quite figure this problem out

2007-09-25 Thread Robert Dailey
ially true with regular expressions). They're very useful, but again I believe it should be a last resort. Thanks again for your help. On 9/24/07, Gabriel Genellina <[EMAIL PROTECTED]> wrote: > > En Mon, 24 Sep 2007 23:51:57 -0300, Robert Dailey <[EMAIL PROTECTED]> > escribi�

Re: Regular Expressions: Can't quite figure this problem out

2007-09-25 Thread Robert Dailey
Fortunately I don't have any XML that complex, however you make a good point. On 9/25/07, Paul McGuire <[EMAIL PROTECTED]> wrote: > > On Sep 24, 11:23 pm, "Gabriel Genellina" <[EMAIL PROTECTED]> > wrote: > > En Mon, 24 Sep 2007 23:51:57 -0300, Rob

Invoking python through C++: How to?

2007-09-25 Thread Robert Dailey
Hi, I have a python script that I would like to invoke through my C++ application. Does anyone know of a trivial way of doing this? Right now the only idea I can come up with is using system("python myscript.py") in C++. Thanks. -- http://mail.python.org/mailman/listinfo/python-list

Re: Regular Expressions: Can't quite figure this problem out

2007-09-25 Thread Robert Dailey
One thing I noticed is that it is placing an arbitrary space between " and />. For example: Notice that there's a space between "image" and /> Any way to fix this? Thanks. On 9/24/07, Gabriel Genellina <[EMAIL PROTECTED]> wrote: > > En Mon, 24 Sep 2007

Re: Regular Expressions: Can't quite figure this problem out

2007-09-25 Thread Robert Dailey
Hmm, ElementTree.tostring() also adds a space between the last character of the element name and the />. Not sure why it is doing this. Something like will become after the tostring(). On 9/25/07, Robert Dailey <[EMAIL PROTECTED]> wrote: > > One thing I noticed is that i

Missing documentation for ElementTree?

2007-09-25 Thread Robert Dailey
Hi, for the _ElementInterface class, there is no documentation for most of the members of this class such as .tail and .text. There's a brief description of these things on the front page of the ElementTree docs but nothing helpful. I have no idea what Tail is vs Text and I wanted to figure this o

Re: Regular Expressions: Can't quite figure this problem out

2007-09-25 Thread Robert Dailey
On 9/25/07, J. Cliff Dyer <[EMAIL PROTECTED]> wrote: > > -BEGIN PGP SIGNED MESSAGE- > Hash: SHA1 > > Robert Dailey top posted: > > Hmm, ElementTree.tostring() also adds a space between the last > > character of the element name and the />

Re: Invoking python through C++: How to?

2007-09-25 Thread Robert Dailey
On 9/25/07, Gabriel Genellina <[EMAIL PROTECTED]> wrote: > > If you don't want to "share" objects between Python and C++, that's the > simplest way. > Or, look at the document "Extending and Embedding the Python Interpreter" > > > -- > Gabriel Genellina Thank

Re: Missing documentation for ElementTree?

2007-09-26 Thread Robert Dailey
. On 9/26/07, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: > > On Sep 26, 4:00 pm, "Gabriel Genellina" <[EMAIL PROTECTED]> > wrote: > > En Tue, 25 Sep 2007 19:39:33 -0300, Robert Dailey <[EMAIL PROTECTED]> > > escribi?: > > > > > for

Re: Regular Expressions: Can't quite figure this problem out

2007-09-26 Thread Robert Dailey
Even better! Now I can drop the regular expression that did the same thing :) Thanks! On 9/26/07, Fredrik Lundh <[EMAIL PROTECTED]> wrote: > > Robert Dailey wrote: > > > Hmm, ElementTree.tostring() also adds a space between the last character > > of the element name

Re: List search

2007-09-28 Thread Robert Kern
ults in the following output: > > x11 > x11-wm > x11-system > > I'm looking to return the list item that just has 'x11'. How can I > structure my search term so that this output is returned? line == 'x11' -- Robert Kern "I have come to believe

Re: [Python] Matrix convergence

2007-09-30 Thread Robert Israel
ing state i is aperiodic iff B_{ij} > 0 for all j in the class. T^j converges iff all recurrent classes are aperiodic. Thus the test can be written as follows: For each i, either there is some j for which A_{ij} > 0 but A_{ji} = 0, or there is no j for which A_{ij} > 0 but B_{ij} = 0

Re: how to install numpy and scipy on debian?

2007-10-01 Thread Robert Kern
py. They are somewhat older than the current release, but that shouldn't be too bad. If you want to build numpy and scipy yourself and you need more specific help, please join us on scipy-user with your questions. http://www.scipy.org/Mailing_Lists -- Robert Kern "I have come to bel

Re: where is pkg_resources (setuptools) looking for entry_points.txt

2007-10-01 Thread Robert Kern
mailing list for setuptools questions is the Distutils-SIG: http://mail.python.org/mailman/listinfo/distutils-sig/ -- Robert Kern "I have come to believe that the whole world is an enigma, a harmless enigma that is made terrible by our own mad attempt to interpret it as though it had an

Re: gui toolkits: the real story? (Tkinter, PyGTK, etc.)

2007-10-01 Thread Robert Kern
e to the story. Yes, compatibility is broken, strictly speaking; however, the goal is that the majority of changes can be handled automatically using the 2to3 tool to convert the source code. You can't really do that if you remove Tkinter entirely. -- Robert Kern "I have come to

Re: module confusion

2007-10-01 Thread Robert Kern
ng. OP: logging is a package and logging.handlers is one module in the package. Not all of the modules in a package are imported by importing the top-level package. os.path is a particularly weird case because it is just an alias to the platform-specific path-handling module; os is not a package. -- Rob

Re: Using fractions instead of floats

2007-10-01 Thread Robert Kern
a relatively small amount of precision necessary, and float(str(x)) == x will tend to hold. That's why it does this. > Didn't you just > say it couldn't be represented exactly? Yup. > Which is correct, > >>>> str(a) > '0.6' > > or >

Re: module confusion

2007-10-02 Thread Robert Kern
Lawrence D'Oliveiro wrote: > In message <[EMAIL PROTECTED]>, Robert > Kern wrote: > >> Not all of the modules in a package are imported by importing the >> top-level package. > > You can't import packages, only modules. > >> os.path is a pa

Re: Using fractions instead of floats

2007-10-02 Thread Robert Kern
[EMAIL PROTECTED] wrote: > On Oct 2, 1:12 am, Robert Kern <[EMAIL PROTECTED]> wrote: >> [EMAIL PROTECTED] wrote: >>> How does gmpy make the conversion from float to rational? >> gmpy has a configurable transformation between floats and the internal >> repres

Re: module confusion

2007-10-03 Thread Robert Kern
Lawrence D'Oliveiro wrote: > In message <[EMAIL PROTECTED]>, Robert > Kern wrote: > >> Lawrence D'Oliveiro wrote: >> >>> In message <[EMAIL PROTECTED]>, Robert >>> Kern wrote: >>> >>>> Not all of the modules in a

RegEx question

2007-10-04 Thread Robert Dailey
Hi, The following regex (Not including the end quotes): "@param\[in|out\] \w+ " Should match any of the following: @param[in] variable @param[out] state @param[in] foo @param[out] bar Correct? (Note the trailing whitespace in the regex as well as in the examples) -- http://mail.python.org/ma

<    20   21   22   23   24   25   26   27   28   29   >