Re: Splitting string into dictionary

2005-06-30 Thread Robert Kern
27;fr':'la vache brun'} > > The language code is always 2 lower case letters. > > Many thanks. Ignore the last message. translations = [x.strip(" '") for x in line.split('|')] d = dict(zip(translations[::2], translations[1::2])) -- Robert K

Re: missing cephes module

2005-07-01 Thread Robert Kern
ut some help, py2exe's dependency inference won't pick up scipy's subpackages. Please consult py2exe's documentation on how to force it to include all of scipy and not rely on the default inference. -- Robert Kern [EMAIL PROTECTED] "In the fields of hell where the grass g

Re: Programmers Contest: Fit pictures on a page

2005-07-01 Thread Robert Kern
Brian van den Broek wrote: > Well, I found it ironic, but only when you add that the genetic > algorithm approach came up in the context of a "best fit" problem. > Survival of the fittest indeed :-) Optimization codes don't always succeed. What's the irony? --

Re: map/filter/reduce/lambda opinions and background unscientific mini-survey

2005-07-01 Thread Robert Kern
one of the first 3rd party modules to come out for Python 3000 will be such a library. -- Robert Kern [EMAIL PROTECTED] "In the fields of hell where the grass grows high Are the graves of dreams allowed to die." -- Richard Harter -- http://mail.python.org/mailman/listinfo/python-list

Re: map/filter/reduce/lambda opinions and background unscientific mini-survey

2005-07-01 Thread Robert Kern
ty clear that python is leaving > its multiparadigmatic origins behind. "do it our way," the pundits are > effectively saying, "or get out". for my part, i'm getting out. If that's what you want to do, no one is going to stop you. But please do it quietly. -- Rober

Re: Bad Math

2005-07-01 Thread Robert Kern
s fishy here... whats up? > > --python 2.4.1 http://docs.python.org/tut/node16.html -- Robert Kern [EMAIL PROTECTED] "In the fields of hell where the grass grows high Are the graves of dreams allowed to die." -- Richard Harter -- http://mail.python.org/mailman/listinfo/python-list

Re: map/filter/reduce/lambda opinions and background unscientificmini-survey

2005-07-02 Thread Robert Kern
John Roth wrote: > "Robert Kern" <[EMAIL PROTECTED]> wrote in message > news:[EMAIL PROTECTED] > >>map and filter are being removed *because of* list comprehensions. Did you >>even read Guido's articles about this issue? Your understanding of why

Re: What's wrong with this code?

2005-07-02 Thread Robert Kern
Nathan Pinno wrote: > Hi all, > > What's wrong with the following code? It says there is name error, that > random is not defined. How do I fix it? You need to import random. -- Robert Kern [EMAIL PROTECTED] "In the fields of hell where the grass grows high Ar

Re: A brief question.

2005-07-02 Thread Robert Kern
Nathan Pinno wrote: > > Hi all, > > Brief question for anyone who knows the answer, because I don't. Is > there anyway to make Python calculate square roots? http://docs.python.org/ There is a search facility. -- Robert Kern [EMAIL PROTECTED] "In

Re: Will Guido's "Python Regrets" ever get implemented/fixed?

2005-07-02 Thread Robert Kern
27;println' version IIRC. > >He also had a ton of stuff he'd rather see become iterators. As currently being (re)discussed at tedious length in recent threads here, changes would will only be realized in Python 3.0 (aka Python 3000 in facetious reference to when we can e

Re: Accepted Summer of Code proposals

2005-07-03 Thread Robert Kern
the author had too little experience, or any number of other things. (Disclosure: I am now a co-mentor on an unrelated SoC project, but I wasn't part of the group rating and selecting proposals.) -- Robert Kern [EMAIL PROTECTED] "In the fields of hell where the grass grows high

Re: map/filter/reduce/lambda opinions and background unscientific mini-survey

2005-07-03 Thread Robert Kern
ks, *then* is the time to be having these discussions. Right now, all we're doing is making each other bitter and angry for no good reason. [1] Okay, there was that guy who predicted that list comprehensions and first-class functions were the next to go. That was new. But als

Re: missing cephes module

2005-07-04 Thread Robert Kern
he last time you posted this question here? -- Robert Kern [EMAIL PROTECTED] "In the fields of hell where the grass grows high Are the graves of dreams allowed to die." -- Richard Harter -- http://mail.python.org/mailman/listinfo/python-list

Re: distutils is able to handle...

2005-07-05 Thread Robert Kern
27;t think distutils can handle all these, especially the last one, > so I doubt it's the right tool in your case. I would suggest SCons > (http://www.scons.org/), a modern make/automake/autoconf replacement > that uses python for its configuration files instead of yet another > cryptic hal

Re: Using Numeric 24.0b2 with Scientific.IO.NetCDF

2005-07-05 Thread Robert Kern
bandw wrote: > Robert, > > Thanks for your reply. However, I am still having problems. Sometimes > I get a scalar return > and sometimes I get an array. For example, using the netCDF file: > > netcdf simple { >dimensions: >num = 3 ; >variables

Re: map/filter/reduce/lambda opinions and background unscientific mini-survey

2005-07-05 Thread Robert Kern
Dan Bishop wrote: > There's also the issue of having to rewrite old code. It's Python 3000. You will have to rewrite old code regardless if reduce stays. -- Robert Kern [EMAIL PROTECTED] "In the fields of hell where the grass grows high Are the graves of dre

Re: Scipy - Latex Annotations in plots

2005-07-06 Thread Robert Kern
ave this functionality in recent releases. -- Robert Kern [EMAIL PROTECTED] "In the fields of hell where the grass grows high Are the graves of dreams allowed to die." -- Richard Harter -- http://mail.python.org/mailman/listinfo/python-list

Re: Scipy - Latex Annotations in plots

2005-07-06 Thread Robert Kern
Matthias R. wrote: > Unfortunately matplotlib is only a 2D-plotting library. > > Do you know another one with 3D-capabilities as well? There's PyX. > That would be very nice, Yes, yes it would. -- Robert Kern [EMAIL PROTECTED] "In the fields of hell where the gras

Re: Compatibility of recent GCC/Python versions

2005-07-06 Thread Robert Kern
nt for these new reports. Any relevant > information would be appreciated. I've had intermittent problems on OS X and gcc-4.0 with, well, everything, Python-related or otherwise. So I ignore it and use gcc-3.3 and g77-3.4 and live happily ever after. -- Robert Kern [EMAIL PROTECTED]

Re: HELP!

2005-07-07 Thread Robert Kern
Ert Ert wrote: > Please help me i down loaded python nd itplays on MS-DOS mode and not on > normal please help So what's your problem? Please read http://www.catb.org/~esr/faqs/smart-questions.html Then reformulate your question so that we can answer it. -- Robert Kern [EMAI

Re: Favorite non-python language trick?

2005-07-07 Thread Robert Kern
or > "convenient!" are already implemented by some Pythonista(s). Spoils all the > fun for reinventing the wheel, doesn't it. :) Doesn't seem to stop most Pythonistas from trying, though. :-) -- Robert Kern [EMAIL PROTECTED] "In the fields of hell where the grass grows h

Re: Python Module Exposure

2005-07-07 Thread Robert Kern
uss your module. Formal announcements once you, e.g. put it on SF should go to c.l.py.announce . -- Robert Kern [EMAIL PROTECTED] "In the fields of hell where the grass grows high Are the graves of dreams allowed to die." -- Richard Harter -- http://mail.python.org/mailman/listinfo/python-list

Re: Lisp development with macros faster than Python development?..

2005-07-07 Thread Robert Kern
of > said the same thing about *their* language a couple of years ago. I wish > web pages, like newgroup posts, were dated so one could better trace the > history of such usages. Trawling through http://web.archive.org might help. -- Robert Kern [EMAIL PROTECTED] "In

Re: Is there an easy way to get at the value of DBL_MAX from Python?

2005-07-07 Thread Robert Kern
e Numeric distribution and no one has made a real release since. However, it is still available in CVS. http://cvs.sourceforge.net/viewcvs.py/numpy/kinds/ -- Robert Kern [EMAIL PROTECTED] "In the fields of hell where the grass grows high Are the graves of dreams allowed to die." -- Richard Harter -- http://mail.python.org/mailman/listinfo/python-list

Re: ImportError: No module named numarray

2005-07-09 Thread Robert Kern
level- > from nltk.probability import ConditionalFreqDist > File "C:\Python24\Lib\site-packages\nltk\probability.py", line 56, in > -toplevel- > import types, math, numarray > ImportError: No module named numarray Install numarray. http://www.stsci.edu/resources/s

RE: Yet Another Python Web Programming Question

2005-07-09 Thread Robert Brewer
l a great option for you with Apache: http://www.cherrypy.org/wiki/WSGIServers http://www.cherrypy.org/wiki/BehindApache Robert Brewer System Architect Amor Ministries [EMAIL PROTECTED] -- http://mail.python.org/mailman/listinfo/python-list

RE: Yet Another Python Web Programming Question

2005-07-10 Thread Robert Brewer
Paul Boddie wrote: > "Robert Brewer" <[EMAIL PROTECTED]> wrote in message > news:<[EMAIL PROTECTED]>... > > Daniel Bickett wrote: > > > I neglected to mention an important fact, and that is the > > > fact that I am limited to Apache,

Re: computer algebra packages

2005-07-10 Thread Robert Kern
h based on PyGTK, the other based on wxPython. > > I was not successful googling for this one. Would you have an URL handy? Note the deliberate spelling, and cut-and-paste. http://home.arcor.de/mulk/projects/mascyma/index.xhtml.de -- Robert Kern [EMAIL PROTECTED] "In the fields of hel

Re: ZipFile and file rigths

2005-07-10 Thread Robert Kern
(ie : stuffit ): >-rwxr-xr-x foo.exe > ZipInfo objects doesn't store informations about rights ? > (http://www.python.org/doc/current/lib/zipinfo-objects.html#zipinfo-objects) > > How can i fix this ? This is possibly related, I'm not sure: http://article.

Re: ZipFile and file rigths

2005-07-10 Thread Robert Kern
perchef wrote: [Sybren Stuvel:] >>ZIP doesn't store file permissions. Yes, the .zip file format does store file permissions appropriate to the platform that generates the file. > ok, but in that case how could stuffit retrieve these permissions ? > > Thanks for the li

Re: computer algebra packages

2005-07-10 Thread Robert Kern
Bengt Richter wrote: > Then googling for mascsyma [sic ;-)] got I doubt it. ;-) -- Robert Kern [EMAIL PROTECTED] "In the fields of hell where the grass grows high Are the graves of dreams allowed to die." -- Richard Harter -- http://mail.python.org/mailman/listinfo/python-list

Re: What is Expresiveness in a Computer Language?

2005-07-10 Thread Robert Gamble
| jgs (__Y__) > > /\/\/\/\/\/\/\/\//\/\\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\ > > == > > Out of curiosity, does anyone remember who 'jgs' refers to > above? Joan "Spunk" Stark, the author of quite a bit of ascii art, consult google for examples. Robert Gamble -- http://mail.python.org/mailman/listinfo/python-list

Re: ImportError: No module named numarray

2005-07-11 Thread Robert Kern
umarray > > can you please tell me the cause I already did. You need to install numarray. http://www.stsci.edu/resources/software_hardware/numarray -- Robert Kern [EMAIL PROTECTED] "In the fields of hell where the grass grows high Are the graves of dreams allowed to die." -- Richard Harter -- http://mail.python.org/mailman/listinfo/python-list

Re: How does this code works:

2005-07-11 Thread Robert Kern
> the LGB rule. I thought that s is not accessible from bar, but it is, > apparently. Why? Python now has nested scopes. http://www.python.org/peps/pep-0227.html -- Robert Kern [EMAIL PROTECTED] "In the fields of hell where the grass grows high Are the graves of dreams allowed to die

Re: tuple.index(item)

2005-07-11 Thread Robert Kern
(Debian 1:3.3.6-6)] on linux2 > Type "help", "copyright", "credits" or "license" for more information. > >>> > >>> t = ('a', 'b', 'c') > >>> t[1] > 'b' > >>>

Re: Puzzled

2005-07-11 Thread Robert Kern
7;or'] str.capitalize() changes the first character to be uppercase and all later characters to be lower case. It does not leave the later characters alone. In [1]: str.capitalize? Type: method_descriptor Base Class: String Form: Namespace: Python builtin Docstring:

Re: Managment of Python Libraries

2005-07-12 Thread Robert Kern
t; As I embark on the wonderful language of Python, or there any object > organizational tools that may help me to keep order? There's Bicycle Repair Man: http://bicyclerepair.sourceforge.net/ -- Robert Kern [EMAIL PROTECTED] "In the fields of hell where the grass grows high Are t

Re: Trying to come to grips with static methods

2005-07-12 Thread Robert Kern
nstance which isn't actually needed. It could also be a classmethod, but since it doesn't actually need any information from the class to do its work, I find that the extra reminder of staticmethod helps my brain understand what it's doing. All told, I'd probably vote -0.5 on a

Re: Trying to come to grips with static methods

2005-07-12 Thread Robert Kern
n [3]: class NewPoint(Point): ...: pass ...: In [4]: def parseXML(xmlText): ...: return 1, 4 ...: In [5]: p = NewPoint.fromXML('') In [6]: isinstance(p, NewPoint) Out[6]: True -- Robert Kern [EMAIL PROTECTED] "In the fields of hell where the grass grows h

Re: Web App like Google

2005-07-12 Thread Robert Kern
approach. For example: http://www.jfsowa.com/clce/specs.htm http://www.ics.mq.edu.au/~rolfs/controlled-natural-languages/ http://www.ifi.unizh.ch/attempto/ -- Robert Kern [EMAIL PROTECTED] "In the fields of hell where the grass grows high Are the graves of dreams allowed to die." -- Richard Harter -- http://mail.python.org/mailman/listinfo/python-list

Re: Creating anonymous functions using eval

2005-07-12 Thread Robert Kern
threaded form, so you need to provide some context for them to be able to follow along. -- Robert Kern [EMAIL PROTECTED] "In the fields of hell where the grass grows high Are the graves of dreams allowed to die." -- Richard Harter -- http://mail.python.org/mailman/listinfo/python-list

Re: python parser

2005-07-12 Thread Robert Kern
lt to do so again. Of course, if you just need *a* Verilog parser, not necessarily one written by you, you could just email the guy who wrote it and ask him for a copy. Grep http://pyparsing.sourceforge.net/ for "Verilog". -- Robert Kern [EMAIL PROTECTED] "In the fields

Re: Creating anonymous functions using eval

2005-07-12 Thread Robert Kern
Joseph Garvin wrote: > Robert Kern wrote: > >>Not everyone is reading this list in a conveniently threaded >>form > > Why not? Just about every modern newsgroup reader and e-mail app has a > threaded view option. Good point. Allow me to modify my statement: not

Re: plot module

2005-07-12 Thread Robert Kern
hem may even be called "plot". Which one are you talking about? -- Robert Kern [EMAIL PROTECTED] "In the fields of hell where the grass grows high Are the graves of dreams allowed to die." -- Richard Harter -- http://mail.python.org/mailman/listinfo/python-list

Re: Software needed

2005-07-13 Thread Alexis ROBERT
Where I could find the TWAIN python interface ? I'm quite interested :)12 Jul 2005 08:44:49 -0700, Peter Herndon <[EMAIL PROTECTED]>: "Document Management Software" is a little vague.  What do you want itto do?  In general though, when someone says "content management" and "Python", the general res

Re: Software needed

2005-07-13 Thread Alexis ROBERT
Thank you2005/7/13, Richie Hindle <[EMAIL PROTECTED]>: [Fuzzy]> There's a Python interface to TWAIN (the scanner protocol)[Alexis]> Where I could find the TWAIN python interface ?Try typing "python twain" into Google.  The first hit is:   http://twainmodule.sourceforge.net/  "The Python TWAIN modul

Re: Building a function call?

2005-07-13 Thread Robert Kern
s a good place to use eval. > > aString = "dothat" > atuple = (x, y) > > If aString is the name of a function in the current module: > >globals()[aString](*aTuple) > > If aString is a function in another module: > >import otherModule >v

Re: Splitting on a word

2005-07-13 Thread Robert Kern
7;). > > I am asking if there is some alternative (more pythonic...): For *this* particular task, certainly. It begins with import BeautifulSoup The rest is left as a (brief) exercise for the reader. :-) As for the more general task of splitting strings using regular expressions, see r

Re: Documenting extension modules?

2005-07-15 Thread Robert Kern
> Also, I'd like to know if there's a typical format for the help string > (but in C), compatible with docstring's > """short desription > > long description""" char *o_count__doc__; char *o_count__doc__ = "short description\n"

Re: Question about basic use of a timer object from timeit module to execute code every so often in a class

2005-07-15 Thread Robert Kern
documentation for timeit. It doesn't do what you think it does. Look at wxTimer instead. -- Robert Kern [EMAIL PROTECTED] "In the fields of hell where the grass grows high Are the graves of dreams allowed to die." -- Richard Harter -- http://mail.python.org/mailman/listinfo/python-list

RE: ANN: CherryPy-2.1.0-beta released

2005-07-15 Thread Robert Brewer
nfiguration entries are specifiable per-path, so different portions of your site can use different encoding schemes. Robert Brewer System Architect Amor Ministries [EMAIL PROTECTED] -- http://mail.python.org/mailman/listinfo/python-list

Re: Tuples in function argument lists

2005-07-17 Thread Robert Kern
Tuple-as-arg is probably pretty safe. Tuple-as-keyword, possibly not-so-much. > Does anyone use this behaviour, and if so, under what circumstances is it > useful? import math def distance((x1,y1), (x2,y2)): return math.sqrt((x2-x1)**2 + (y2-y1)**2) distance(point1, point2) Per

Re: beginner question fibonacci

2005-07-17 Thread Robert Kern
t is created first, with the old values of a and b. Then a and b are reassigned. The value of a doesn't change until *after* a+b is calculated. -- Robert Kern [EMAIL PROTECTED] "In the fields of hell where the grass grows high Are the graves of dreams allowed to die." -- Richard Harter -- http://mail.python.org/mailman/listinfo/python-list

Re: ConfigParser : overwrite ?

2005-07-17 Thread Robert Kern
!cat foo.ini [section1] foodir: %(dir)s/whatever dir: foo In [2]: fn = 'foo.ini' In [3]: import ConfigParser In [4]: cfg = ConfigParser.ConfigParser() In [5]: cfg.read(fn) Out[5]: ['foo.ini'] In [6]: cfg.set('section1', 'dir', 'anotherdir') In [7]:

Re: Filtering out non-readable characters

2005-07-18 Thread Robert Kern
sary. Allowing generator expressions to forgo extra parentheses where they aren't required is something different, and in my opinion, a good thing. -- Robert Kern [EMAIL PROTECTED] "In the fields of hell where the grass grows high Are the graves of dreams allowed to die." -- Richard Harter -- http://mail.python.org/mailman/listinfo/python-list

Re: goto

2005-07-19 Thread Robert Kern
scribe it. I've settled on "Lovecraftian": reading the code, you can't help but get the impression of writhing tentacles and impossible angles. -- Robert Kern [EMAIL PROTECTED] "In the fields of hell where the grass grows high Are the graves of dreams allowed to die

Re: OO design

2005-07-19 Thread Robert Kern
o bad designs; we just fix them later. In short slogans: Just Do It. Make It Work, Then Make It Right. Refactor Mercilessly. Do the Simplest Thing That Could Possibly Work. -- Robert Kern [EMAIL PROTECTED] "In the fields of hell where the grass grows high Are the graves of dreams allowed to die." -- Richard Harter -- http://mail.python.org/mailman/listinfo/python-list

Re: What does "::" mean?

2005-07-19 Thread Robert Kern
-- > "[::-1]" can reverse a string magicly, how did it do it? The full form would be live[len(live)-1:-1:-1] much like range(len(live)-1, -1, -1). [start:stop:step] step can be negative. -- Robert Kern [EMAIL PROTECTED] "In

Re: What does "::" mean?

2005-07-20 Thread Robert Kern
[EMAIL PROTECTED] wrote: > Hi Robert, > I didn't succeed in reversing a string with the "full form" you > proposed: > live[len(live)-1:-1:-1] # where live="live" > The result is an empty string. > To reverse "live" (in a "full

Re: convert ascii escapes into binary form

2005-07-20 Thread Robert Kern
really need to do a search n'replace orgy, combined with > regex for this task? In [11]: s = '\\f' In [12]: s.decode('string_escape') Out[12]: '\x0c' -- Robert Kern [EMAIL PROTECTED] "In the fields of hell where the grass grows high Are the gra

Re: What does "::" mean?

2005-07-20 Thread Robert Kern
t; print live[ sys.maxint : -sys.maxint : -1 ] > print live[ -1 : -len(live)-1 : -1 ] > > Of course there is only one obvious way to do it, but alas > as I'm not Dutch I can't tell which it is. Well, that part's easy at least: live[::-1] :-) And so the circle

Re: Newbie question about lists

2005-07-20 Thread Robert Kern
t; Can anyone tell me why it does this, and how I can get just the value > .10, and .05 into a list? Thanks. http://docs.python.org/tut/node16.html -- Robert Kern [EMAIL PROTECTED] "In the fields of hell where the grass grows high Are the graves of dreams allowed to die." --

Re: How to use octave in python

2005-07-20 Thread Robert Kern
ric.scipy.org http://www.scipy.org -- Robert Kern [EMAIL PROTECTED] "In the fields of hell where the grass grows high Are the graves of dreams allowed to die." -- Richard Harter -- http://mail.python.org/mailman/listinfo/python-list

Re: interactive python session spool/save-log command?

2005-07-20 Thread Robert Kern
t; that point on in a python interactive session to be > saved/spooled/forked/logged into a text file of the user's choice. IPython is an interactive interpreter that will log all input to a file. http://ipython.scipy.org/ -- Robert Kern [EMAIL PROTECTED] "In the fields of hell where the gr

Re: Newbie question about lists

2005-07-20 Thread Robert Kern
.25, $.10, $.05, $.01] > > That would even fit in with decimals being used for financial quantities. Various versions of the (several) Decimal PEPs had a decimal literal syntax, usually along the lines of 0.25d. Google through the python-dev archives. -- Robert Kern [EMAIL PROTECTED] "

Re: What does "::" mean?

2005-07-21 Thread Robert Kern
Michael Hoffman wrote: > Robert Kern wrote: >>Well, that part's easy at least: >> >> live[::-1] >> >>:-) And so the circle is complete ... > > What about reversed(live)? Or if you want a list instead of an iterator, > list(reversed(live))? Th

Re: Difference between " and '

2005-07-21 Thread Robert Kern
racter only). I find that I switch between the two pretty freely. One habit that seems to crop up, though, is that I will use '' for internal strings and "" for strings that will eventually get seen by the user. Don't ask me why. -- Robert Kern [EMAIL PROTECTED] "In the fields of hell where the grass grows high Are the graves of dreams allowed to die." -- Richard Harter -- http://mail.python.org/mailman/listinfo/python-list

Re: Difference between " and '

2005-07-21 Thread Robert Kern
ord("'") - ord('"') >>>5 >> >>Very zen. > > But unfortunately incorrect, since the original poster > didn't ask for the difference between the ordinal > values of the single quote and double quote characters, > but for the differ

Re: Python on a public library computer

2005-07-22 Thread Robert Kern
a public computer without one installed? -- Robert Kern [EMAIL PROTECTED] "In the fields of hell where the grass grows high Are the graves of dreams allowed to die." -- Richard Harter -- http://mail.python.org/mailman/listinfo/python-list

Re: tuple to string?

2005-07-22 Thread Robert Kern
Francois De Serres wrote: > hiho, > > what's the clean way to translate the tuple (0x73, 0x70, 0x61, 0x6D) to > the string 'spam'? In [1]: t = (0x73, 0x70, 0x61, 0x6D) In [2]: ''.join(chr(x) for x in t) Out[2]: 'spam' -- Robert Kern [EMAIL PRO

Re: is this possible?

2005-07-22 Thread Robert Kern
printing of > reports when they are available. Does anyone know how this is done > using reportlab? thanks! It isn't done using ReportLab. Follow Terry Hancock's advice. -- Robert Kern [EMAIL PROTECTED] "In the fields of hell where the grass grows high Are the graves of drea

Re: sys.path - stuff from nowhere?

2005-07-22 Thread Robert Kern
python23.zip. Python can import from zip files, now, so yes, it does make sense. http://www.python.org/peps/pep-0273.html -- Robert Kern [EMAIL PROTECTED] "In the fields of hell where the grass grows high Are the graves of dreams allowed to die." -- Richard Harter -- http://m

Re: tuple to string?

2005-07-23 Thread Robert Kern
rtainly have never committed to memory its position in a precedence hierarchy of *any* language. -- Robert Kern [EMAIL PROTECTED] "In the fields of hell where the grass grows high Are the graves of dreams allowed to die." -- Richard Harter -- http://mail.python.org/mailman/listinfo/python-list

Re: [path-PEP] Path inherits from basestring again

2005-07-23 Thread Robert Kern
t;license" for more information. >>> d = open('/usr/bin') Traceback (most recent call last): File "", line 1, in ? IOError: [Errno 21] Is a directory >>> -- Robert Kern [EMAIL PROTECTED] "In the fields of hell where the grass grows high Are

Re: consistency: extending arrays vs. multiplication ?

2005-07-23 Thread Robert Kern
If you want an array, use Numeric/numarray. If you want lists, use lists. Lists will never grow the kind of behavior you're asking for. -- Robert Kern [EMAIL PROTECTED] "In the fields of hell where the grass grows high Are the graves of dreams allowed to die." -- Richard Harter -- http://mail.python.org/mailman/listinfo/python-list

Re: tuple to string?

2005-07-24 Thread Robert Kern
Francois De Serres wrote: > I'll pick ('%c' * len(t)) % t, for it's readability and the fact that > join() is on the deprec'd list. ''.join() is certainly not deprecated. What made you think that? -- Robert Kern [EMAIL PROTECTED] "In the field

Re: tuple to string?

2005-07-24 Thread Robert Kern
John Machin wrote: > No precedence rules -> no relevance to the topic Precedence rules of other languages -> no relevance to the topic -- Robert Kern [EMAIL PROTECTED] "In the fields of hell where the grass grows high Are the graves of dreams allowed to die." -- Richa

Re: consistency: extending arrays vs. multiplication ?

2005-07-24 Thread Robert Kern
ayout in memory. That doesn't imply either set of semantics for + and * operators. > and *arrays ? They're good at different things. Arrays like Numeric/numarray are harder to implement than the builtin lists. > *I* would rather drop > '+' and '*' to work li

Re: Simple Problem

2005-07-24 Thread Robert Kern
ape") Out[2]: 'foo\\n\\xfe' In [3]: repr(s)[1:-1] Out[3]: 'foo\\n\\xfe' -- Robert Kern [EMAIL PROTECTED] "In the fields of hell where the grass grows high Are the graves of dreams allowed to die." -- Richard Harter -- http://mail.python.org/mailman/listinfo/python-list

Re: Fire event when variable is Set/Get

2005-07-24 Thread Robert Kern
een set or when it's being fetched to allow > me to fire an event there?. There's Enthought's Traits. http://code.enthought.com/traits/traits.htm I don't think it handles the Get part, though. You could probably come up with something using __getattribute__ for that part.

Re: Problem loading a file of words

2005-07-24 Thread Robert Kern
pass a word that creates a valid key, I'll > have to add exceptions later). The problem is when using a large > dictionary.txt file (2.9 MB is the size of the dictionary I tested) it > always gives an error, specifically: > (Note: ccehimnostyz is for zymotechnics, which is in the large > dictionary) Well, my version works (using /usr/share/dict/words from Debian as dictionary.txt). Yours does, too. Are you sure that you are using the right dictionary.txt? -- Robert Kern [EMAIL PROTECTED] "In the fields of hell where the grass grows high Are the graves of dreams allowed to die." -- Richard Harter -- http://mail.python.org/mailman/listinfo/python-list

Re: Problem loading a file of words

2005-07-24 Thread Robert Kern
close() > dictionary = dict((sort_string(line),line) for line in lines) That's definitely not the kind of dictionary that he wants. -- Robert Kern [EMAIL PROTECTED] "In the fields of hell where the grass grows high Are the graves of dreams allowed to die." -- Richard Harter -- http://mail.python.org/mailman/listinfo/python-list

Re: PyGTK or wxPython (not a flame war) on Windows

2005-07-24 Thread Robert Kern
Torsten Bronger wrote: > As far as i know, there is nothing official. But I've read several > times that it's the most likely candidate for a seconds GUI system > for being included. I think you're reading *way* too much into people engaging in wishful thinking.

Re: Suggestions for Python XML library which can search and insert

2005-07-25 Thread Robert Kern
om lxml import etree In [26]: nbk = etree.parse('tut-2.3.5-db.nbk') In [27]: log = root.xpath('//[EMAIL PROTECTED]"default-log"]')[0] In [28]: etree.SubElement(log, 'cell') Out[28]: -- Robert Kern [EMAIL PROTECTED] "In the fields of hell whe

Re: SciPy and NetCDF

2005-07-26 Thread Robert Kern
option). Scipy requires Numeric, too. -- Robert Kern [EMAIL PROTECTED] "In the fields of hell where the grass grows high Are the graves of dreams allowed to die." -- Richard Harter -- http://mail.python.org/mailman/listinfo/python-list

Re: need some info on MySQL module.

2005-07-26 Thread Robert Kern
> of my stuff i even bought Programming Python by O'Reilly, out of over > 1200 pages, and it only has a page or two dedicated to it. Considering that MySQLdb is a third-party library, that's to be expected. -- Robert Kern [EMAIL PROTECTED] "In the fields of hell where the g

Re: A Module on Time & Date

2005-07-26 Thread Robert Kern
Robert Maas, see http://tinyurl.com/uh3t wrote: >>From: Robert Kern <[EMAIL PROTECTED]> >>As you can see in the datetime documentation, the module was introduced >>in Python 2.3. I recommend updating your Python installation. > > What do you mean "your"??

Re: Why Tcl/Tk?

2005-07-27 Thread Robert Kern
Although I did notice > that the Vpython IDE that uses Tkinker starts up a lot > faster than the DrPython IDE that uses wxpython. But > that makes no sense, Tk is based on Tcl, a scripting > language, but wx is written in C++. Scripting language != slow. C++ != fast. -- Robert Kern [E

Re: searching string url

2005-07-27 Thread Robert Kern
me > so I want to search the file for "../../company/" and then get the 13 > charecters after it so that I can work it as a URL, if you see what I > mean? You want to use BeautifulSoup. http://www.crummy.com/software/BeautifulSoup/ -- Robert Kern [EMAIL PROTECTED] "

Re: SciPy and NetCDF

2005-07-27 Thread Robert Kern
Numeric like pycdf does. -- Robert Kern [EMAIL PROTECTED] "In the fields of hell where the grass grows high Are the graves of dreams allowed to die." -- Richard Harter -- http://mail.python.org/mailman/listinfo/python-list

Re: SciPy and NetCDF

2005-07-27 Thread Robert Kern
Scott Kilpatrick wrote: > Oh ok, so if my sysadmin installs SciPy, then to get the netCDF support > we need he just needs to then install pycdf? 1. Install Numeric. 2. Install Scipy. 3. Install pycdf. Numeric is not, yet, bundled into Scipy. -- Robert Kern [EMAIL PROTECTED] "In th

Re: how to get function signature

2005-07-27 Thread Robert Kern
m/2005/07/mdir-for-python.html. I have > seen PythonWin showing function arguments as tooltips, can anyone > please let me know how to get it. import inspect -- Robert Kern [EMAIL PROTECTED] "In the fields of hell where the grass grows high Are the graves of dreams allowed

Re: functions without parentheses

2005-07-28 Thread Robert Kern
amine "string" > instead of examine("string")? No. -- Robert Kern [EMAIL PROTECTED] "In the fields of hell where the grass grows high Are the graves of dreams allowed to die." -- Richard Harter -- http://mail.python.org/mailman/listinfo/python-list

Re: all possible combinations

2005-07-28 Thread Robert Kern
nt criterion for inclusion into the standard library was, "Guido uses it." He needed to parse AIFF files and various arcane image formats and do graphics using the old SGI GL (the precursor to OpenGL). That's why some of that stuff is there. That said, I really would like a nic

Re: On fighting fire with fire...

2005-07-28 Thread Robert Kern
Asad Habib wrote: > I agree with Mustafa. After all, we are a bunch of professionals and not > vagabonds hired to take pot shots at one another. Speak for yourself. ;-) -- Robert Kern [EMAIL PROTECTED] "In the fields of hell where the grass grows high Are the graves of dreams all

Re: Ten Essential Development Practices

2005-07-28 Thread Robert Kern
the > general points made might be of interest to the Python community. It > would certainly be interesting to put together an analogous version of > this article that centers on Python. import this And you get 9 bonus Essential Development Practices, too! What a bargain! -- Robert Kern [E

Re: On fighting fire with fire...

2005-07-28 Thread Robert Kern
ke. I was calling *myself* a "vagabond." I even had a smiley! And the .sig quote has nothing to do with anything. > Life is more than a quote - > look outside your academic cocoon and you will realize what I mean. Thank G-d my irony meter is under warranty. -- Robert Kern [EMAIL P

Re: Ten Essential Development Practices

2005-07-28 Thread Robert Kern
espaces. It's a very elegant way to handle a broad class of language features very consistently. That said, I made a boo-boo. The Zen of Python is really a set of design principles (and some of them, like this one, are more specifically *language* design principles), not Essential Devel

Re: c/c++ extensions and help()

2005-07-28 Thread Robert Kern
n of myCFunc > > Is this currently possible? There really isn't a way to let the inspect module know about extension function arguments. Just put it in the docstring. -- Robert Kern [EMAIL PROTECTED] "In the fields of hell where the grass grows high Are the graves of dre

Re: Ten Essential Development Practices

2005-07-28 Thread Robert Kern
Dan Sommers wrote: > On Thu, 28 Jul 2005 15:35:54 -0700, > Robert Kern <[EMAIL PROTECTED]> wrote: > >>That said, I made a boo-boo. The Zen of Python is really a set of >>design principles (and some of them, like this one, are more >>specifically *language*

<    5   6   7   8   9   10   11   12   13   14   >