> print a
Similarly:
self.a.extend([4, 5, 6])
print self.a
Does that give you better results?
--
Neil Cerutti
If we stay free of injuries, we'll be in contention to be a healthy team.
--Chris Morris
--
http://mail.python.org/mailman/listinfo/python-list
who think in Python, will understand right away
> that:
>
> math.count(x)
>
> is counting the substring "x" in the "math" string. But can you
> see where that might be confused to be a function called
> count() in the math module?
The only thing you know for sure (without tracing backwards) is
that count is an attribute of the object bound to the name 'math'
(or something masquerading as an attribute. Look under the hood
at descriptors for the details).
> I'm not complaining. Python is a great language in many
> respects. But, I would take some issue with those claiming
> Python is intuitive and easy. IMO: there seems to be many
> ambiguous, unintuitve, and confusing, aspects to Python.
Name binding can seem confusing at first, but it's really the
distinction between mutable and immutable objects that's the root
of your current confusion.
--
Neil Cerutti
--
http://mail.python.org/mailman/listinfo/python-list
The only
thing you'll look at nearly as much is 1.2.1: Built-In Functions.
--
Neil Cerutti
--
http://mail.python.org/mailman/listinfo/python-list
lt;-h t e->(odrije?iti, osloboditi)
| |
(pelin)<-e e->(apsolutan, apsolutni kod)
As the user enter letters, you just march down the tree, printing
all the words held in leaf nodes held in the current node.
--
Neil Cerutti
We shall reach greater and greater platitudes of achievement. --Richard J.
Daley
--
http://mail.python.org/mailman/listinfo/python-list
#x27;, [], ['pelin'])], ['pelin'])
[])]
[])]
[]), ('o' trie (thanks Terry) omitted for my sanity)])
It's a lot harder to write by hand than it would be to use.
My intuition says it shouldn't be terribly hard on resources for
for a 180K dict
onvenient while building the data structure. But you could
convert everything to tuples in the end, it's true.
--
Neil Cerutti
--
http://mail.python.org/mailman/listinfo/python-list
e Vim:
:help format-comments
(Spiacente per la mia scrittura difettosa. Sto utilizzando il
traduttore di altavista.)
--
Neil Cerutti
You've got to take the sour with the bitter. --Samuel Goldwyn
--
http://mail.python.org/mailman/listinfo/python-list
On 2007-05-11, Terry Reedy <[EMAIL PROTECTED]> wrote:
>
> "Neil Cerutti" <[EMAIL PROTECTED]> wrote in message
> news:[EMAIL PROTECTED]
>| Every node is a tuple of its letter, a list of its children, and
>| a list of its words. So the two 'pelin' n
At worst, you will get to know how much you
>> must check for human errors.
>>
>
> Here you go, Paddy, the following has been generated very methodically;
> what data type is the first column? What is the value in the first
> column of the 6th row likely to be?
>
>
; dynamic language with implicit declaration. "
>
> Is Python strongly typed or untyped?
It's strongly typed (only a handful of type conversions are
automatic), and dynamically typed (no type declarations for
identifiers are needed, types are checked at run time, not
compile time).
--
;t
>> verify it either, just guess from other terminals' behaviour.
>
> I tried both already, but neither one works. If I use a
> backslash, it doesn't end up in the Makefile, and if I use
> quotes, I get lots of error messages that I don't really want
> to an
;
"""
if not spans:
return ''
else:
head, tail = spans[0], spans[1:]
elem, start, end = head
if tail:
_, follow_start, follow_end = tail[0]
else:
follow_start, follow_end = (end, end)
if end > start:
return ("<%s>%s%s%s" %
(elem,
text[start:follow_start],
get_tree(text, tail),
text[follow_end:end],
elem))
else:
return "<%s />%s" % (elem, get_tree(text, tail))
--
Neil Cerutti
--
http://mail.python.org/mailman/listinfo/python-list
few other cases where you have to use a tuple, for
> example in a try..except statement the exception specification
> must be an exception to be caught or a tuple of exception
> specifications: a list won't work to catch multiple exceptions.
I use tuples simply because of their mell
On 2007-05-23, Steven Bethard <[EMAIL PROTECTED]> wrote:
> Neil Cerutti wrote:
>> On 2007-05-22, Steven Bethard <[EMAIL PROTECTED]> wrote:
>>> Thanks a lot! This put me on the right track (though the
>>> devil's definitely in the deta
On 2007-05-24, Neil Cerutti <[EMAIL PROTECTED]> wrote:
> On 2007-05-23, Steven Bethard <[EMAIL PROTECTED]> wrote:
> You mean... I left out the hard part? Shucks. I had really
> hoped it didn't matter.
>
>> * the recursive (or stack) part assigns children to
ntal problem, which is
> that it isn't correctly encoded (presumably because the
> CDATA is truncated in mid-character). I'm surprised
> Mozilla lets it slip by.
Web browsers are in the very business of reasonably rendering
ill-formed mark-up. It's one of the things that makes
x/concrete-abstractions.html) instead.
One cool advantage of SICP is the free online lectures, which
helps make up for its non-programmer slant.
http://www.swiss.ai.mit.edu/classes/6.001/abelson-sussman-lectures/
--
Neil Cerutti
--
http://mail.python.org/mailman/listinfo/python-list
prehensions and a few simple
statements, rather than promoting the use of nameless functions.
Ruby's
some_list.each do |item|
puts item
end
if I understood it correctly, In Python would be:
for item in some_list:
print item
That works for any object that supports the iterat
with class list %s" % class_list
There's no implicit self or class for Python identifiers.
The name class_list must be quailified: self.class_list or
MyClass.class_list.
--
Neil Cerutti
--
http://mail.python.org/mailman/listinfo/python-list
ever, the
> __init__() method only takes integers (which means I'd be
> forced to parse the string myself). Does anyone know of a way I
> can make it use the string? Thanks.
Consult the documentation about time.strptime (to start) and then
datetime.strptime (which refers back to the time.str
On 2007-07-24, Ben Finney <[EMAIL PROTECTED]> wrote:
> Neil Cerutti <[EMAIL PROTECTED]> writes:
>
>> On 2007-07-24, Robert Dailey <[EMAIL PROTECTED]> wrote:
>> > Hi,
>> >
>> > I have a string in the following format:
>> >
>>
and dir(MyClass()) for some insight, if it
turns out that it matters. Preferably, the user of a class
doesn't have to really think about it much.
--
Neil Cerutti
--
http://mail.python.org/mailman/listinfo/python-list
On 2007-07-25, Alex Popescu <[EMAIL PROTECTED]> wrote:
> Neil Cerutti <[EMAIL PROTECTED]> wrote in news:eRwpi.36813$G23.28496
> @newsreading01.news.tds.net:
>
>> On 2007-07-25, Alex Popescu <[EMAIL PROTECTED]> wrote:
>>> As a matter of style, how do you
gs!"
> d = {"foo": "bar", "baz": "bat"}
e = [[1], 2, 3, , 4]
f = [1, 2, 3, 4, []]
--
Neil Cerutti
--
http://mail.python.org/mailman/listinfo/python-list
On 2007-07-25, Carsten Haese <[EMAIL PROTECTED]> wrote:
> On Wed, 2007-07-25 at 19:26 +0000, Neil Cerutti wrote:
>> Speaking of the iter builtin function, is there an example of the
>> use of the optional sentinel object somewhere I could see?
>
> Example 1: If you use a
mapped(func, iterable):
for item in iterable:
try:
for it in flattened(item):
yield func(it)
except TypeError:
yield func(item)
I'd be more confortable excepting some sort of IterationError (or
using an is_iterable function, of course). I guess there's
):
> return '__iter__' in dir(thing)
So then:
def is_iterable(thing):
return '__iter__' in dir(thing) or '__getitem__' in dir(thing)
Speaking of the iter builtin function, is there an example of the
use of the optional sentinel object somewhere I could s
> deeply_mapped is reduced down to itertools.imap.
I chose to implement deeply_mapped because it illustrated the
problem of trying to catch a TypeError exception when one might
be thrown by some other code. I agree with your opinion that it's
a design flaw, and most of my problems with the code were caused
by that flaw.
--
Neil Cerutti
--
http://mail.python.org/mailman/listinfo/python-list
None:
yield it
else:
yield func(it)
else:
if func is None:
yield item
else:
yield func(item)
--
Neil Cerutti
--
http://mail.python.org/mailman/listinfo/python-list
ine()
if line == "":
break
self.lines.append(line)
self.upto += 1
def __getitem__(self, n):
self._readupto(n)
return self.lines[n]
--
Neil Cerutti
Eddie Robinson is about one word: winning and losing. --Eddie Robinson's agent
Paul Collier
--
http://mail.python.org/mailman/listinfo/python-list
step you're missing (and that I missed until my
third try) is the setParseAction method, with which you can
monkey around with the resulting parse tree.
On the other hand, since you got it working without pyparsing,
probably you're problem doesn't need pyparsing.
Hopefully I'
On 2007-07-26, Marc 'BlackJack' Rintsch <[EMAIL PROTECTED]> wrote:
> On Thu, 26 Jul 2007 15:02:39 +, Neil Cerutti wrote:
>
>> Based on the discussions in this thread (thanks all for your
>> thoughts), I'm settling for:
>>
>> de
On 2007-07-25, Neil Cerutti <[EMAIL PROTECTED]> wrote:
> On 2007-07-25, Jeff <[EMAIL PROTECTED]> wrote:
>> Here's a quick flatten() function:
>>
>> def flatten(obj):
>> if type(obj) not in (list, tuple, str):
>> raise TypeEr
def is_iterable(obj):
try:
iter(obj)
return True
except TypeError:
return False
Is there a better way?
--
Neil Cerutti
--
http://mail.python.org/mailman/listinfo/python-list
On 2007-07-27, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote:
> I believe Guido doesn't like '<>' and decided to enforce !=
> instead. Guess it's his language :).
I like 'not ==', cf 'not in'. Sadly it's a syntax error. However,
as
own masculinity...
The trumpet shall sound!
--
Neil Cerutti
--
http://mail.python.org/mailman/listinfo/python-list
ality of
C++, soon embroiling inexperienced programmers with the
difficulties of manual dynamic memory management. That's a big
side-show.
--
Neil Cerutti
--
http://mail.python.org/mailman/listinfo/python-list
I get a compiler error, so it
> probably has some special meaning.
It means something in regular expressions, namely, the end of the
string/line.
--
Neil Cerutti
--
http://mail.python.org/mailman/listinfo/python-list
nd XP, and it will work with simply batch files. But it
doesn't work with Python, for reasons I don't know enough about
Windows console programs to understand.
--
Neil Cerutti
The audience is asked to remain seated until the end of the recession.
--Church Bulletin Blooper
--
http://mail.python.org/mailman/listinfo/python-list
What's wrong with just importing what you want and using
it? If it's already been enabled, no harm will come from the
import statement.
--
Neil Cerutti
Will the highways on the Internet become more few? --George W. Bush
--
http://mail.python.org/mailman/listinfo/python-list
On 2007-07-30, André <[EMAIL PROTECTED]> wrote:
> On Jul 30, 9:39 am, Neil Cerutti <[EMAIL PROTECTED]> wrote:
>> I don't understand the qualification, "at runtime," you're
>> making. What's wrong with just importing what you want and
>>
t would indeed be lame. Of course, it
isn't true, right?
--
Neil Cerutti
--
http://mail.python.org/mailman/listinfo/python-list
27; % type(obj))
The article you linked, when discussing Python closures is really
just advocating the use of higher-order functions. But Java's
verbosity and lack of free functions are the only irritating
obstacle to using them just as you would in Python. I'm not sure
what the author
dent all the non-working code by one level, but
with a good editor that's a snap.
Python will still parse the following lines (it must be valid
Python syntax), but the resulting parse tree won't be executed.
--
Neil Cerutti
--
http://mail.python.org/mailman/listinfo/python-list
s to must match the actual
location in storage. Currently, the doctest stinks because it
depends on internal details of my implementation.
Is there a doctest feature that will allow me to stipulate that
one thing in a result is arbitrary, but identical to another
thing in that result?
--
Neil C
On 2007-08-01, Cameron Laird <[EMAIL PROTECTED]> wrote:
> In article <[EMAIL PROTECTED]>,
> Neil Cerutti <[EMAIL PROTECTED]> wrote:
>>On 2007-08-01, beginner <[EMAIL PROTECTED]> wrote:
>>> Thanks everyone for responding. It doesn't look like pytho
also tedious and error-prone.
Providing a suitable .str or .__repr__ method for your class
may make that problem disappear.
--
Neil Cerutti
--
http://mail.python.org/mailman/listinfo/python-list
On 2007-08-02, Magnus Lycka <[EMAIL PROTECTED]> wrote:
> Neil Cerutti wrote:
>> On 2007-08-01, Cameron Laird <[EMAIL PROTECTED]> wrote: .
>>> I want to re-emphasize the "triple-quote it" tip mentioned
>>> earlier in this thread. I think
self.last_value = value
return self.compare(lv, value):
a = range(15)
>>> reduce(is_consecutive(0), a)
True
>>> reduce(is_consecutive(0), a + [1,2])
False
It's been a while since I had to be in the STL mindset, so I
couldn't think of a better example.
--
Ne
On 2007-08-02, Neil Cerutti <[EMAIL PROTECTED]> wrote:
> On 2007-08-02, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote:
>> I don't personally use __call__ methods in my classes, but I
>> have encountered it every now and then here at work in code
>> written by o
s "Yes." I guess literally they have
> contributed. Or someone calls your house and asks, "Is
> so-and-so there?" You just say "Yes" and hang up on them :-)
Those kind of replies are posted for the fun of it, and with the
knowledge that somebody else will feel l
def rankLists(nestedList):
def rankList(singleList):
sortedList = list(sorted(singleList))
return map(functools.partial(bisect.bisect_left, sortedList), singleList)
return map(rankList, nestedList)
--
Neil Cerutti
Facts are stupid things. --Ronald Reagan
--
http://mail.python.org/mailman/listinfo/python-list
t; What advantage is there to "elif", apart from it needing three
> fewer characters to type?
It's a great boon to the authors of auto-indenting text editors.
--
Neil Cerutti
--
http://mail.python.org/mailman/listinfo/python-list
the language that's brain-dead! ;-)
The switch statements I'm aware of are less generally applicable
than a tower of "if { else if }* else". For example, with a
switch statement you have to dispatch on the one value for every
case.
In some languages, it's even of
reat tutorial and an awesome language reference.
With Python, you won't find anything like that. Python is too
huge.
So get used to the idea of needing several books. ;)
--
Neil Cerutti
--
http://mail.python.org/mailman/listinfo/python-list
On 2007-08-04, Michael Tobis <[EMAIL PROTECTED]> wrote:
> On Aug 4, 9:32 am, Neil Cerutti <[EMAIL PROTECTED]> wrot
>> With Python, you won't find anything like that. Python is too
>> huge.
>
> That's silly. Python is small in the sense that C is sma
rg/pipermail/python-dev/2005-September/056154.html
http://www.python.org/dev/peps/pep-3105
--
Neil Cerutti
--
http://mail.python.org/mailman/listinfo/python-list
On 2007-08-06, Neil Cerutti <[EMAIL PROTECTED]> wrote:
> On 2007-08-06, Paul Rubin wrote:
>> Carsten Haese <[EMAIL PROTECTED]> writes:
>>> For instance, if you never use print statements in your code,
>>> you won't notice that print is becoming a
default arguments isn't obvious, and
for expressions that result in mutable objects, it's not
intuitive.
--
Neil Cerutti
The outreach committee has enlisted 25 visitors to make calls on people who
are not afflicted with any church. --Church Bulletin Blooper
--
http://mail.python.org/mailman/listinfo/python-list
On 2007-08-06, Neil Cerutti <[EMAIL PROTECTED]> wrote:
> On 2007-08-06, Lee Fleming <[EMAIL PROTECTED]> wrote:
>> def f(x, y=None):
>> if y is None: y = []
>> y.append(x)
>> return y
>
> >>> f(f(23))
> [23, 42]
Sorry. That
unc's env is {}
>>> func() # env is {y: , func: }
0
In the above case, Python attempts to look up y in func's
environment, fails to find it, and so looks it up in the outer
environment, where y is bound to .
The reason Python does this peculiar thing is that functions
don't really have their own fully-fledged environements, the way
that modules and classes do. They use an--I presume--simpler,
leaner, more efficient construct. One requirement of this simpler
construct seems to be that a name must be either defined or
undefined inside a function. It can't be defined at one time, and
undefined at another time, as can happen in more full-featured
environments.
--
Neil Cerutti
--
http://mail.python.org/mailman/listinfo/python-list
On 2007-08-06, Lee Fleming <[EMAIL PROTECTED]> wrote:
> On Aug 6, 6:25 am, Neil Cerutti <[EMAIL PROTECTED]> wrote:
> Because when the function is called, the line
>
>
>> if y is None: y = []
>
>
> is executed, binding a brand new empty list to y. Th
Note that while [] and None may appear to be
similar expressions, they are not. None evaluated to itself,
while [] evaluates to a new empty list.
>>> None is None
True
>>> [] is []
False
--
Neil Cerutti
8 new choir robes are currently needed, due to the addition of several new
members and to the deterioration of some of the older ones. --Church Bulletin
Blooper
--
http://mail.python.org/mailman/listinfo/python-list
/repos/geezer/trunk/boss3client/geezer/widgets/tinter.py+tinter.py&hl=en&ct=clnk&cd=1&gl=us
--
Neil Cerutti
--
http://mail.python.org/mailman/listinfo/python-list
omewhere that Python 3000 will
> ban tabs as indentation characters, but now I can't turn up a
> link for it...
Tabs are going to be banned in the C Style Guide for Python 3000
source code, but they aren't being banned from Python 3000 code.
--
Neil Cerutti
The concert held i
maker(ff, a, b, c, d, e, f, g, h)
>>> mpack() # Call the function
>>> mpack(slice(5, 7), [0, 7]) # Change args 5 and 6, and call again.
The args you can change are limited by the slicing powers of
Python, and probably combining arg-changing with calling the
functio
rrences will be
replaced. Empty matches for the pattern are replaced only
when not adjacent to a previous match, so "sub('x*', '-',
'abc')" returns '-a-b-c-'.
In other words, the fourth argument to sub is count, not a set of
re flags.
--
Neil Cerutti
--
http://mail.python.org/mailman/listinfo/python-list
On 2007-08-07, Rohan <[EMAIL PROTECTED]> wrote:
> I would like to write a script which does the following job.
> Take column1 and 7 from 10 different excel sheets and pasthe
> them into a new excel worksheet. Any ideas on how to do it
Get the xlrd Python module. It'll come
On 2007-08-08, Istvan Albert <[EMAIL PROTECTED]> wrote:
> On Aug 6, 6:49 am, Neil Cerutti <[EMAIL PROTECTED]> wrote:
>> Incidentally, from the second link I find it shocking that the
>> keyword parameter "file" shadows a builtin. It seems to
>> endorse a
nt statements
The former refers to "augmented arithmetic operations", which I
think is a nice terminology, since assignment is not necessarily
taking place. Then the latter muddies the waters.
So Steve was both wrong and right, depending on the terminology.
I tend to think the world
On 2007-08-08, Istvan Albert <[EMAIL PROTECTED]> wrote:
> On Aug 8, 2:00 pm, Neil Cerutti <[EMAIL PROTECTED]> wrote:
>
>> I thought, in fact, that open was on more shaky ground. ;)
>
> yeah, that too ...
OK, I had misremembered. The current docs say that open is
p
() can be "removed", actually, unless the
file type itself is getting axed.
--
Neil Cerutti
--
http://mail.python.org/mailman/listinfo/python-list
;Adam")
Now you'll get a list of names for every age.
>>> d[50]
["Gary", "Guido"]
You can use the same function to build a mapping from names to
lists of ages.
d = {}
multidict_add(d, "Gary", 50)
multidict_add(d, "Gary", 23)
multidict_add(d, "Adam", 25)
>>> d["Gary"]
[50, 23]
--
Neil Cerutti
The choir invites any member of the congregation who enjoys sinning to join
the choir. --Church Bulletin Blooper
--
http://mail.python.org/mailman/listinfo/python-list
a match.
>
> What's the way to do that simply?
Newgroups are a poor substitute for the docs. For one thing,
newsgroups sometimes contain cranky people who say, "RTFM!" The
docs will never do that.
--
Neil Cerutti
--
http://mail.python.org/mailman/listinfo/python-list
On 2007-08-09, Bruno Desthuilliers <[EMAIL PROTECTED]> wrote:
> Neil Cerutti a écrit :
>> On 2007-08-09, special_dragonfly <[EMAIL PROTECTED]> wrote:
>>> Is there anyway for python to consider the values within a
>>> string when entering the data into a dicti
manually for new data types, but if you get it wrong
your code is pretty much useless. You are free to create your own
assignment semantics, as long as they match the semantics of the
built in types. Python has this property as well, though you're
limited to screwing up the "augmente
On 2007-08-09, Justin T. <[EMAIL PROTECTED]> wrote:
>
>> It's not Pythonic.
>>
>> Jean-Paul
>
> Ha! I wish there was a way to indicate sarcasm on the net. You
> almost got people all riled up!
Sorry. There's NO WAY to show sarcasm on the net. ;
immutable, the rules for literals apply (i.e.,
two occurrences of the empty tuple may or may not yield the
same object).
--
Neil Cerutti
--
http://mail.python.org/mailman/listinfo/python-list
han a certain length are 'interned'.
This makes them very fast to compare for equality, and cheaper to
store (maybe?).
> a is b
> true
> c = 'q' * 10
> c
> 'qq' #10 q's
> d = 'q' * 10
> d
> 'qq' #10 q's
> c is d
> false
>
> So from what I've read "==" tests for equivalence, "is" tests
> for identity but that does not explain the behaviour above.
The 10 q's constructed with string arithmetic were not interned,
because they were not literals.
--
Neil Cerutti
--
http://mail.python.org/mailman/listinfo/python-list
On 2007-08-11, Alex Martelli <[EMAIL PROTECTED]> wrote:
> Neil Cerutti <[EMAIL PROTECTED]> wrote:
>...
>> The Python Language Reference seems a little confused about the
>> terminology.
>>
>> 3.4.7 Emulating numeric types
>> 6.3.1 Augmente
> On 2007-08-11, Alex Martelli <[EMAIL PROTECTED]> wrote:
>> Neil Cerutti <[EMAIL PROTECTED]> wrote:
>>...
>>> The Python Language Reference seems a little confused about
>>> the terminology.
>>>
>>> 3.4.7 Emulating numeric
on system
distributed as a library for a general-purpose language has ever
caught on. Every system that's enjoyed even moderate success has
been a language+library implementation.
--
Neil Cerutti
--
http://mail.python.org/mailman/listinfo/python-list
des -- http://en.wikipedia.org/wiki/
> ANSI_escape_code:
Unfortunately, most versions of Windows of the last 7 years
(2000, XP, probably Vista) don't support ANSI escape codes well
enough to work with Python.
--
Neil Cerutti
We have to play hard for the full 40 minutes. 48? Oh
On 2007-08-12, Alex Martelli <[EMAIL PROTECTED]> wrote:
> Neil Cerutti <[EMAIL PROTECTED]> wrote:
>...
>> OK, I've thought about this some more and I think the source
>> of my confusion was I thought assignment in Python meant
>> binding a name to
se days,
> that's not entirely beyond the realms of
> possibility...
Well, I thought the post was about a cool new version of Lisp.
--
Neil Cerutti
--
http://mail.python.org/mailman/listinfo/python-list
; import rick
>>>> os.name
> 'posix'
>>>> import foobar
> Traceback (most recent call last):
> File "", line 1, in ?
> ImportError: No module named foobar
>>>>
>
>
>
> For the 'posix' OS, I'm doing an erratic import which should fail and print
> the error message.
>
> See, it prints nothing. This _is_ what has made me conclude
> that imports aren't executed in __init__(). But hey, they will
> get executed if you put them in any of the methods (which is
> again illogical because methods can/are called multiple times).
If you want an import inside an __init__ to run, you must call
the __init__ function that contains it.
>>> log = rick.Log()
You'll get another surprise when you do this, though. ;)
--
Neil Cerutti
--
http://mail.python.org/mailman/listinfo/python-list
ue to
X, X is assumed to be a local variable unless you say otherwise
with a global statement.
Note that the global statement in Init applies only in Init's
code block. Run must have it's own 'global X' statement, if
applicable.
--
Neil Cerutti
--
http://mail.python.org/mailman/listinfo/python-list
On 2007-08-14, Ritesh Raj Sarraf <[EMAIL PROTECTED]> wrote:
> Neil Cerutti wrote:
>
>> If you want an import inside an __init__ to run, you must call
>> the __init__ function that contains it.
>
> Doesn't __init__ get called automatically ?
It gets called
as one of its included batteries.
First try the curses module. It does come with Python on systems
with a curses port.
For Windows, there's the Effbot's console module.
http://effbot.org/zone/console-index.htm
Or go to plan B: Use a Tkinter or other GUI interface's text
widget.
--
N
The documentation says the following about StringIO.close:
close( )
Free the memory buffer.
Or else... what?
--
Neil Cerutti
--
http://mail.python.org/mailman/listinfo/python-list
tions accepting predicates as aruments:
6.5.1 Itertools functions
6.5.3 Recipes
11.47 Creating a new Distutils command
26.10.1 Types and members
The following provides a few predicate functions (weird! I'd have
never thought to look there for, e.g., ismodule):
6.7 operator -- Standard operat
On 2007-08-15, Alex Martelli <[EMAIL PROTECTED]> wrote:
> Neil Cerutti <[EMAIL PROTECTED]> wrote:
>> The documentation says the following about StringIO.close:
>>
>> close( )
>> Free the memory buffer.
>>
>> Or else... what?
>
>
On 2007-08-15, Ritesh Raj Sarraf <[EMAIL PROTECTED]> wrote:
> Neil Cerutti wrote:
>
>>>
>>> Doesn't __init__ get called automatically ?
>>
>> It gets called automatically when you construct an instance of
>> the class in which it's
ime.datetime.today() - datetime.timedelta(days=1)
>>> yesterday.strftime('%m%d%Y')
'08152007'
--
Neil Cerutti
It might take a season, it might take half a season, it might take a year.
--Elgin Baylor
--
http://mail.python.org/mailman/listinfo/python-list
for the old str type called, I think, 'bytes'. So
the 3000 devs seem to agree with you to some extent.
--
Neil Cerutti
Ushers will eat latecomers. --Church Bulletin Blooper
--
http://mail.python.org/mailman/listinfo/python-list
pinion the classes section of the official tutorial is
unfortunately the least tutorial part of the tutorial. But it
won't steer you wrong.
--
Neil Cerutti
--
http://mail.python.org/mailman/listinfo/python-list
could make a deal like that. I stop working all the
time!
--
Neil Cerutti
Customers who consider our waitresses uncivil ought to see the manager --sign
at New York restaurant
--
http://mail.python.org/mailman/listinfo/python-list
On 2007-08-20, Shawn Milochik <[EMAIL PROTECTED]> wrote:
> Everybody hates regexes. Except me. Discrimination!
I love them when I'm editing files with Vim, hate 'em when I'm
analyzing files with Python code. So I'm a descriminate
descriminator.
--
Neil Cerutti
The
grasp the idioms of the language, around here
> ofter referred to as "beeing pythonic."
It's hard to keep up with the new buzzwords that keep popping up
in this group.
--
Neil Cerutti
A billion here, a billion there, sooner or later it adds up to real money.
--Everett Dirksen
--
http:
e count each iteration.
This sort of suggests a direct solution:
for i in xrange(self.parent.GetPageCount()):
if i >= self.parent.GetPageCount():
break
# do stuff
At least that way you're spared the manual manipulation of i.
--
Neil Cerutti
--
http://mail.python.org/mailman/listinfo/python-list
701 - 800 of 1188 matches
Mail list logo