The Voidspace Pythonutil Pages have had a long overdue overhaul. The url
of the Voidspace Pythonutils homepage has changed. It is now :
http://www.voidspace.org.uk/python/index.html
There are now separate pages for programs, modules, recipes, and CGIs.
Several of the bigger modules and programs
'twander' Version 3.160 is now released and available for download at:
http://www.tundraware.com/Software/twander
The last public release was 3.146.
Existing users are encouraged to upgrade to this release as it has
a number of bug fixes and several nice new features including:
- Mouse
[EMAIL PROTECTED] wrote:
I am trying to locate a windows binary of a recent python (2.4
preferred, but not essential) with support for Unicode characters
with values greater than 0x1. I have tested the python.org
binaries and those from Activestate, both give me a traceback on
unichr(0x1)
This would be funny except for the fact that there are
actually people out there who will take this seriously.
http://rmitz.org/freebsd.daemon.html
Don't forget Python == Snake == Serpent == ...
;-D
[EMAIL PROTECTED] wrote:
python.org = 194.109.137.226
194 + 109 + 137 + 226 = 666
What is
On Tue, 11 Jan 2005 19:08:01 +0100
Jelle Feringa // EZCT / Paris [EMAIL PROTECTED] wrote:
Using the subprocess module, but still not making any real progress...
I'm trying to make the examples given in the __doc__ work, without any
success I'm afraid, have you had more luck with it?
[...]
p =
Paul Rubin wrote:
Steve Holden [EMAIL PROTECTED] writes:
You can read about it in Philip Eby's excellent PEP at
http://www.python.org/peps/pep-0333.html
I looked at this and I have the impression that it tries to do
something worthwhile, but I can't tell precisely what. The rationale
and goals
Nick Coghlan wrote:
cr999 wrote:
I found the Architecture of Python (
http://wiki.cs.uiuc.edu/cs427/PYTHON By Jim Jackson, Kar-Han Tan
)is very useful for my understanding of the Python's architecture.
But I found the link is not link to that document today. It seems
that the document was removed.
Op 2005-01-11, Reinhold Birkenfeld schreef [EMAIL PROTECTED]:
Antoon Pardon wrote:
Op 2005-01-10, Bruno Desthuilliers schreef [EMAIL PROTECTED]:
Antoon Pardon a écrit :
Op 2005-01-08, Bruno Desthuilliers schreef [EMAIL PROTECTED]:
worzel a écrit :
I get what the difference is between a
Jeff Shannon [EMAIL PROTECTED] writes:
I guess we'll have to agree to disagree
Indeed :-)
I find that reading a lambda requires mentally pushing a stack frame
to parse the lambda and another to translate map() into a loop,
whereas a list comp's expression doesn't require such a shift
Donn Cave [EMAIL PROTECTED] writes:
List incomprehensions do not parse well in my eyes.
Are you familiar with the Haskell syntax for list comprehensions?
For example:
http://www.zvon.org/other/haskell/Outputsyntax/listQcomprehension_reference.html
Does their striking similarity to
Brion Vibber wrote:
Paul Rubin wrote:
I think mod_php doesn't play nice with apache2 but am not aware of any
cgi interoperability problems.
Generally it's recommended to configure apache2 in the child process
mode (eg the way that 1.3 works) when using PHP as many library modules
are alleged
Case == Case Nelson [EMAIL PROTECTED] writes:
Hi there I've just been playing around with some python code and I've
got a fun little optimization problem I could use some help with.
Basically, the program needs to take in a random list of no more than
10 letters, and find all possible
On Tuesday 11 January 2005 7:06 pm, [EMAIL PROTECTED] wrote:
python.org = 194.109.137.226
194 + 109 + 137 + 226 = 666
What is this website with such a demonic name and IP address? What
evils are the programmers who use this language up to?
Geeze did you miss out on the demon summoning
TimC [EMAIL PROTECTED] wrote:
Writing code that has to be indented *exactly* or it just won't
work. I bet they all use eVIl VI too.
--
TimC -- http://astronomy.swin.edu.au/staff/tconnors/
Hey, two (real, actual) TimCs from the same country posting to the same list on
the
same stupid
'twander' Version 3.160 is now released and available for download at:
http://www.tundraware.com/Software/twander
The last public release was 3.146.
Existing users are encouraged to upgrade to this release as it has
a number of bug fixes and several nice new features including:
- Mouse
The location of the prebuilt windows installer for PyCypto 2.0 (for
python 2.4) has changed. Apologies for any confusion, this is because of
a website reorganisation at Voidspace.
The new location is :
http://www.voidspace.org.uk/python/modules.shtml#pycrypto
There is also a prebuilt windows
Baza wrote:
I'm looking for any books or on-line resources on game programming using
Python. Does anyone have any advice?
--
Computer says, 'no'
Like the end quote :
eh, eh, eeehh!!
--
Neil Benn
Senior Automation Engineer
Cenix BioScience
BioInnovations Zentrum
Tatzberg 47
D-01307
Max M wrote:
Jan Dries wrote:
[EMAIL PROTECTED] wrote:
And there is hope for Python, as Guido has recently been seen with a
beard :-)
http://www.tbray.org/ongoing/When/200x/2004/12/08/-big/IMG_3061.jpg
LOL, he is working on linux, isn't he?
So it was about bloody time.
Guido Van Rossum is now
On Wed, 12 Jan 2005 17:54:49 +0800, Jon Perez [EMAIL PROTECTED] wrote:
Max M wrote:
Jan Dries wrote:
[EMAIL PROTECTED] wrote:
And there is hope for Python, as Guido has recently been seen with a
beard :-)
http://www.tbray.org/ongoing/When/200x/2004/12/08/-big/IMG_3061.jpg
LOL, he is
Hi all,
I have been successfully deploying my own python package with distutils
for some time now, but lately, with Python 2.4, the build_scripts
command has been behaving badly. In the part where it is supposed to
adjust the first line of the script it now produces
#!None
instead of
Op 2005-01-11, Jeff Shannon schreef [EMAIL PROTECTED]:
Paul Rubin wrote:
Steve Holden [EMAIL PROTECTED] writes:
[...] and if you think that
newbies will have their lives made easier by the addition of ad hoc
syntax extensions then you and I come from a different world (and I
suspect the walls
A couple of new 'modules' available from Voidspace Pythonutils.
PyName
http://www.voidspace.org.uk/python/modules.shtml#pyname
Slightly tongue in cheek, this isn't really a python module. It's three
lists of English words containing 'py' - intended to be helpful to those
choosing names for
Scott David Daniels wrote:
[EMAIL PROTECTED] wrote:
Because the coding is only supported in string literals.
But I'm not sure exactly why.
The why is the same as why we write in English on this newsgroup.
Not because English is better, but because that leaves a single
language for everyone to use
Luis M. Gonzalez wrote:
Hi there,
I'd like to know if there is a way to add and else condition into a
list comprehension. I'm sure that I read somewhere an easy way to do
it, but I forgot it and now I can't find it...
for example:
z=[i+2 for i in range(10) if i%2==0]
what if I want i to be i-2 if
The Voidspace Pythonutil Pages have had a long overdue overhaul. The url
of the Voidspace Pythonutils homepage has changed. It is now :
http://www.voidspace.org.uk/python/index.html
There are now separate pages for programs, modules, recipes, and CGIs.
Several of the bigger modules and programs
Adrian Casey wrote:
Diez B. Roggisch wrote:
I'm thinking it may be possible to modify the command line tools to use
qt
threads instead of native python threads. Is this the way to go? Are
there other options?
Why don't you use python threads in qt - I do so and so far it didn't
make
[EMAIL PROTECTED] wrote:
python.org = 194.109.137.226
194 + 109 + 137 + 226 = 666
What is this website with such a demonic name and IP address? What
evils are the programmers who use this language up to?
damn Franc Maçons
--
Even though I walk through the valley of the shadow of death,
I will
Michael Foord [EMAIL PROTECTED] wrote in message
news:[EMAIL PROTECTED]
The Voidspace Pythonutil Pages have had a long overdue overhaul. The url
of the Voidspace Pythonutils homepage has changed. It is now :
http://www.voidspace.org.uk/python/index.html
Hi,
do you mean
This is commercial. Never tried it but it exists:
http://visualwx.altervista.org/
Lorenzo
--
http://mail.python.org/mailman/listinfo/python-list
On Wed, 12 Jan 2005 10:09:03 +, Cory Davis [EMAIL PROTECTED] wrote:
command has been behaving badly. In the part where it is supposed to
adjust the first line of the script it now produces
#!None
instead of
#!/whereverpythonis/python
Has anyone else encountered this?
I haven't
Blinkin nora... I did... sorry. Better add a redirect *sigh*.
Thanks
Fuzzy
http://www.voidspace.org.uk/python/index.shtml
--
http://mail.python.org/mailman/listinfo/python-list
Thanks Albert.
I already do use #!/usr/bin/env python in my package directory, but the
build_scripts part of setup.py install changes this line to #!None
before copying to my bin directory.
Cheers,
Cory.
Albert Hofkamp wrote:
On Wed, 12 Jan 2005 10:09:03 +, Cory Davis [EMAIL PROTECTED]
On Tue, 11 Jan 2005 21:00:40 +0100, Fredrik Lundh
[EMAIL PROTECTED] wrote:
Steve Holden wrote:
Hmm, effbot.org seems to be down just now. Sure it'll be back soon, though.
http://news.bbc.co.uk/2/hi/europe/4158809.stm
Good to see that it was effbot.org that was down, rather that the
effbot
Fouff wrote:
I use Scintilla which is Scite with a lot of configurations files.
In directory exists a file cpp.properties and near the end of the file
is describe the command line use to compile, to link, ...
I think you would be able to change here the compiler.
regards
Fouff
Thanks.
--
I just installed python2.4 and used it to install a set of scripts I
had previously been using distutils with. It worked fine, and replaced
the first line with:
#!/usr/local/bin/python2.4
distutils should replace that first line with the location of the
binary used to run setup.py. Are you
Hi,
how can i visualize the content of the symbol table in Python?
Sometimes i want to know which symbols are imported from apackage and
such kind of things
Greetings, THomas Korimort
--
http://mail.python.org/mailman/listinfo/python-list
Hi Christopher
distutils should replace that first line with the location of the
binary used to run setup.py. Are you running setup with the following
command line?
python setup.py install
Yes.
A possible complication is that I also have python 2.3.? on that
machine, which I am reluctant to
Thomas Korimort a écrit :
Hi,
how can i visualize the content of the symbol table in Python?
Sometimes i want to know which symbols are imported from apackage and
such kind of things
Greetings, THomas Korimort
Do you mean something like :
dir(module)
???
Pierre
--
Hi Case.
Just in case you're really, truly looking for a fast Scrabble
word-search algorithm, the classic AI/CS article here is:
Andrew W. Appel and Guy J. Jacobson, The world's fastest Scrabble
program, Communications of the ACM, 31(5), pp 572--578, May 1988.
You can find a copy of this
On Wed, 12 Jan 2005 15:18:09 +0800, sam [EMAIL PROTECTED] wrote:
I m wondering which Excel module is good to be used by Python?
If you are on Windows, and you have Excel, then the Python for Windows
extensions[1] are all you need to drive Excel via COM. O'Reilly's
Python Programming on Win32
sam wrote:
I m wondering which Excel module is good to be used by Python?
Just use Excel's COM interface.
See also this helpful page to improve future responses:
http://www.catb.org/~esr/faqs/smart-questions.html
-Peter
--
http://mail.python.org/mailman/listinfo/python-list
Hi !
Sorry, but I think that, for russians, english is an *add-on*, and not a
common-denominator.
English is the most known language, but it is not common. It is the same
difference as between co-operation and colonization.
Have a good day
--
Michel Claveau
--
Daniel Bickett wrote:
In my script, rather than a file being moved to the desired location,
it is, rather, moved to the current working directory (in this case,
my desktop -- without any exceptions, mind you). As it happens, the
what is the output generated by the lines:
fdir, fname =
[EMAIL PROTECTED] writes:
I can't imagine how it could be worse than the learning curve of
__metaclass__, which we already have.
To me, learning macros *and their subtilities* was much more difficult
than learning metaclasses.
I guess I've only used Lisp macros in pretty straightforward
Paul Rubin wrote:
Case Nelson [EMAIL PROTECTED] writes:
Basically, the program needs to take in a random list of no more than
10 letters, and find all possible mutations that match a word in my
dictionary (80k words). However a wildcard letter '?' is also an
acceptable character which increases
paul that is awesome so much better than what i did which was lamo
brute force method. I formmatted and reformatted my input data and
stuffed it in a HUGE dictionary it was stupid and kludgy i hope
to study all these approaches and learn something here's what i
came up with ...
[EMAIL PROTECTED] wrote:
Scott David Daniels wrote:
If you allow
non-ASCII characters in symbol names, your source code will be
unviewable (and uneditable) for people with ASCII-only terminals,
never mind how comprehensible it might otherwise be.
So how does one edit non ascii string literals at
Simon Brunning wrote:
On Wed, 12 Jan 2005 15:18:09 +0800, sam [EMAIL PROTECTED] wrote:
I m wondering which Excel module is good to be used by Python?
If you are on Windows, and you have Excel, then the Python for Windows
extensions[1] are all you need to drive Excel via COM. O'Reilly's
Python
I've got python 2.3.3, 2.4, and 1.5.2 (which came preinstalled) on my
linux box. It's redhat 7.2 (I know... I would upgrade, but it would
void my service contract, so I just install things in /usr/local). You
can check if PYTHONHOME or PYTHONPATH are set, which may somehow be
interfering. I don't
I was a java developer one year ago ,before i moved to python i realy liked
it at the beggining, but i got very disapointed lately since my
previus two python proyects where relatively big,and python didnt feel
well suited for the task.
The reasons are mainly due to the standard library,the
On Wed, 12 Jan 2005 23:19:44 +0800, sam [EMAIL PROTECTED] wrote:
No, I don't use MS windows. I need to generate Excel file by printing
data to it, just like Perl module Spreadsheet::WriteExcel.
If it's just data that needs to go into your spreadsheet, then I'd
just build a CSV file if I were
sam wrote:
On Wed, 12 Jan 2005 15:18:09 +0800, sam [EMAIL PROTECTED] wrote:
I m wondering which Excel module is good to be used by Python?
[snip]
No, I don't use MS windows. I need to generate Excel file by printing
data to it, just like Perl module Spreadsheet::WriteExcel.
Excel can read CSV
Tim Gosselin [EMAIL PROTECTED] wrote:
I am writing a tcp tunnel but cannot find a way of detecting when a socket
shuts down its read end without writing to the socket. For testing the
write end of the remote endpoint I just do a:
if not sock.recv(buffsize)
I cannot write to the socket and
[Simon Brunning]
[sam [EMAIL PROTECTED]] wrote:
| No, I don't use MS windows. I need to generate Excel file
| by printing
| data to it, just like Perl module Spreadsheet::WriteExcel.
|
| If you need to write out formulae, formratting, that kind of thing,
| then I think you'll need to write a
Content-Type: text/plain; charset=us-ascii; format=flowed
Content-Transfer-Encoding: 7bit
Lines: 15
Message-ID: [EMAIL PROTECTED]
Date: Thu, 06 Jan 2005 15:13:42 GMT
NNTP-Posting-Host: 212.123.8.34
X-Complaints-To: [EMAIL PROTECTED]
X-Trace: phobos.telenet-ops.be 1105024422 212.123.8.34 (Thu, 06
I am just starting to learn Python, mostly by going through the examples
in Dive Into Python and by playing around.
Quite frequently, I find the need to iterate over two sequences at the
same time, and I have a bit of a hard time finding a way to do this in a
pythonic fashion. One example is a
On Wed, Jan 12, 2005 at 10:15:34AM -0500, Jane wrote:
[...] Some people have too much time on their hands...
OMG, PyPy is full of evil, too!!!1
print sum([ord(x) for x in PyPy])
or, if you haven't upgraded to 2.4, yet:
import operator
print reduce(operator.add, [ord(x) for x in
zip or izip is your friend:
import itertools
a = [1,2,3]
b = ['a', 'b', 'c']
for a,b in itertools.izip(a, b):
print a, b
--
Regards,
Diez B. Roggisch
--
http://mail.python.org/mailman/listinfo/python-list
hi all,
i have question on how to design a module structure.
for example, i have 3 files.
[somewhere]/main.py
[somewhere]/myLib/Base/BaseA.py
[somewhere]/myLib/ClassA.py
main.py
===
from myLib.ClassA import ClassA
a = classA()
dir(a)
myLib/ClassA.py
===
from myLib.Base.BaseA
Henrik Holm [EMAIL PROTECTED] wrote in message
news:[EMAIL PROTECTED]
I am just starting to learn Python, mostly by going through the examples
in Dive Into Python and by playing around.
Quite frequently, I find the need to iterate over two sequences at the
same time, and I have a bit of a
Henrik Holm [EMAIL PROTECTED] wrote in message
news:[EMAIL PROTECTED]
I suppose I could also use a lambda here -- but is there a different,
efficient, and obvious solution that I'm overlooking?
Check the itertools recipes in the library documentation.
--
[EMAIL PROTECTED] wrote in message
news:[EMAIL PROTECTED]
python.org = 194.109.137.226
194 + 109 + 137 + 226 = 666
What is this website with such a demonic name and IP address? What
evils are the programmers who use this language up to?
Some people have too much time on their hands...
that's easy. Just make an html file of your data, using tables and save
it as a *.xls and excel will think it's an excel file.
--
http://mail.python.org/mailman/listinfo/python-list
Richard Brodie [EMAIL PROTECTED] wrote:
Henrik Holm [EMAIL PROTECTED] wrote in message
news:[EMAIL PROTECTED]
I suppose I could also use a lambda here -- but is there a different,
efficient, and obvious solution that I'm overlooking?
Check the itertools recipes in the library
I am working with PythonCard in one of my apps. For its purposes, it
uses an .ini file that is passed to ConfigParser. For my app, I also
need configuration information, but for various reasons, I'd rather
use a syntax that ConfigParser can't handle.
I know I can maintain two separate
joking 1/2
On Wed, 12 Jan 2005, vegetax wrote:
-No naming convention. The speech of it fits in my head is no longer valid
when i use a lot of functionality,modules,classes in a large proyect.
For example if i remember a function i want ie:get attribute, i dont
remember if the module implementer
Precisely. One have to convert complex number into vectors, and vector of
complex numbers into vector of vectors, list of complex numbers into list of
vectors, , you get the idea.
And my code no longer look like the equation I have on paper...
Like I said, I've travelled down that path
Hi there,
I am somewhat confused by the following :
class C(object):
def getx(self): return self.__x
def setx(self, value): self.__x = extended + value
def delx(self): del self.__x
x = property(getx, setx, delx, I'm the 'x' property.)
So far so good :-) But what to do with this
Quite frequently, I find the need to iterate over two sequences at
the
same time, and I have a bit of a hard time finding a way to do this
in a
pythonic fashion. One example is a dot product. The straight-ahead
C-like way of doing it would be:
def dotproduct(a, b):
psum = 0
for i in
flupke wrote:
I searched with Google and on this newsgroups and i didn't find any info
regarding this. If there is more info, please redirect me to that info.
[snip]
The above looks like a glitch or accidental repost of the post that
started this thread:
On Wed, 2005-01-12 at 16:58 +0100, Gerhard Haering wrote:
On Wed, Jan 12, 2005 at 10:15:34AM -0500, Jane wrote:
[...] Some people have too much time on their hands...
OMG, PyPy is full of evil, too!!!1
print sum([ord(x) for x in PyPy])
or, if you haven't upgraded to 2.4, yet:
I'm pleased to announce the twenty-first development release of PythonCAD,
a CAD package for open-source software users. As the name implies,
PythonCAD is written entirely in Python. The goal of this project is
to create a fully scriptable drafting program that will match and eventually
exceed
For this code snip:
a=3
b=(1,len(a))[isinstance(a,(list,tuple,dict))]
Why would I get a TypeError from the len function?
Thanks,
--
http://mail.python.org/mailman/listinfo/python-list
michael wrote:
Hi there,
I am somewhat confused by the following :
class C(object):
def getx(self): return self.__x
def setx(self, value): self.__x = extended + value
def delx(self): del self.__x
x = property(getx, setx, delx, I'm the 'x' property.)
So far so good :-) But what to
Hi all
I'm writing a SSL server and we are using M2Crypto as our SSL engine.
What bothers me is that on every accept it prints a lot of 'junk-data'
to my stdout. It would be nice if someone knew a way to get M2Crypto out
of debug mode and into a more silent mode.
LOOP: SSL accept:
Someone Does anyone here have a copy of that document? Or who can tell
Someone me what is the email address of Jim Jackson or Kar-Han Tan.
Nick
http://web.archive.org/web/2003101953/http://wiki.cs.uiuc.edu/cs427/PYTHON
Gerrit This is again a nice document, and an example of
Jon Perez wrote:
... or why 'Perl monkey' is an oft-heard term whereas 'Python
monkey' just doesn't seem to be appropriate?
That's just because pythons are more likely to *eat* a monkey than to
be one :)
Jeff Shannon
Technician/Programmer
Credit International
--
On 11 Jan 2005 21:24:51 -0800, Paul Rubin wrote:
[backlinks]
Searching instead of indexing makes it very resilient :-)
How does it do that? It has to scan every page in the entire wiki?!
That's totally impractical for a large wiki.
So you want to say that c2 is not a large wiki? :-)
Kind
vegetax wrote :
I was a java developer one year ago ,before i moved to python i realy liked
it at the beggining, but i got very disapointed lately since my
previus two python proyects where relatively big,and python didnt feel
well suited for the task.
The reasons are mainly due to the
As continuation to a previous thread, PyChecker messages, I have a question
regarding code refactoring which the following snippet leads to:
runner.py:200: Function (detectMimeType) has too many returns (11)
The function is simply a long else-if clause, branching out to
different return
On 12.01.2005, at 18:35, It's me wrote:
For this code snip:
a=3
b=(1,len(a))[isinstance(a,(list,tuple,dict))]
Why would I get a TypeError from the len function?
because len() works only for sequence and mapping objects:
help(len)
Help on built-in function len in module __builtin__:
len(...)
On 12.01.2005, at 18:35, It's me wrote:
For this code snip:
a=3
b=(1,len(a))[isinstance(a,(list,tuple,dict))]
Why would I get a TypeError from the len function?
the problem is, that (1,len(a)) is evaluated, neither what type a
actually has
(python has no builtin lazy evaluation like ML). You
You should probably consider NOT doing what you suggest. You
would need to do some rather extensive work so you can support
the .write method of ConfigParser. With a little ingenuity
I've been able to user ConfigParser to support some very
different and complex syntaxes on different projects.
Okay, I give up.
What's the best way to count number of items in a list?
For instance,
a=[[1,2,4],4,5,[2,3]]
I want to know how many items are there in a (answer should be 7 - I don't
want it to be 4)
I tried:
b=len([x for y in a for x in y])
That doesn't work because you would get an
I tried this and I got:
[(1, 'a'), (2, 'b'), (3, 'c')]
But if I change:
a=[1,2]
I got:
[(1, 'c')]
Why is that? I thought I should be getting:
[(1, 'a'),(2,'b')]
?
Diez B. Roggisch [EMAIL PROTECTED] wrote in message
news:[EMAIL PROTECTED]
zip or izip is your friend:
import
It's me wrote:
For this code snip:
a=3
b=(1,len(a))[isinstance(a,(list,tuple,dict))]
Why would I get a TypeError from the len function?
What did you expect the length of the integer 3 to be?
-Peter
--
http://mail.python.org/mailman/listinfo/python-list
It's me [EMAIL PROTECTED] wrote in message
news:[EMAIL PROTECTED]
What's the best way to count number of items in a list?
For instance,
a=[[1,2,4],4,5,[2,3]]
I want to know how many items are there in a (answer should be 7 - I don't
want it to be 4)
How about this?
def totallen(x):
It's me wrote:
Okay, I give up.
What's the best way to count number of items in a list [that may contain lists]?
a = [[1,2,4],4,5,[2,3]]
def iterall(seq):
for item in seq:
try:
for subitem in iterall(item):
yield subitem
except TypeError:
Brent W. Hughes [EMAIL PROTECTED] wrote in message
news:[EMAIL PROTECTED]
1) I'm running a program within Pythonwin. It's taking too long and I
want
to stop/kill it. What do I do (other than ctrl-alt-del)?
Right click on the little python icon in the sys tray and select break into
running
It's me [EMAIL PROTECTED] wrote in message
news:[EMAIL PROTECTED]
Okay, I give up.
What's the best way to count number of items in a list?
For instance,
a=[[1,2,4],4,5,[2,3]]
I want to know how many items are there in a (answer should be 7 - I don't
want it to be 4)
snip
I've sure seen
John Lenton [EMAIL PROTECTED] wrote:
def dotproduct(a, b):
psum = 0
for i in range(len(a)):
psum += a[i]*b[i]
return psum
for this particular example, the most pythonic way is to do nothing at
all, or, if you must call it dotproduct,
from Numeric import dot as
It's me wrote:
Robert Kern [EMAIL PROTECTED] wrote in message
news:[EMAIL PROTECTED]
That's *it*.
So, how would you overload an operator to do:
With native complex support:
def twice(a):
return 2*a
print twice(3+4j), twice(2), twice(abc)
Let's presume for a moment that complex is *not* a
On Wed, 12 Jan 2005 17:42:50 GMT, It's me [EMAIL PROTECTED] wrote:
Okay, I give up.
What's the best way to count number of items in a list?
How long is a piece of string? There are many different ways, which
give you different trade offs.
For instance,
a=[[1,2,4],4,5,[2,3]]
I want to
Sorry if my question was a little lazy and yes, I was asking about the
lazy evaluation. :=)
I am surprised about this (and this can be dangerous, I guess).
If this is true, I would run into trouble real quick if I do a:
(1/x,1.0e99)[x==0]
and that's not good.
Something to keep in mind. :-(
It's me [EMAIL PROTECTED] wrote in message
news:[EMAIL PROTECTED]
Precisely. One have to convert complex number into vectors, and vector
of
complex numbers into vector of vectors, list of complex numbers into list
of
vectors, , you get the idea.
No, one would have a class with all
Oh, darn. I asked this kind of question before. plonk, plonk
Somebody posted an answer before:
def flatten(seq):
for x in seq:
if hasattr(x, __iter__):
for subx in flatten(x):
yield subx
else:
yield x
data = [[1,5,2],8,4]
val_to_pos
Frans Englich [EMAIL PROTECTED] wrote in message
news:[EMAIL PROTECTED]
As continuation to a previous thread, PyChecker messages, I have a
question
regarding code refactoring which the following snippet leads to:
runner.py:200: Function (detectMimeType) has too many returns (11)
The
Yes, Mark, I came up with almost the same code (after reading back old
answers from this list):
def flatten(seq):
for x in seq:
if hasattr(x, __iter__):
for subx in flatten(x):
yield subx
else:
yield x
def count_item(data):
return
Alexander Schremmer [EMAIL PROTECTED] writes:
How does it do that? It has to scan every page in the entire wiki?!
That's totally impractical for a large wiki.
So you want to say that c2 is not a large wiki? :-)
I don't know how big c2 is. My idea of a large wiki is Wikipedia.
My guess is
Mark McEahern wrote:
It's me wrote:
Okay, I give up.
What's the best way to count number of items in a list [that may
contain lists]?
a = [[1,2,4],4,5,[2,3]]
def iterall(seq):
for item in seq:
try:
for subitem in iterall(item):
yield subitem
except
1 - 100 of 220 matches
Mail list logo