erate stub scripts that do not use a
__main__ guard, so installing a multiprocessing-using application with
setuptools can cause this problem. I believe newer versions of distribute has
this problem fixed, but I'm not sure.
--
Robert Kern
"I have come to believe that the whole world is a
On 12/22/11 11:24 AM, Robert Kern wrote:
Just as a further note on these lines, when older versions of setuptools and
distribute install scripts, they generate stub scripts that do not use a
__main__ guard, so installing a multiprocessing-using application with
setuptools can cause this problem
ated with extra care.
"Bug" means, roughly, "something that should be fixed" not just any "thing that
has some unwanted consequences". So yes, by calling it a bug you are asking and
implying just that. If you don't mean that, don't use the word "bug"
On 12/23/11 1:23 PM, rusi wrote:
On Dec 23, 6:10 pm, Robert Kern wrote:
On 12/23/11 10:22 AM, rusi wrote:
On Dec 23, 2:39 pm, Steven D'Apranowrote:
Some people might argue that it is a mistake, a minor feature which
allegedly causes more difficulties than benefits. I do not hold
e object in addition to
integer indices.
http://docs.python.org/c-api/slice.html
--
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."
-- Umber
__getitem__ registered in PyMethodDef? Or in another way?
Sorry, PyMappingMethods.mp_subscript is the general function that you need to
implement.
--
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 inte
On 12/29/11 11:48 AM, Sayantan Datta wrote:
cat sample.html | python rot13.py rot13.html
cat sample.html | python rot13.py > rot13.html
--
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
just explicitly register a reduction function for
each type using copy_reg.pickle():
http://docs.python.org/library/copy_reg
--
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
on of this concept?
I don't think the (%r)epr-formatting exist anymore, so if you want to do that
you'll need to call repr manually.
Yes, it does.
formatter = '{!r} {!r} {!r} {!r}'
print formatter.format(1,2,3,4)
--
Robert Kern
"I have come to believe that the w
tell him that you don't appreciate his abuse of PyPI here if you like:
http://feilong.me/2012/01/python-import-girlfriend
--
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 i
, nor is it the logical conclusion
of anything that anyone has expressed here. Please don't invent strawmen.
--
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
ly if you're only wrapping when debugging).
His problem is that he wants to find out when someone is using the builtin sum()
on his objects (which apparently don't react well to it) and give an informative
warning. __builtin__.sum() is not under his control, fortunately.
--
Rober
rmail/python-list/2011-February/1265760.html
[2] http://mail.python.org/pipermail/python-list/2011-April/1269056.html
--
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 underl
osing code will be called if __exit__()
gets called. That will exhaust your generator, so the .close() method will not
really do anything helpful or hurtful in such a case.
--
Robert Kern
"I have come to believe that the whole world is an enigma, a harmless enigma
that is made terr
them. Sounds like the quicksort
algorithm.
Not at all. The "split it into two lists" steps are entirely different in what
Eelco suggested and quicksort. It's misleading to attempt to describe both using
the same words.
--
Robert Kern
"I have come to believe that the wh
object as an iterator:
[line.strip('\n') for line in f]
--
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
evelopment without needing to allow end users to relink
the application against user-supplied versions of Qt. The free license is the
LGPL, which really is Free under all common understandings of that term. You can
use the LGPL license for commercial and otherwise-proprietary applications. You
. Or the previous iteration under late-period TrollTech, for that matter.
--
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
rts of the code that Psyco was optimizing to get you the 20%
performance increase and port those to Cython.
--
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
I will even have to make some sort of sub-concepts,
but lets postpone that game until I really have really seen the need!
You probably want to use an off-the-shelf ORM (Object Relational Mapper) instead
of writing your own ad hoc ORM.
http://www.sqlalchemy.org/
--
Robert Kern
"I have
ptable.
Just one important thing: os.urandom() does not block to wait for more entropy.
Only os.random() does.
http://en.wikipedia.org/wiki//dev/random
--
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 atte
considers to be random
bytes that it slowly builds up from noise that is made accessible to
the OS from the hardware?
Yes.
--
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
-> pdb.set_trace()
(Pdb) c
second call
--Return--
> /Users/rkern/scratch/pdbbug.py(4)foo()->None
-> pdb.set_trace()
(Pdb) where
/Users/rkern/scratch/pdbbug.py(5)()
-> foo('first call')
> /Users/rkern/scratch/pdbbug.py(4)foo()->None
-> pdb.set_trace()
(Pdb)
--
Ro
.
You don't have to use pyuic. You can load the .ui file directly from your
program.
Clumsy, tedious, static.
Cocoa's Interface Builder shows how to do it even though Objective-C is
a *compiled* language, unlike Python.
The workflow is about the same, really.
--
Robert Kern
"
*string* 'N/A' for every NaN.
You understand that this will result in a chunk of text that is not JSON?
Other JSON readers won't be able to read it.
I think he means something like this:
>>> json.dumps([float('nan')])
'["N/A"]'
Not
'
annot use the function from scipy if scipy is not installed.
There are three ways round this problem:
1) Rewrite the interpolation function you need in your own code.
Variant:
1.a) Copy the interpolation code from scipy into your own code.
--
Robert Kern
"I have come to believe that the whol
s without 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 had
an underlying truth."
-- Umberto Eco
--
http://mail.python.org/mailman/listinfo/python-list
py mailing lists here:
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 terrible by our own mad attempt to interpret it as though it had
an underlying truth."
-- Umberto Eco
--
http://mai
th it? :-) I'm using a dedicated
newsreader (tin) as I posted via the gmane/usenet interface. The posting
looks perfectly OK to me when I read it back from usenet.
FWIW, I see the same problem Dave sees. I'm using gmane via Thunderbird.
--
Robert Kern
"I have come to believe that t
ll time.sleep ?
I think that was just a placeholder example, not the program he actually wants
to measure.
--
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 underl
md)
while p.poll() is None:
check_stats(p.pid)
# There are more accurate ways to do this, but this probably
# suffices for you.
time.sleep(PERIOD)
if __name__ == '__main__':
main()
--
Robert Kern
"I have come to believe that the whole world
inner-P5YtY/1
http://help.codecademy.com/
--
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/
rwise
> I don't know of any significant downsides to importing at various
> points of need in the code. The actual import is only done the first time,
> so it's effectively just a lookup in sys.modules from there on.
> Am I missing something?
Packages.
--
Robert Kern
[EMAIL PROTECT
John J. Lee wrote:
> I imagine scons has some support for
> distutils.
Not really, 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
know the result...
I use GMane to read python-list via its newsgroup gmane.comp.python.general .
It's *slightly* different from the real comp.lang.python, but mostly just by the
Mailman-generated block at the bottom of each message.
I started using GMane so I could read c.l.py on campus an
ecause you want to do the project in Ruby makes sense. Picking Ruby
because it only has one web framework is as silly as picking one Python web
framework at random. Just because RoR is the only Ruby web framework around
doesn't mean it's suitable for every project.
--
Robert Kern
[EMAIL PROTE
Alex Martelli wrote:
> Robert Kern <[EMAIL PROTECTED]> wrote:
>...
>
>>Picking RoR because you want to do the project in Ruby makes sense.
>>Picking Ruby because it only has one web framework is as silly as picking
>>one Python web framework at random. Just
Steven D'Aprano wrote:
> Unless I have missed something, Python doesn't appear to give an interface
> to the C library's next float function. I assume that most C floating
> point libraries will have such a function.
http://www.mkssoftware.com/docs/man3/nextafter.3.asp
YongYong Li wrote:
> I would like to unsubsrib python list, how do I do it?
http://mail.python.org/mailman/listinfo/python-list
Scroll to the bottom to see where you can unsubscribe.
--
Robert Kern
[EMAIL PROTECTED]
"In the fields of hell where the grass grows high
Are the graves o
edu/HELP/ranlib-docs/ranlib-docs.html
scipy_core (Numeric's and numarray's replacement) and, by extension, scipy 0.4
use the Mersenne Twister.
--
Robert Kern
[EMAIL PROTECTED]
"In the fields of hell where the grass grows high
Are the graves of dreams allowed to die.&
probably also want to install python2.4-dev so you can build and
install packages with distutils.
--
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
t of work to reimplement half the Python import
> machinery just for checking for all kinds of files. If you're serious
> about it, you also need to cope with modules loadable from ZIP files,
> and with .pth files, etc.
*Unless*, someone else has already done all of it for you:
h
a:
> r = r*i
>
> Is there any faster, efficient way of doing this.
r = multiply.reduce(a)
--
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
e anything. Thus the whole debate is
> pretty much moot if I am not much mistaken.
Did you read anything Kent wrote?
Specifically: "project that might possibly be distributed to business partners
or become a porduct some day."
--
Robert Kern
[EMAIL PROTECTED]
"In the fiel
ly BSD-licensed
since BSD is compatible with the GPL. Dual licensing would only be necessary if
the alternative licenses were incompatible, e.g. Artistic/GPL like Perl or
MPL/GPL like Mozilla.
--
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
hon"?
I'm pretty sure he means "working on Python." No one hires Guido and expects him
not to work *with* Python most of the time.
--
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
nefits directly.
http://www.cepr.net/publications/windows_2005_10.pdf
--
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
er ruled on the issue, and some people, like Larry Rosen, think
it's likely that a judge would not choose the FSF's interpretation. I think
Rosen is probably correct. However, I always assume that the author intends the
FSF's interpretation unless they make an explicit exception, and I r
e as Emacs. This is
> the closest thing I can think of to the Karrigell situation.
RMS has said precisely the opposite, in fact.
http://lists.debian.org/debian-legal/2002/11/msg00217.html
--
Robert Kern
[EMAIL PROTECTED]
"In the fields of hell where the grass grows high
Are the graves
ial.gammaln(n-k+1)
return lgn1 - (lgnk1 + lgk1)
def gauss_hypergeom(x, r, b, n):
return exp(logchoose(r, x) +
logchoose(b, n-x) -
logchoose(r+b, n))
Or you could use gmpy if you need exact rational arithmetic rather than floating
point.
--
Robert Kern
[
e that a selfhosting programming language
> is something on the same level as a nano assembler or an artificial
> intelligence.
??? What the hell are you smoking? We already have self-hosting programming
languages.
> Anton
>
> 'make my day, prove me wrong'
Prove yourself
Anton Vredegoor wrote:
> Robert Kern wrote:
>
>>I have a friend who works at Google. He has no backstabbing history at all.
>>Stop
>>insulting my friends.
>
> Your friends work for people who would never hire me.
This is not a crime.
> My resume sucks,
> bu
Stormslayer wrote:
> Folks: How do you create a multidimesional array of objects w/ the size
> of the array entered at runtime? So basically, for an arbitrary class,
> create an array and then *.resize it to be of size NXM, and then
> populate the elements of the objects.
First, asking on the sci
[EMAIL PROTECTED] wrote:
> Hello,
>
> I tried calling RandomArray.seed()
> by calling RandomArray.get_seed() I get the seed number (x,y).
> My problem is that x is always 113611 any advice?
Well, RandomArray.seed() gets its seed from the computer's time.
def seed(x=0,y=0):
"""seed(x, y), set
nows. You should ask on the scipy list as this is almost
certainly a holdover from the older version of scipy.
--
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
for is whether doing
> an "os.system('GPLapp')" violates GPL if I ship
> my Python code that does the os.system call and the GPLapp program ?
No, using the OS to run a GPLed program in another process and possibly
communicating with it through pipes or sockets does not trig
e could even suggest an alternate algorithmic approach to your
> actual end result.
Does it matter? Implementing Stirling's approximation is pointless when
scipy.special.gammaln() or scipy.special.gamma() does it for him.
--
Robert Kern
[EMAIL PROTECTED]
"In the fields of hell wher
ed against it asking for a Python 2.4 version. Perhaps the
maintainer has explained why there is no such version yet.
--
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
rge, which
> would of course mean obfuscation at other places...
I believe range() will always return an iterator in Python 3000. See the first
item in the section "Built-In Changes" on http://wiki.python.org/moin/Python3.0.
xrange() will be going away because it will be utterly obsolet
to return a list.
Except that we're talking about Python 3.0, which will break things anyways.
--
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
.org/~esr/faqs/smart-questions.html . It will
help us help you.
> The same problem with 'array' type. Is it a
> result of a default setting maybe?
No.
--
Robert Kern
[EMAIL PROTECTED]
"In the fields of hell where the grass grows high
Are the graves of dreams allow
in python...
I think Chi^2 tests fall distinctly in the "third-party library" category,
myself.
--
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
tats methods.
Gary Strangman's stats.py has existed for many years. Of course, it's utility
went up quite a bit when it got integrated into scipy so that it could use
efficient arrays instead of lists and had access to our library of special
functions.
--
Robert Kern
[EMAIL PROTECTED]
"
0. , 0.5],
[ 0.5, 0. , 0.5],
[ 1. , 0.5, 0. ]])
In [5]: C = repeat(B, [1,2,1], axis=-1)
In [6]: C
Out[6]:
array([[ 0. , 0.5, 0.5, 1. ],
[ 0.5, 0. , 0. , 0.5],
[ 0.5, 0. , 0. , 0.5],
[ 1. , 0.5, 0.5, 0. ]])
--
Robert Kern
[EMAIL PROTECTED]
&quo
e pexpect-current.tgz tarball is a standard Python Distutil distribution.
1. download pexpect-current.tgz
2. tar zxf pexpect-current.tgz
3. cd pexpect-current
4. python setup.py install
"""
--
Robert Kern
[EMAIL PROTECTED]
"In the fields of hell where the grass gr
index of -1 returns the last value?
> If that were true, I supposed the evaluation would be 1, and thus gives
> the same result.
That is correct.
--
Robert Kern
[EMAIL PROTECTED]
"In the fields of hell where the grass grows high
Are the graves of dreams allowed to die."
--
boxy440 wrote:
> Anyone? Can setup.py uninstall a package or module
> that it installed?
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
Presumably I need to do
> something with external_attr in ZipInfo, any pointers?
C.f.: http://mail.python.org/pipermail/pythonmac-sig/2005-March/013491.html
--
Robert Kern
[EMAIL PROTECTED]
"In the fields of hell where the grass grows high
Are the graves of dreams allowed to die.&
quot;characters"), so saxutils.XMLGenerator is
treating it as such.
sections are intended for human authoring, not computer authoring.
If you want to keep your sanity, just don't do 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
pdated. Could we start a discussion about which package will or
> may or should survive ?
You missed the discussion. The answer is numpy.
http://numeric.scipy.org/
The mailing list is [EMAIL PROTECTED] :
http://sourceforge.net/mail/?group_id=1369
--
Robert Kern
[EMAIL PROTECTED]
"
g. And as incomplete as the old Numeric manual was *for
Numeric*, it and the free documentation that is actually distributed with numpy
and describes the differences between the two goes a long way.
--
Robert Kern
[EMAIL PROTECTED]
"In the fields of hell where the grass grows high
Are the gr
has a
new mechanism to try to alleviate this. You should look at the matrix subclass
in numpy/core/defmatrix.py .
--
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
J wrote:
> I will just jump in an use NumPy. I hope this one will stick and evolve
> into the mother of array packages.
> How stable is it ? For now I really just need basic linear algebra.
> i.e. matrix multiplication, dot, cross etc
That stuff isn't going to change on you.
Tom Anderson wrote:
> Pardon my failure to RTFM, but does NumPy pick up the vecLib BLAS on Macs?
Yes.
--
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/mai
t an error messages.
You can enter a bug ticket in our Trac after registering. We will need to know
what version of scipy and numpy you are using and the exact error messages that
you are seeing.
http://projects.scipy.org/scipy/scipy
--
Robert Kern
"I have come to believe that the w
ats package and thus has nothing
for
statistical tests. However, scipy has plenty of stats functionality going well
beyond what you've specify.
--
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 at
tory working with InteractiveConsole on
> Linux?
Be sure that the readline module is installed.
--
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
Chris Spencer wrote:
> Robert Kern wrote:
>> Chris Spencer wrote:
>>> Why does code.InteractiveConsole support command history on Windows,
>>> but not in a Gnome terminal (all I get is ^[[A^[[B)? Or does it not
>>> support history at all, and the Windows conso
feel free to prove me wrong :)
You have it backwards. You are the one making the positive assertion. You get
to
prove yourself correct.
--
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 i
> How do I close the file in the above case?
You rewrite the faulty code such that the above case isn't the above case
anymore.
f = open('foo', 'r')
try:
for line in f:
print line
finally:
f.close()
--
Robert Kern
"I have come to believe that the
, 1, 3, 1, 1, 3, 1, 1, 2, 2, 1, 1, 1, 1, 1, 1, 3, 1,
4, 1, 1, 1, 2, 1, 2, 3, 2, 1, 1, 1, 1, 1, 3, 1, 1, 2, 6, 1, 1, 3, 2,
1, 1, 2, 1, 1, 7, 2, 1, 1, 2, 1, 1, 2, 4, 1, 2, 1, 4, 2, 1, 1, 2, 1,
4, 2, 1, 1, 3, 1, 3, 1])
--
Robert Kern
"I have come to believe that the who
# like 0.
U = 1.0 - random.random()
# Find the corresponding geometric variate by inverting the uniform variate.
G = int(ceil(log(U) / log(1.0 - p)))
return G
--
Robert Kern
"I have come to believe that the whole world is an enigma, a harmless enigma
that is made terri
Paul Rubin wrote:
> Robert Kern <[EMAIL PROTECTED]> writes:
>>G = int(ceil(log(U) / log(1.0 - p)))
>
> I usually owuld write that as int(ceil(log(U, 1.0 - p))).
Knock yourself out. I was cribbing from my C implementation in numpy.
--
Robert Kern
"I have come
imized
LAPACK library, and you will have to do some extra steps to get one that works.
See this thread:
http://projects.scipy.org/pipermail/scipy-user/2006-July/008681.html
--
Robert Kern
"I have come to believe that the whole world is an enigma, a harmless enigma
that is made terrible
Tim Heaney wrote:
> I think it's a shame there isn't any free documentation for numpy.
Tosh.
http://www.scipy.org/Tentative_NumPy_Tutorial
http://www.scipy.org/Numpy_Example_List
http://www.scipy.org/doc/numpy_api_docs/numpy.html
--
Robert Kern
"I have come to believe that
d. Some networks
parallelize better than others. Look at the "Performance" link on the site
below.
http://osl.iu.edu/research/pbgl/
--
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 in
another module.
>
> for example,
> module A
>
> _myvar = 'a local var'
>
> module B
> from A import *
>
> _myvar -- is not available.
>
> Is this in a pep somewhere ?
No; this has been a feature since before the time of PEPs. However, it is
documented
t; /lib64/libreadline.so.5.0
However, these are not the Python readline module. The Suse package for it is
probably called python-readline or something like that.
--
Robert Kern
"I have come to believe that the whole world is an enigma, a harmless enigma
that is made terrible by our
dline?
Oops. Sorry, I missed that part of what you said. Use
$ ./configure --enable-readline
--
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
minexp= -1022 tiny= 2.2250738585072014e-308
maxexp= 1024 max= 1.7976931348623157e+308
nexp =11 min= -max
-
--
Robert Kern
"I have come to believe that the whole world is an enigma, a harmless enigm
Noah wrote:
> I have a list of tuples
> [('a', 1.0), ('b', 2.0), ('c', 3.0)]
> I want to reverse the order of the elements inside the tuples.
> [(1.0,'a'), (2.0, 'b'), (3.0, 'c')]
Python 2.4+:
y = [tuple(reversed(
inside a
>> list comprehension.
>
> Why would you want to do it with list comprehensions?
Because he has a list of tuples and wants to reverse each individual tuple in
the list.
--
Robert Kern
"I have come to believe that the whole world is an enigma, a harmless enigma
t
the library; it doesn't need a separate
executable. Or is that what you meant (since one generally never installs the
library without also installing the executable, too)?
--
Robert Kern
"I have come to believe that the whole world is an enigma, a harmless enigma
that is made terr
t is called in the
> enclosing scope. After all, if the value of a is invalid, and the value of
> a is set in the enclosing scope, it makes sense to refer to "the object
> known locally as a" by the name it was known as when it was set.
That's what tracebacks are for. You don
e in the language in favor of a new, vague strategy that is usually
uninformative and frequently undefined.
--
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 underlyi
Lawrence D'Oliveiro wrote:
> In message <[EMAIL PROTECTED]>, Robert
> Kern wrote:
>
>> Lawrence D'Oliveiro wrote:
>>> In message <[EMAIL PROTECTED]>,
>>> Connelly Barnes wrote:
>>>
>>>> The main point of autoimp is to m
Larry Bates wrote:
> If you want to
> do vector math or matrix-type calculations look at the
> array module.
The array module in the standard library does not provide such capabilities. If
you need them, look at numpy.
http://numpy.scipy.org
--
Robert Kern
"I have come t
torage function" function have been remove
> from numpy/f2py ?? how can i change the array storage C to Fortran
> type??
Possibly. Please ask on the numpy list, though.
http://www.scipy.org/Mailing_Lists
--
Robert Kern
"I have come to believe that the whole world is an enigma, a har
, and that grudgingly. Selling
consulting services in any significant amount is probably out of the question.
--
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 under
ling
consulting services in any significant amount is probably out of the question.
--
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
901 - 1000 of 2667 matches
Mail list logo