in general, explicit
typechecks are not a good idea, since they often preclude user-defined
objects from being used. Instead, try performing the call and catch the
resulting TypeError:
>>> f = 'asdf'
>>> try:
... f()
... except TypeError:
... print "oops, f is
x27;.
That's what os.path.expanduser is for.
--
Erik Max Francis && [EMAIL PROTECTED] && http://www.alcyone.com/max/
San Jose, CA, USA && 37 20 N 121 53 W && AIM, Y!M erikmaxfrancis
It is much safer to obey than to rule.
-- Thomas a Kempis
--
http://mail.python.org/mailman/listinfo/python-list
>
> namespace { // Avoid cluttering the global namespace.
iostream and namespaces are both most definitely C++ features, not C.
--
Erik Max Francis && [EMAIL PROTECTED] && http://www.alcyone.com/max/
San Jose, CA, USA && 37 20 N 121 53 W && AIM, Y!M erikmaxfranc
s
that you're dealing with C++ code throughout, not C, contrary to what
you had claimed. C and C++ are not the same language.
--
Erik Max Francis && [EMAIL PROTECTED] && http://www.alcyone.com/max/
San Jose, CA, USA && 37 20 N 121 53 W && AIM, Y!M e
a set, then it
should either be a generator or a set.
--
Erik Max Francis && [EMAIL PROTECTED] && http://www.alcyone.com/max/
San Jose, CA, USA && 37 20 N 121 53 W && AIM erikmaxfrancis
Nothing is potent against love save impotence.
-- Samuel Butler
--
http://mail.python.org/mailman/listinfo/python-list
e as "temp_buf.write(v)".
> So the suggestion is to add a __iadd__ method to StringIO and cStringIO.
>
> Any thoughts?
Why? StringIO/cStringIO have file-like interfaces, not sequences.
--
Erik Max Francis && [EMAIL PROTECTED] && http://www.alcyone.com/max/
Are there any other reasons?
Because if you store a hash, then you can keep that around even when the
original file is archived, moved elsewhere, or deleted. It's awfully
helpful for building databases of files you've seen before.
--
Erik Max Francis && [EMAIL PROTECTED] &&
to get help will usually allow _you_ to
see where the problem was in the process.
--
Erik Max Francis && [EMAIL PROTECTED] && http://www.alcyone.com/max/
San Jose, CA, USA && 37 20 N 121 53 W && AIM erikmaxfrancis
God said: "Let Newton be"; and all w
nced the latter if you list out the various pronounciations
for large n, seems me the _uhs_ outweigh the _oos_. (There's quadruple
on one side, but then quintuple, sextuple, septuple, heptuple, octuple,
etc., etc., etc.)
--
Erik Max Francis && [EMAIL PROTECTED] && http://w
in its history when every post had to be accompanied by a Monty Python
gag ...
--
Erik Max Francis && [EMAIL PROTECTED] && http://www.alcyone.com/max/
San Jose, CA, USA && 37 20 N 121 53 W && AIM erikmaxfrancis
Whatever it is you came to teach me / I am here
s a 1-tuple would be a single. Granted
that's not nearly as gruesome enough a name to go with the special
lopsided Pythonic creature mentioned above. I suggest we name it a
hurgledink.
--
Erik Max Francis && [EMAIL PROTECTED] && http://www.alcyone.com/max/
San Jose, CA, USA && 37 20 N 121 53 W && AIM erikmaxfrancis
Whatever it is you came to teach me / I am here to learn it
-- India Arie
--
http://mail.python.org/mailman/listinfo/python-list
but there's already plenty of existing English usage such that
3-tuple : triple :: 2-tuple : pair. (A 2-tuple is an "ordered pair" in
mathematics.) If a 2-tuple is a pair, then it would seem to follow that
a 1-tuple is a single.
--
Erik Max Francis && [EMAIL PROTECTED
nipple?
We don't talk about that anymore since the Incident.
--
Erik Max Francis && [EMAIL PROTECTED] && http://www.alcyone.com/max/
San Jose, CA, USA && 37 20 N 121 53 W && AIM erikmaxfrancis
Society attacks early when the individual is helpless.
-- B.F. Skinner
--
http://mail.python.org/mailman/listinfo/python-list
I don't think it's something
we need to worry about. I'm sure you'd just call them "empty tuples" or
"0-tuples" and move on :-).
--
Erik Max Francis && [EMAIL PROTECTED] && http://www.alcyone.com/max/
San Jose, CA, USA && 37 20 N 121 5
It's a "trip-you-uple", which you can pronounce anyway you like ;-)
All I hear there is "triple you up," which is good if you're in a poker
tournament, which I suppose tells you where my mind has been lately.
--
Erik Max Francis && [EMAIL PROTECTED] &&
tring (the help for sys.exit shows that if a
string is passed in, it will be printed before the process exits with
failure -- something I wasn't aware of actually).
--
Erik Max Francis && [EMAIL PROTECTED] && http://www.alcyone.com/max/
San Jose, CA, USA && 37 2
typically use a normal ellipsis "..." to indicate any sort of
repeated pattern.
--
Erik Max Francis && [EMAIL PROTECTED] && http://www.alcyone.com/max/
San Jose, CA, USA && 37 20 N 121 53 W && AIM erikmaxfrancis
To know oneself, one should assert oneself
cs doesn't change that fact.
--
Erik Max Francis && [EMAIL PROTECTED] && http://www.alcyone.com/max/
San Jose, CA, USA && 37 20 N 121 53 W && AIM erikmaxfrancis
I will always remember / This moment
-- Sade
--
http://mail.python.org/mailman/listinfo/python-list
> Just keep doing what you are doing, please.
Note quite. The assignment of the resources to its variable needs to be
done before the try:
f = open(file)
try:
contents = f.read()
finally:
f.close()
--
Erik Max Francis && [EMAIL PROTECTED] &
aticMethod(x, y, z):
...
aStaticMethod = staticmethod(aStaticMethod)
--
Erik Max Francis && [EMAIL PROTECTED] && http://www.alcyone.com/max/
San Jose, CA, USA && 37 20 N 121 53 W && AIM erikmaxfrancis
Wyrd has swept all my kin / all the brave chiefs away
d not only is that a major PITA, you almost never get it
> bug-for-bug right...
Especially since all of his examples have the same number of significant
digits (3), as the term is usually meant. Zeroes to the right are
significant, not zeroes to the left.
--
Erik Max Francis && [
Robert Kern wrote:
> There is no such command built in. You will have to build it yourself
> out of the components that are available.
linecache is probably what he's looking for.
--
Erik Max Francis && [EMAIL PROTECTED] && http://www.alcyone.com/max/
San Jose,
ly wanted to get the number of digits involved, then that's
fine, but that's not what significance is.
--
Erik Max Francis && [EMAIL PROTECTED] && http://www.alcyone.com/max/
San Jose, CA, USA && 37 20 N 121 53 W && AIM erikmaxfrancis
Eternity is very long, especially near the end.
-- Woody Allen
--
http://mail.python.org/mailman/listinfo/python-list
D H wrote:
> Yet again someone bitches about a thread right after they hypocritically
> throw their own little darts into the mix.
No one cares. Please take it elsewhere.
--
Erik Max Francis && [EMAIL PROTECTED] && http://www.alcyone.com/max/
San Jose, CA, USA &
Jonathan Bartlett wrote:
> I think you're misreading some of what is being said.
I think you're giving the author too much credit.
--
Erik Max Francis && [EMAIL PROTECTED] && http://www.alcyone.com/max/
San Jose, CA, USA && 37 20 N 121 53 W && AI
this way?
Because it's not always needed. See staticmethod or classmethod.
--
Erik Max Francis && [EMAIL PROTECTED] && http://www.alcyone.com/max/
San Jose, CA, USA && 37 20 N 121 53 W && AIM erikmaxfrancis
The basis of optimism is sheer terror.
-- Oscar Wilde
--
http://mail.python.org/mailman/listinfo/python-list
lias_, which acts as a verb, but won't be
automatically scanned as a verb when help is finding the list of valid
verbs:
alias_hi = verb_hello
...
That way, you get maximum effectiveness for minimum clutter.
--
Erik Max Francis && [EMAIL PROTECTED] && http:
uestion was asked before he went on to show what wasn't working
for him.)
--
Erik Max Francis && [EMAIL PROTECTED] && http://www.alcyone.com/max/
San Jose, CA, USA && 37 20 N 121 53 W && AIM erikmaxfrancis
To understand is to forgive, even oneself.
-
Jan Danielsson wrote:
>Is there any way to create a file with a specified size?
What do you want to put in the file? Once you've answered that
question, the solution should present itself.
--
Erik Max Francis && [EMAIL PROTECTED] && http://www.alcyone.com/max/
Sa
hen will all this information you can easily arrange the code to select
the best existing hand. Note that these all use well-established
techniques and reveal nothing secret.
> 3. x wild.
> For games like "deuces wild", what would be the best way to manage
> those? I tought
he same as the
straight set, then it's a straight. (Do this by reverse order of the
relative values of the straights, and stop when you find the first one,
to get the highest straight.) The most efficient way to do this is with
a bitmask, so that's how it's usually done.
--
s
> ...
You can also deal with them as a mask of card indexes. So the deuce of
clubs is bit 0, the three of clubs is bit 1, all the way up to the ace
of spades, which is bit 51. (That obviously won't fit in an int; you'll
need a long.)
--
Erik Max Francis && [EMAIL PR
Xah Lee wrote:
> Fuck the python doc wasted my time. Fuck python coders.
Use your words!
--
Erik Max Francis && [EMAIL PROTECTED] && http://www.alcyone.com/max/
San Jose, CA, USA && 37 20 N 121 53 W && AIM erikmaxfrancis
The mind is not a vessel to
d changes to the language and
its conventions.
--
Erik Max Francis && [EMAIL PROTECTED] && http://www.alcyone.com/max/
San Jose, CA, USA && 37 20 N 121 53 W && AIM, Y!M erikmaxfrancis
The quality, not the longevity, of one's life is what is important.
-- Dr. Martin Luther King, Jr.
--
http://mail.python.org/mailman/listinfo/python-list
ast):
File "", line 1, in ?
TypeError: 'str' object is not callable
You also seem to be under the impression that `x[:]()` is somehow
special syntax that is treated differently than `y = x[:]; y()`. It is not.
Besides, _ambiguity_ was never the problem. _Functionality_ is the p
either learning Python, or suggesting
useful improvements. That's just the way the ball bounces, unfortunately.
--
Erik Max Francis && [EMAIL PROTECTED] && http://www.alcyone.com/max/
San Jose, CA, USA && 37 20 N 121 53 W && AIM, Y!M erikmaxfrancis
To endure what is unendurable is true endurance.
-- (a Japanese proverb)
--
http://mail.python.org/mailman/listinfo/python-list
efined as the length of the subtended arc divided by the
length of the radius, which is a length divided by a length, and thus
dimensionless. (Like in a lot of dimensional analysis, you write "rad"
when desired to give a helpful hint, not because it's necessary; the
radian has the s
ret sin(1.2) as sine of an angle measured in
> degrees or radians (or whatever else).
The problem with this reasoning is when angular-dimensioned quantities
pop out of trigonometric functions, which happens routinely in the world
of calculus. When that happens, you use radians (or steradians) o
for the original function.
--
Erik Max Francis && [EMAIL PROTECTED] && http://www.alcyone.com/max/
San Jose, CA, USA && 37 20 N 121 53 W && AIM, Y!M erikmaxfrancis
The time to repair the roof is when the sun is shining.
-- John F. Kennedy
--
http://mail.python.org/mailman/listinfo/python-list
ere proposing this whole time.
--
Erik Max Francis && [EMAIL PROTECTED] && http://www.alcyone.com/max/
San Jose, CA, USA && 37 20 N 121 53 W && AIM, Y!M erikmaxfrancis
Get there first with the most men.
-- Gen. Nathan Bedford Forrest, 1821-1877
--
http://mail.python.org/mailman/listinfo/python-list
ed to iterate over the first 2**22 items in a list of 2**22+1
> items, making a copy of the sub-list first would probably be a bad idea :)
Then again, in that case, so would making a list of the indices with
`range`, which is what the original poster was suggesting.
--
Erik Max Francis &&am
, as there's no point in reading in the whole
file before iterating over it. To get the same effect as file iteration
in later versions, use the .xreadlines method::
for line in aFile.xreadlines():
...
--
Erik Max Francis && [EMAIL PROTECTED] &&
ay to do it -- and it isn't
to read the whole thing in first for no reason whatsoever other than to
avoid an `x`.
--
Erik Max Francis && [EMAIL PROTECTED] && http://www.alcyone.com/max/
San Jose, CA, USA && 37 20 N 121 53 W && AIM, Y!M erikmaxfrancis
ess waste. This falls in the latter category.
Besides, someone was asking for/needing an older equivalent to iterating
over a file. That's obviously .xreadlines, not .readlines.
--
Erik Max Francis && [EMAIL PROTECTED] && http://www.alcyone.com/max/
San Jose, CA, USA &
which defaults to identity), and only support
comparisons when the user defines what it is he wants them to mean.
--
Erik Max Francis && [EMAIL PROTECTED] && http://www.alcyone.com/max/
San Jose, CA, USA && 37 20 N 121 53 W && AIM, Y!M erikmaxfrancis
Water whic
it in hex string escape notation.
> Then if I try this:
>
> ---
> u_str = u"abc\u"
> reg_str = u_str.encode("utf-8")
> print reg_str
> ---
>
> I get the output:
>
> abc
>
> Here it looks like python isn't using the asci
onundrum of not understanding how the null set
relates to intersections.
--
Erik Max Francis && [EMAIL PROTECTED] && http://www.alcyone.com/max/
San Jose, CA, USA && 37 20 N 121 53 W && AIM, Y!M erikmaxfrancis
Perfect girl / She was never me
-- Lamya
--
http://mail.python.org/mailman/listinfo/python-list
7 ( as
> defined in iso-8859-15 )
U+2019 is RIGHT SINGLE QUOTATION MARK. The APOSTROPHE (U+0027) is a
cross-reference as a similar code point, but they're not the same thing.
Your problem is that ISO-8859-15 doesn't have the RIGHT SINGLE QUOTATION
MARK, so you'll have to do the
**c), or they would have written
it more efficiently and clearly.
--
Erik Max Francis && [EMAIL PROTECTED] && http://www.alcyone.com/max/
San Jose, CA, USA && 37 20 N 121 53 W && AIM, Y!M erikmaxfrancis
Men with empires in their purpose / And new eras in their b
ith ints!
But that's because ints are immutable, not because there is an explicit
copy of anything being made.
--
Erik Max Francis && [EMAIL PROTECTED] && http://www.alcyone.com/max/
San Jose, CA, USA && 37 20 N 121 53 W && AIM, Y!M erikmaxfrancis
Ip
ld really like it if I could somehow do it in one
> line.
Why is doing it in one line a priority? Clarity is more important than
brevity.
Regardless, you can do it in one line with the sorted builtin:
>>> sorted(a.keys())
[1, 2, 3]
--
Erik Max Francis && [EMAIL PROTECT
g 1 forces me to do).
>
> Is there any way to combine the two? The ultimate would be if I
> somehow could take vector2 and hook the member self.vals[0] to self.x
> or something.
There are also full-featured Vector and Matrix classes in the la.py
module of ZOE:
http://www.alcyon
Ron Garret wrote:
> So this is clearly a bug, but surely I'm not the first person to have
> encountered this? Is there a known workaround?
It's hard to see how this demonstrates a bug in anything, since you're
telnetting to the wrong port in your example.
--
Erik
cent call last):
> File "", line 1, in
> File "", line 1, in bind
> socket.error: (48, 'Address already in use')
>>>> s.bind(('',8081))
>>>> s.listen(5)
>>>> f = s.accept()[0].makefile()
>>>> f.re
more general name for asyncore/asynchat is Medusa, and there are some
resources with more examples available here:
http://www.nightmare.com/medusa/
http://www.amk.ca/python/code/medusa.html
--
Erik Max Francis && [EMAIL PROTECTED] && http://www.alcyone.com/max/
thing.
if x:
...
is not the same thing as
if x == True:
...
it's the same as
if bool(x):
...
So a more meaningful comparison of your two tests are:
>>> bool(0) == bool(False)
True
>>> bool([]) == bool(Fal
the end. Yes, it's the Laura Creighton
> article again:
>
> http://groups.google.com/group/comp.lang.python/msg/2de5e1c8384c0360
If so, be sure to click "More options," then "View thread," and then
read the responses. There were many reasonable objections to
g.
Really. He's not. That's a perfect example of a style guideline that
not only wastes energy, misses the point, but is totally wrong.
--
Erik Max Francis && [EMAIL PROTECTED] && http://www.alcyone.com/max/
San Jose, CA, USA && 37 20 N 121 53 W &&
since it was not widely
granted as true.
--
Erik Max Francis && [EMAIL PROTECTED] && http://www.alcyone.com/max/
San Jose, CA, USA && 37 20 N 121 53 W && AIM, Y!M erikmaxfrancis
Fear is an emotion indispensible for survival.
-- Hannah Arendt
--
http://mail.python.org/mailman/listinfo/python-list
Donn Cave wrote:
> "Not that it is of no historical interest" may have been too
> hard to follow, my apologies.
Yeah, my reading comprehension wasn't up to snuff that night.
--
Erik Max Francis && [EMAIL PROTECTED] && http://www.alcyone.com/max/
San Jos
ng "PING" then
you do not want to do so by identity, but rather value, so you use the
`==` operator, not `is`.
--
Erik Max Francis && [EMAIL PROTECTED] && http://www.alcyone.com/max/
San Jose, CA, USA && 37 20 N 121 53 W && AIM, Y!M erikmaxfrancis
You could have another fate / You could be in another place
-- Anggun
--
http://mail.python.org/mailman/listinfo/python-list
Gilles Ganault wrote:
> I'm sure there's a much easier way to read a two-column, CSV file into
> an array, but I haven't found it in Google.
>
> Should I use the Array module instead?
The csv module? Or just .rstrip and .split?
--
Erik Max Francis &
ady
bound to it; probably you have an HTTP server already running as part of
your default software installation and don't realize it.
Choose another port.
--
Erik Max Francis && [EMAIL PROTECTED] && http://www.alcyone.com/max/
San Jose, CA, USA && 37 20 N 121 53 W &
ntinel object (e.g., `mySentinel = object()`), because that
is the only time you actually _are_ interested in identity. All other
times you are not really interested in identity.
Sample code as above is essentially showing unimportant implementation
details that should never concern you.
of large tuples can be expensive). Admittedly the empty
> tuple is a special case but then 'Special cases aren't special enough to
> break the rules'.
>
> A bit odd.
It doesn't save time if you have to check through all the existing
tuples for matches ...
--
Erik Max
e user (that's you and
> I) should *not* expect any particular behaviour to hold between
> different implementations.
Right. In the terminology of language standards, it is implementation
defined.
--
Erik Max Francis && [EMAIL PROTECTED] && http://www.alcyone.com/max/
loop, but since it's going to
be processing massive amounts of data, the faster the better. Are there
any tricks I'm not thinking of, or perhaps helper functions in other
modules that I'm not thinking of?
--
Erik Max Francis && [EMAIL PROTECTED] && http://www.alcy
And of course I meant fastest, not "fatest." Fattest wouldn't be good,
either.
--
Erik Max Francis && [EMAIL PROTECTED] && http://www.alcyone.com/max/
San Jose, CA, USA && 37 20 N 121 53 W && AIM, Y!M erikmaxfrancis
Whoever named it necking w
the sums as ints/longs to avoid losing precision, so
converting to floating point isn't an optional. (The sums are
normalized by the sizes of the files and expanded to 32 bits in order to
maximize precision.)
--
Erik Max Francis && [EMAIL PROTECTED] && http://www.alcyone.co
appear to work quite as dramatically well for me with strings
instead of lists, but it certainly is an improvement.
> Of course, that optimization doesn't work for the squared sum; using a
> lambda only pessimizes it.
Right.
--
Erik Max Francis && [EMAIL PROTECTED] &
unt)
> ordinalSumSquared = sum(ord(c)**2 * count[c] for c in count)
This approach is definitely faster than using a generator in my tests,
and was second fastest overall. I'm actually a bit surprised that it's
as fast as it is; it never would have occurred to me to try it this wa
l
the next day, but got a factor of two speedup within half an hour!
--
Erik Max Francis && [EMAIL PROTECTED] && http://www.alcyone.com/max/
San Jose, CA, USA && 37 20 N 121 53 W && AIM, Y!M erikmaxfrancis
It is morale that wins the victory.
-- Gen. George C. Marshall
--
http://mail.python.org/mailman/listinfo/python-list
negative. The usual translation from polar to Cartesian coordinates
makes this meaningful, albeit weird, so in effect the resulting
positions are just reflections around the origin.
Which I suppose is what the original poster was asking about, but it's
still not clear.
--
Erik Max Fra
u're going to have to
give more information about what you're doing, what you're using to do
it, and where it's giving you unexpected or undesired results if you
want help solving your problem.
--
Erik Max Francis && [EMAIL PROTECTED] && http://www.alcyone.com/ma
6, 17:16:11)
[GCC 3.2.3] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> 0x
4294967295L
--
Erik Max Francis && [EMAIL PROTECTED] && http://www.alcyone.com/max/
San Jose, CA, USA && 37 20 N 121 53 W && AIM, Y!M erikmaxfrancis
Black vinyl man with black plasticized imagination
-- Nik Kershaw
--
http://mail.python.org/mailman/listinfo/python-list
uch tasks
would be your ability to manipulate them and write your own. If tools
already exist that do what you need, which languages they were written
in would be completely irrelevant.
--
Erik Max Francis && [EMAIL PROTECTED] && http://www.alcyone.com/max/
San Jose, CA, USA &
ith a list,
then the sets-difference-and-then-make-a-list mechanism is appropriate.
--
Erik Max Francis && [EMAIL PROTECTED] && http://www.alcyone.com/max/
San Jose, CA, USA && 37 20 N 121 53 W && AIM, Y!M erikmaxfrancis
It [freedom] must be demanded by the oppressed.
-- Dr. Martin Luther King, Jr.
--
http://mail.python.org/mailman/listinfo/python-list
assigning mutates the sequence. Slicing alone
returns a copy.
>>> L = ['one', 'two', 'three', 'four', 'five']
>>> x = L[1:] # grab a slice
>>> x[:] = [] # mutate it
>>> x
[]
>>> L # original li
t; towards the back of my mouth.
Native English accents vary as well, but _roll_ rhymes with _troll_, not
_trawl_. _Trawl_ would rhyme with _fall_, and _fall_ definitely doesn't
rhyme with _roll_.
--
Erik Max Francis && [EMAIL PROTECTED] && http://www.alcyone.com/max/
San
t; sound in any
accent I've ever heard of. Which you pronounce _boat_ and _bot_ the
same way, too?
--
Erik Max Francis && [EMAIL PROTECTED] && http://www.alcyone.com/max/
San Jose, CA, USA && 37 20 N 121 53 W && AIM, Y!M erikmaxfrancis
There are no dul
;, ...]
for method in methods:
setattr(MyClass, method, lambda *x: Node(method, *x))
The first argument here will be the implicit self, if you don't want
that, strip off the first argument (or use lambda self, *x: ...).
--
Erik Max Francis && [EMAIL PROTECTED] &
Erik Max Francis wrote:
> Something like::
>
> method = ['fun', ...]
> for method in methods:
> setattr(MyClass, method, lambda *x: Node(method, *x))
Err, that first line was supposed to be methods = ...
--
Erik Max Francis && [EMAIL PROTECT
Asun Friere wrote:
> How do you figure that? Isn't the chart showing the frequency of
> those particular terms combined as a fraction of the total search
> volume on Google?
Who knows? The graph has no labeling or calibration for the y-axis, so
it's meaningless.
-
programming
language design. Excessive and needless verbosity is one thing; but
saving keystrokes for its own sake is not a priority and never should be.
--
Erik Max Francis && [EMAIL PROTECTED] && http://www.alcyone.com/max/
San Jose, CA, USA && 37 20 N 121 53 W && AIM, Y!M erikmaxfrancis
I am not afraid / To be a lone Bohemian
-- Lamya
--
http://mail.python.org/mailman/listinfo/python-list
since Io makes no such requirements.
The attribute and method (not made distinct in Io; they're called
"slots") is much the same as with Python; the current instance is
checked for the object, then its parents, then _its_ parents, and so on.
--
Erik Max Francis && [EMA
hat), but I wouldn't take the chance and rely on such an
implementation detail.
If you want to keep track of the order in which objects were added to a
dictionary, you'll need to keep a separate list of (sorted) keys, which
is easy enough. If you're lazy there are plenty of
g wrong. Without seeing actual code, it's
impossible to say what.
--
Erik Max Francis && [EMAIL PROTECTED] && http://www.alcyone.com/max/
San Jose, CA, USA && 37 20 N 121 53 W && AIM, Y!M erikmaxfrancis
So little time, so little to do.
-- Oscar Lev
elf, x):
... self.x = x
... def __mul__(self, other):
... return C(self.x*other.x)
...
>>> result = C(2)*C(3)
>>> print result
<__main__.C instance at 0x402e13ec>
>>> result.x
6
--
Erik Max Francis && [EMAIL PROTECTED] && http://www.alcyone.
our M's and a silent Q like the famous
> author Farles Wickens *wink*
"I knew a guy whose first name was Ed. He was so cool, he spelled it
with a hyphen." -- George Carlin
--
Erik Max Francis && [EMAIL PROTECTED] && http://www.alcyone.com/max/
San Jose, CA,
ees if the job has completed -- showing the results if it has --
or refreshes periodically if it hasn't yet.
--
Erik Max Francis && [EMAIL PROTECTED] && http://www.alcyone.com/max/
San Jose, CA, USA && 37 20 N 121 53 W && AIM, Y!M erikmaxfrancis
You coul
7;t show anything until the entire process
> is complete and it's just a bunch of echo statements in a for loop,
> I'm not sure why they behave differently.
In a word: buffering.
--
Erik Max Francis && [EMAIL PROTECTED] && http://www.alcyone.com/max/
San Jose, CA
unwise. Instead
use int:
>>> int('00052')
52
--
Erik Max Francis && [EMAIL PROTECTED] && http://www.alcyone.com/max/
San Jose, CA, USA && 37 20 N 121 53 W && AIM, Y!M erikmaxfrancis
God grant me to contend with those that understand me
when it reaches the surface of Mars.
It was units of momentum that were inappropriately compared, actually.
(And it broke up before hitting the ground, but that's a minor quibble.)
--
Erik Max Francis && [EMAIL PROTECTED] && http://www.alcyone.com/max/
San Jose, CA, US
;credits" or "license" for more information.
>>>> import md5
>>>> s = md5.new()
>>>> s.update('snagglefrob')
>>>> s.hexdigest()
> '9eb2459fcdd9f9b8a9fef7348bcac933'
echo inserts a newline, your Python snippet doesn
popen, or one of the more involved
popen... modules, and then parse it however you like.
--
Erik Max Francis && [EMAIL PROTECTED] && http://www.alcyone.com/max/
San Jose, CA, USA && 37 18 N 121 57 W && AIM, Y!M erikmaxfrancis
Who'd ever think it / Such
et unpredictable behavior, you just get different behavior
you didn't expect, which is not the same thing. Python is a programming
language, like any other; randomly dropping letters in names is going to
result in bad behavior, so be more careful about it.
--
Erik Max Francis && [EMAI
ne"
> ... else:
> ... print "X is not None"
> ...
No, because you're iterating over an empty list, which does nothing:
>>> for x in []: print 'hi'
...
>>>
--
Erik Max Francis && [EMAIL PROTECTED] &&a
[EMAIL PROTECTED] wrote:
> Thanks, it looks like empy is what I need.
:-)
--
Erik Max Francis && [EMAIL PROTECTED] && http://www.alcyone.com/max/
San Jose, CA, USA && 37 20 N 121 53 W && AIM erikmaxfrancis
The object of war is not to die for your country b
[EMAIL PROTECTED] wrote:
> Actually, that looks even better that EmPy for what I need.
:-(
--
Erik Max Francis && [EMAIL PROTECTED] && http://www.alcyone.com/max/
San Jose, CA, USA && 37 20 N 121 53 W && AIM erikmaxfrancis
All bad poetry springs from
ng pages for "python in" does not reveal very many relevant
> sources.
Yes, `in` is the relevant operator. It's quite simple to use:
>>> a = [1, 4, 9, 16, 25]
>>> 2 in a
False
>>> 4 in a
True
If you're having problems using it in some circumstan
401 - 500 of 664 matches
Mail list logo