OK, I'll play...
> > Productive in?
C, C++, Pascal (inc OP/Delphi/Kylix), Python,
PL/Sql, 80x86 assembler
> > Familiar enough to at least produce code in?
awk, perl, Java, ksh, Lisp, Logo, VBScript, Javascript, Tcl,
DOS batch, SDL
> You forgot an important category here. Can debug, if
Alex Martelli wrote:
> class Meta_for_NR(type):
> def __init__(cls, cn, cb, cd):
> super(Meta_for_NR, cls).__init__(cn, cb, cd)
> abstract_methods = []
> for n, v in inspect.getmembers(cls, inspect.ismethod):
> if v is notimplemented: abstract_methods.append
With the following situation, Numarray can't find Python's symbols.
problematic-Python::
Main dlopens Two
Two dynlinks Python
Python dlopens Numarray
Numarray dynlinks Python
I have another pure-C example that tries to mirror this, with::
minimal-C::
Main dlopen Two
Two dynlink Middl
chris,
> I'm creating an excel document dynamically from scratch using Python
> and the win32com module. All is well, but now I need to add a macro to
> the spreadsheet and run it (to enable some sorting features in the
> spreadsheet).
I recommend to create the excel document not from scratch
Sorry, I forgot to put information about my platform.
Debian unstable on linux kernel 2.4.20, Debian's package of Python2.3.
gcc version 3.3.3
libc version 2.3.2
libc.so.6 output follows:::
[EMAIL PROTECTED] ~% /lib/libc.so.6
GNU C Library stable release version 2.3.2, by Roland McGrath et al.
HI.
I want to compute dot product of two vectors stored as lists a and b.a
and b are of the same length.
one simple way is
sum(a[i]*b[i] for i in range(len(a)))
another simple way is
ans=0.0
for i in range(len(a)):
ans=ans+a[i]*b[i]
But is there any other way which is faster than any of the abov
John Machin wrote:
6. Alex's magnum opus appears to operate on problem a, and maybe on b
(it's over my head). It involves a fair chunk of mucking about -- for
what? Early warning, a few microseconds ahead of the invocation of a
method which will cause the stub in the base class to raise an
exceptio
If i understand correctly what you're after I think another option is
import sys
sys.path.append('http://mail.python.org/mailman/listinfo/python-list
Rahul wrote:
I want to compute dot product of two vectors stored as lists a and b.a
and b are of the same length.
one simple way is
sum(a[i]*b[i] for i in range(len(a)))
btw, imho the most "Pythonic" would be:
sum(i*j for (i,j) in zip(a,b))
--
http://mail.python.org/mailman/listinfo/python-list
Rahul wrote:
HI.
I want to compute dot product of two vectors stored as lists a and b.a
and b are of the same length.
one simple way is
sum(a[i]*b[i] for i in range(len(a)))
another simple way is
ans=0.0
for i in range(len(a)):
ans=ans+a[i]*b[i]
But is there any other way which is faster than any o
Rahul wrote:
> I want to compute dot product of two vectors stored as lists a and b.a
> and b are of the same length.
>
> one simple way is
> sum(a[i]*b[i] for i in range(len(a)))
>
> another simple way is
> ans=0.0
> for i in range(len(a)):
> ans=ans+a[i]*b[i]
>
> But is there any other way wh
I am new to python; any insight on the following would be appreciated, even
if it is the admonition to RTFM (as long as you can direct me to a relevant
FM)
Is there a standard approach to enumerated types? I could create a
dictionary with a linear set of keys, but isn't this overkill? There is
Hello David,
> Is there a standard approach to enumerated types? I could create a
> dictionary with a linear set of keys, but isn't this overkill? There is
> afterall a "True" and "False" enumeration for Boolean.
Google for Python + enum.
(A good one is: http://www.norvig.com/python-iaq.html)
Martijn Faassen wrote:
Imagine, for instance, what if he wants to egosurf, google for his own
name and finds nothing because everybody was saying Djikstra all the
time? That'd be terrible!
Fortunately, not in our time stream :
Dijkstra - 892 000 hits
Djikstra - 5 500 hits
"Edsger Dijkstra" - 25
Alex Martelli wrote:
Raymond L. Buvel <[EMAIL PROTECTED]> wrote:
Mike Meyer wrote:
PEP: XXX
Title: A rational number module for Python
I think it is a good idea to have rationals as part of the standard
distribution but why not base this on the gmpy module
(https://sourceforge.net/projects/gmpy
Raymond L. Buvel wrote:
>> gmpy wraps GMP, which is covered by LGPL; therefore, gmpy itself is
>> LGPL, and thus, sadly, cannot be included with python (otherwise,
>> speaking as gmpy's author, I'd be glad to fix its design to meet your
>> objections).
> Since the LGPL was designed to allow propr
David Wurmfeld wrote:
I am new to python; any insight on the following would be appreciated, even
if it is the admonition to RTFM (as long as you can direct me to a relevant
FM)
Your questions are esoteric enough that, even though the relevant information
*is* in the FM, RTFM would be a really s
Chris wrote:
what ever is the last loop through doesn't seem to update the
database?
Try a conn.commit() after your loop.
--
Benji York
--
http://mail.python.org/mailman/listinfo/python-list
Thanks for the hint. But I did not try such *advance* techniques so
far.
Both Delete-then-insert and Insert-then-delete work for me.
Interestingly, I found Delete-then-insert can cause some flicking when
replacing items near bottom, while Insert-then-delete always works
fine.
Zhang Le
--
http://
Python Thread Validator.
A thread analysis, lock analysis and deadlock detection tool for Python.
Tool is now in beta.
http://www.softwareverify.com/pythonThreadValidator/index.html
Stephen
--
Stephen Kellett
Object Media Limitedhttp://www.objmedia.demon.co.uk
RSI Information:http://www
David Wurmfeld wrote:
> I am new to python; any insight on the following would be
appreciated, even
> if it is the admonition to RTFM (as long as you can direct me to a
relevant
> FM)
http://www.python.org/doc/
> Is there a standard approach to enumerated types? I could create a
> dictionary with
Is anyone aware of a python nurbs module?
So far I found Runar Tenfjord's effort, which is quite interesting:
http://runten.tripod.com/NURBS/
But in the end doesn't really meet my needs.
Any suggestions?
Cheers,
Jelle.
--
http://mail.python.org/mailman/listinfo/python-list
Jelle Feringa // EZCT / Paris wrote:
Is anyone aware of a python nurbs module?
So far I found Runar Tenfjord's effort, which is quite interesting:
http://runten.tripod.com/NURBS/
But in the end doesn't really meet my needs.
Any suggestions?
Yes: _describe_ your needs; don't just hint at how
someth
John Machin <[EMAIL PROTECTED]> wrote:
...
> 6. Alex's magnum opus appears to operate on problem a, and maybe on b
> (it's over my head). It involves a fair chunk of mucking about -- for
A dozen lines of code to write *ONCE* and put in your utilities module
is a "magnum opus" and "a fair chunk
I'm a newbie.
I have some problems with bits data reading. I have binary data file
where data is written as 12bits pack. I need to read it becouse there
are saved values which have to processed later by my program. I was
wandering about reading 3bytes=24bits and split it by bits moving. If
any
Jelle Feringa // EZCT / Paris wrote:
Is anyone aware of a python nurbs module?
So far I found Runar Tenfjord's effort, which is quite interesting:
http://runten.tripod.com/NURBS/
But in the end doesn't really meet my needs.
Any suggestions?
Hint to get a useful answer: Define your needs. Displa
[EMAIL PROTECTED] (Jim Hill) writes:
> I've done some Googling around on this and it seems like creating a here
> document is a bit tricky with Python. Trivial via triple-quoted strings
> if there's no need for variable interpolation but requiring a long, long
> formatted arglist via (%s,%s,%s,ad
In article <[EMAIL PROTECTED]>,
Adam DePrince <[EMAIL PROTECTED]> wrote:
>
>I'd like to ask everybody a simple question. How many computer
>languages are you completely and utterly fluent in? The reason I ask is
>I'd like for everyone who has participated in this discussion to
>introspect and as
> Hint to get a useful answer: Define your needs. Display in 3D (want to
> use them to define and display geometry)? Numeric analysis (writing
> some sort of CAD or automation system)? Modeling system (want some way
> to interactively define them)?
I wish I could give you a well defined answer
Jerry Sievers wrote:
> It gets uglier though if you want to do this from inside a function
> and have variables from more than one scope interpolated. For that
> you need something that can treat a series of dicts as one.If there's
> built in functionality in Python for this, I haven't discovered
> It works as if you had written:
>
> for _i in xrange(len(myList)):
> x = myList(_i)
No, as this implies that the variable has to support random access using
indices. But all that's required is the iterable-interface beeing supported
- by calling __iter__ and .next() on the resulting object.
--
Michal Szpadzik wrote:
> I have some problems with bits data reading. I have binary data file where
> data is written as
> 12bits pack. I need to read it becouse there are saved values which have to
> processed later by my
> program. I was wandering about reading 3bytes=24bits and split it by
Alex Martelli:
>> what? Early warning, a few microseconds ahead of the invocation of a
>> method which will cause the stub in the base class to raise an
>> exception?
>
> Exactly. Microseconds don't count, but stack levels do -- getting the
> traceback end as close as possible to the real CAUSE o
On Sun, 19 Dec 2004 17:13:30 +0100, Fredrik Lundh <[EMAIL PROTECTED]> wrote:
>Alex Martelli:
>
> >> what? Early warning, a few microseconds ahead of the invocation of a
> >> method which will cause the stub in the base class to raise an
> >> exception?
> >
> > Exactly. Microseconds don't count,
Jelle Feringa // EZCT / Paris wrote:
Hint to get a useful answer: Define your needs. Display in 3D (want to
use them to define and display geometry)? Numeric analysis (writing
some sort of CAD or automation system)? Modeling system (want some way
to interactively define them)?
I wish I could gi
Diez B. Roggisch wrote:
> However I've encountered one peculiarity that strikes me odd:
>
> When one writes a decorated function like this:
>
> @decorate
> def foo():
>pass
>
> the function decorate usually looks like this:
>
> def decorate(func):
>def _d(*args, **kwargs):
>do_some
Jp Calderone wrote:
> If the line immediately before "someobj.bar()" is "someobj = FooType()",
> this will surely be easy. If someobj is instantiated further away, then
> more digging is required.
well, I guess I was assuming that you're debugging your own code, and that
you don't generally wri
> Have you looked at Blender (http://www.blender3d.com)??
Blender seems very promising, its python support is exactly what I'm
looking for, but it lacks the cad/parametric capabilities I'm looking for.
--
http://mail.python.org/mailman/listinfo/python-list
Fredrik Lundh <[EMAIL PROTECTED]> wrote:
> Alex Martelli:
>
> >> what? Early warning, a few microseconds ahead of the invocation of a
> >> method which will cause the stub in the base class to raise an
> >> exception?
> >
> > Exactly. Microseconds don't count, but stack levels do -- getting the
Jim Hill <[EMAIL PROTECTED]> wrote:
> I've done some Googling around on this and it seems like creating a here
> document is a bit tricky with Python. Trivial via triple-quoted strings
> if there's no need for variable interpolation but requiring a long, long
> formatted arglist via (%s,%s,%s,
Yes, this is exactly what I wanted--just like in perl I can add search
path to @inc.
thanks
--
http://mail.python.org/mailman/listinfo/python-list
Hello, Aahz,
Aahz wrote:
myself to have "complete and utter" fluency. In fact, in some ways my
fluency has degenerated now that I'm focusing on writing code for
production.
I'm curious about that last statement. Are you saying that if you write,
full time, code for "production", that fluency will
"Sean McIlroy" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> There's something quite simple I'd like to do, but I'm hampered by
> lack of knowledge regarding Tkinter. If someone could help me out with
> a snippet of maximally-simple code showing, in general terms, how to
> do this,
Alex Martelli wrote:
>> Traceback (most recent call last):
>> File "mymodule.py", line 9, in somefunction
>> someobj.bar()
>> ... zero or more lines ...
>> File "somelibrary.py", line 3, in bar
>> raise NotImplementedError("must implement abstract method bar")
>
Jim Hill wrote:
I've done some Googling around on this and it seems like creating a here
document is a bit tricky with Python. Trivial via triple-quoted strings
if there's no need for variable interpolation but requiring a long, long
formatted arglist via (%s,%s,%s,ad infinitum) if there is. So m
Noam Raphael wrote:
Hello,
I thought about a new Python feature. Please tell me what you think
about it.
Say you want to write a base class with some unimplemented methods, that
subclasses must implement (or maybe even just declare an interface, with
no methods implemented). Right now, you don'
Rahul wrote:
I want to compute dot product of two vectors stored as lists a and b.a
and b are of the same length.
. >>> import numarray as na
. >>> a, b = na.arange(5), na.arange(5, 10)
. >>> na.dot(a, b)
. 80
Steve
--
http://mail.python.org/mailman/listinfo/python-list
Fredrik Lundh wrote:
Jerry Sievers wrote:
It gets uglier though if you want to do this from inside a function
and have variables from more than one scope interpolated. For that
you need something that can treat a series of dicts as one.If there's
built in functionality in Python for this, I haven
Steve Holden wrote:
>> here's a rather horrid piece of code that turns a list of dictionaries
>> into a single object [that] automatically searches the dictionary chain
>> when you ask for attributes (use getattr for non-standard keys).
>>
>> def flatten_dicts(*dicts):
>> root = None
>> fo
Noam Raphael <[EMAIL PROTECTED]> writes:
> What I suggest is a new class, called notimplemented (you may suggest
> a better name). It would get a function in its constructor, and would
> just save a reference to it. The trick is that when a new type (a
> subclass of the default type object) is cre
Steven Bethard wrote:
> Charlie Taylor wrote:
>>I have tried using named functions instead of using lambda functions,
>>however, I always end up with a convoluted, hard to follow mess.
> ...
> Well, I think the jury could still be out on which version is more
> readable, but I don't understand the
Noam Raphael wrote:
even in the best solution that I know of,
there's now way to check if a subclass has implemented all the
required methods without running it and testing if it works.
I think there are some solutions like PyProtocols, see section 2.2 on
this page: http://www.python.org/cgi-b
... From: Doug ...
(I think you could create some kind of drinking game based on the number of
non-quoted lines between the "From"-line and the first line containing the word
"boo" in Doug's posts on comp.lang.python. A little like the game based on the
number of minutes between someone mentionin
Scott Robinson <[EMAIL PROTECTED]> writes:
> On Fri, 17 Dec 2004 20:41:11 -0600, Mike Meyer <[EMAIL PROTECTED]> wrote:
>
>>Scott Robinson <[EMAIL PROTECTED]> writes:
>>
>>> Forth seems better than basic, but is *weird* (I tried it for a
>>> while). I'm not sure going from Forth to C (or Python) w
Walter S. Leipold wrote:
> I think that Charlie's point is that, when you use "def ", you have
> polluting your namespace. The whole program becomes harder to
> understand because you can't ignore anywhere, even if it was only
> ever intended to be used in one place.
Ahem. If you name the fun
Dennis Lee Bieber <[EMAIL PROTECTED]> writes:
> After all, AREXX was the "VBA" of the Amiga... My first real
> Python program worked with an AREXX script to handle outgoing email
That's funny. My mail reader on the Amiga was an Arexx script driving
the Thinker hypertext engine. It slurped u
Walter S. Leipold wrote:
I've used lambda from time to time, but only socially, and I can quit any
time I want...
+1 QOTW
Steve
--
http://mail.python.org/mailman/listinfo/python-list
Nick Craig-Wood <[EMAIL PROTECTED]> writes:
> It would be nice if setdefault didn't evaluate the second argument
> unless it needed it. However I guess it would have to be a language
> feature to do that.
Personally, I'd love a language feature that let you create a function
that didn't evaluate
hi all
I am looking for a forum which was produced by python
link pls
--
http://mail.python.org/mailman/listinfo/python-list
Craig Ringer <[EMAIL PROTECTED]> writes:
> On Sat, 2004-12-18 at 00:40, Amir Dekel wrote:
>> This must be the silliest question ever:
>>
>> What about user input in Python? (like stdin)
>> Where can I find it? I can't find any references to it in the documentation.
>
> Under UNIX, I generally eit
Andrew Dalke wrote:
[snip]
It looks like FMOD/PySonic is the closest to what I'm thinking
of, and Snack coming in second. I didn't look too deeply. Most
of them only play sound clips (mp3, wav, etc.) and don't have
a way to specify what notes to play.
If you just want to play notes, you could loo
Andrew Dalke wrote:
> That is, I'm looking for something that would have let me
> (were I 20 years younger and just starting to program)
> do one of the "songs" I made in the early 1980s where I
> generated notes at random. It was something like:
>
> randomize
> for i=1 to 1000 do
>call sou
Mike Meyer wrote:
Personally, I'd love a language feature that let you create a function
that didn't evaluate arguments until they were actually used - lazy
evaluation. That lets you write the C ?: operator as a function, for
a start.
You can fake it with generator expresions:
. >>> class C(objec
Be sure to check the Blender forums before you give up, I recall
someone working on that very thing maybe a year or so ago, but maybe my
memory fuse is blown ;)
M.E.Farmer
Jelle Feringa // EZCT / Paris wrote:
> > Have you looked at Blender (http://www.blender3d.com)??
>
> Blender seems very promi
In article <[EMAIL PROTECTED]>, Keith Dart <[EMAIL PROTECTED]> wrote:
>Aahz wrote:
>>
>> In fact, in some ways my fluency has degenerated now that I'm
>> focusing on writing code for production.
>
>I'm curious about that last statement. Are you saying that if you
>write, full time, code for "produ
Alex Martelli wrote:
> John Machin <[EMAIL PROTECTED]> wrote:
>...
> > 6. Alex's magnum opus appears to operate on problem a, and maybe on
b
> > (it's over my head). It involves a fair chunk of mucking about --
for
>
> A dozen lines of code to write *ONCE* and put in your utilities
module
> is
Dennis Lee Bieber wrote:
>for the A above middle-C... The other A's would be: 55,
> 110, 220, (440), 880, 1760...
And for a while I had the first few digits of the 12th root
of 2 memorized.
> Granted... But it seemed the starting complaint was that Python
> -- a language that tries
Hi,
I know that i can do readline() from a file object.
However, how can I read till a specific seperator?
for exmple,
if my files are
name
profession
id
#
name2
profession3
id2
I would like to read this file as a record.
I can do this in perl by defining a record seperator;
is there an equivalen
Mike Meyer wrote:
> Personally, I'd love a language feature that let you create a function
> that didn't evaluate arguments until they were actually used - lazy
> evaluation. That lets you write the C ?: operator as a function, for
> a start.
>
> Hmmm. No, iterators can't be used to fake it. Oh we
"Fredrik Lundh" <[EMAIL PROTECTED]> writes:
> Walter S. Leipold wrote:
> > I think that Charlie's point is that, when you use "def ",
> > you have polluting your namespace. The whole program
> > becomes harder to understand because you can't ignore
> > anywhere, even if it was only ever intended
Hello all,
I needed this and did a quick search around and didn't see any
examples.
I knew it had to be easy, and it was.
So here it is a CD_Autorun program in python.
It is very simple and without comments is only about 30 lines.
Also included a setup.py at the end of the script so you can
'compil
[EMAIL PROTECTED] wrote:
> I know that i can do readline() from a file object.
> However, how can I read till a specific seperator?
>
> for exmple,
> if my files are
>
> name
> profession
> id
> #
> name2
> profession3
> id2
>
> I would like to read this file as a record.
> I can do this in perl b
Fredrik Lundh <[EMAIL PROTECTED]> wrote:
...
> Alex Martelli wrote:
>
> >> Traceback (most recent call last):
> >> File "mymodule.py", line 9, in somefunction
> >> someobj.bar()
> >> ... zero or more lines ...
> >> File "somelibrary.py", line 3, in bar
> >> r
David Wurmfeld wrote:
I am new to python; any insight on the following would be appreciated, even
if it is the admonition to RTFM (as long as you can direct me to a relevant
FM)
Is there a standard approach to enumerated types? I could create a
dictionary with a linear set of keys, but isn't th
John Machin <[EMAIL PROTECTED]> wrote:
> Thank you for the motivation. I now understand what it is attempting to
> do. Unfortunately it doesn't succeed. Instead of:
>
> if v is notimplemented: abstract_methods.append(n)
>
> you need:
> if v.im_func is notimplemented: abstract_methods.append(n)
[EMAIL PROTECTED] wrote:
Hi,
I know that i can do readline() from a file object.
However, how can I read till a specific seperator?
for exmple,
if my files are
name
profession
id
#
name2
profession3
id2
I would like to read this file as a record.
I can do this in perl by defining a record seperator
John Machin wrote (of Alex Martelli's sketch):
Thank you for the motivation. I now understand what it is attempting to
do. Unfortunately it doesn't succeed. Instead of:
if v is notimplemented: abstract_methods.append(n)
you need:
if v.im_func is notimplemented: abstract_methods.append(n)
Here is an
I have a requirement to drive a Windows GUI program from a Python
Script. The program was originally a DOS program written in Turbo
Pascal, and was recently translated to Delphi. I don't think it exposes
an OLE or other automation interface. I don't have access to the source.
A bit of Googling
Andrew McLean wrote:
>I have a requirement to drive a Windows GUI program from a Python Script. The
>program was
>originally a DOS program written in Turbo Pascal, and was recently translated
>to Delphi. I don't
>think it exposes an OLE or other automation interface. I don't have access to
>t
Simo Melenius wrote:
Now, if lambda was more than an expr, dumping "lambda" keyword would
be a convenient idea -- unnecessary keywords can make the language
less clear in some cases. One could do with Python's plain and simple
"def", like this:
filter (def (x): x*2, myseq)
(Disclaimer: Without thin
Alex Martelli wrote:
Definitely not the c.l.py I recalled
[snip]
I guess I'm not going to stay around all that long this time.
That would be a sad loss for all of us out here who very much appreciate
your very deep knowledge of Python and your willingness to share it.
I do understand the feeling
Steven Bethard wrote:
> Alex Martelli wrote:
> > Definitely not the c.l.py I recalled
> [snip]
> > I guess I'm not going to stay around all that long this time.
>
> That would be a sad loss for all of us out here who very much
> appreciate your very deep knowledge of Python and your
> willingness
Nick Craig-Wood wrote:
I prefer this
>>> amount = 1
>>> cost = 2.0
>>> what = 'potato'
>>> print """\
... I'll have %(amount)s %(what)s
... for $%(cost)s please""" % locals()
I'll have 1 potato
for $2.0 please
>>>
And if you enjoy building insecure stuff, try:
def fi
Steven Bethard wrote:
> I do understand the feeling though; Fredrik Lundh jumped at me only a few
> days ago when I said
> that I personally found list comprehensions more readable than map.
if you think that's what you said, you're clearly didn't read the post you
replied to very carefully. I
Scott David Daniels wrote:
> And if you enjoy building insecure stuff, try:
>
> def fix(text, globals_=None, locals=None, quote='"'):
> d = (globals_ or locals or globals()).copy()
> source = text.split(quote)
> source[1::2] = (str(eval(expr, d, locals or d))
> for expr
> if you need to read lots of 12-bit values, you can create a simple bitstream
> generator:
in private mail, Michal told me that his files were quite large, and that
the bitstream approach wasn't fast enough.
another way to do this is to use PIL's "bit" decoder:
import Image
im = Image.f
Mike Meyer wrote:
Craig Ringer <[EMAIL PROTECTED]> writes:
On Sat, 2004-12-18 at 00:40, Amir Dekel wrote:
This must be the silliest question ever:
What about user input in Python? (like stdin)
Where can I find it? I can't find any references to it in the documentation.
Under UNIX, I generally eith
Fredrik Lundh trolled:
(I think you could create some kind of drinking game based on the number of
...times the nasty trolls pounce on this list?
No, I think the idea is to actually address the content of someone's
question, politely and in the *holiday spirit*, not spirits.
--
http://mail.python.
Sean McIlroy wrote:
> What I want to do is simply to move a shape around on
> the screen using the mouse. I've looked at Tkdnd.py but
> I can't seem to extract what I need from the more involved
> stuff in there.
Here's a simple sample that displays random rectangles that can be dragged
around
Hello
Yesterday I installed Python 2.4. Since I often work with MySQL, I need
the MySQLdb module, wich worked fine under 2.3. Now, it doesn't work
under 2.4, it says it needs python 2.3 when I try to install the module.
Now I have some (rather nooby) questions:
1. Has anyone tried installing MySQ
[EMAIL PROTECTED] wrote:
Hi,
I know that i can do readline() from a file object.
However, how can I read till a specific seperator?
for exmple,
if my files are
name
profession
id
#
name2
profession3
id2
I would like to read this file as a record.
I can do this in perl by defining a record seperator
Simo Melenius wrote:
>> Ahem. If you name the function, you can reuse the name (or just
>> forget about it) as soon as you've used the function object.
>
> Sure, but mental pollution counts too IMO. What you write and what you
> read must go through your brain, including dummy variables. And next
[Rahul].
> I want to compute dot product of two vectors stored as lists a and b.a
> and b are of the same length.
>
> one simple way is
> sum(a[i]*b[i] for i in range(len(a)))
>
> another simple way is
> ans=0.0
> for i in range(len(a)):
> ans=ans+a[i]*b[i]
>
> But is there any other way which is f
Matthias Verniers wrote:
> 2. Is it possible to use Python 2.4 & 2.3 next to each other without
> conflicts?
yes, assuming "next to each other" means "on the same machine".
but binary extensions are bound to the Python version they were built
for; you cannot use a 2.3 extension with 2.4 on wind
David Wurmfeld wrote:
I am new to python; any insight on the following would be appreciated, even
if it is the admonition to RTFM (as long as you can direct me to a relevant
FM)
Is there a standard approach to enumerated types? I could create a
dictionary with a linear set of keys, but isn't th
Raymond Hettinger wrote:
> * applying itertools instead of genexps can save the eval-loop overhead
> * however, genexps are usually more readable than itertools solutions
I'm still waiting for you to implement itertools as a parse-tree analyzer/code
generator,
rather than an "bare" extension mod
Fredrik Lundh wrote:
If you find a good solution to this problem, please let me know.
well, since I'm not in the ego-stroking business, what if I promise never to
reply to posts by you, robert, and alex?
That's not fair to the rest of us though :)
--
http://mail.python.org/mailman/listinfo/python
Jim Hill wrote:
Is there a way to produce a very long multiline string of output with
variables' values inserted without having to resort to this wacky
"""v = %s"""%(variable)
No, not without the god-awful hacks you've already seen.
But it is possible in boo: : http://boo.codehaus.org/
See http://b
In article <[EMAIL PROTECTED]>,
Fredrik Lundh <[EMAIL PROTECTED]> writes
Andrew McLean wrote:
I have a requirement to drive a Windows GUI program from a Python
Script. The program was originally a DOS program written in Turbo
Pascal, and was recently translated to Delphi. I don't think it
expos
What about a generator and xreadlines for those really large files:
py>def recordbreaker(recordpath, seperator='#'):
... rec = open(recordpath ,'r')
... xrecord = rec.xreadlines()
... a =[]
... for line in xrecord:
... sep = line.find(seperator)
... if sep != -1:
...
1 - 100 of 167 matches
Mail list logo