on top ? I know very little about embedding python other
than it is not considered a pleasant experience, so make sure you look
into the alternatives and have very good reasons if you decide to go
down this route.
George
--
http://mail.python.org/mailman/listinfo/python-list
alid or not. But since a NaN can be thought of as "a
flag representing the fact that an error occurred", as you mentioned,
it makes sense in practice to ask whether two errors are of the same
kind, e.g. for handling them differently. If I understood correctly,
your objection is using the equality operator '==' with these semantics
for NaNs. I would say that it's a reasonable choice for "practicality
beats purity" reasons, if nothing else.
George
--
http://mail.python.org/mailman/listinfo/python-list
;\n' % g2
text = '''this is a stupid
sentence but still I
have to write it.'''
print regex.sub(replace,text)
= Output ==
print """this is """
a stupid
sentence
print """ but still I
"""
have to
print """ write it."""
===
George
--
http://mail.python.org/mailman/listinfo/python-list
)
>>> flatten(seq)
[1, 2, 3, 4, [5, 6]]
And finally for recursive flattening:
def flatten(seq):
return reduce(_accum, seq, [])
def _accum(seq, x):
if isinstance(x,list):
seq.extend(flatten(x))
else:
seq.append(x)
return seq
>>> flatten(seq)
[1, 2, 3, 4, 5, 6]
George
--
http://mail.python.org/mailman/listinfo/python-list
"Mike Meyer" <[EMAIL PROTECTED]> wrote:
> "George Sakkis" <[EMAIL PROTECTED]> writes:
> > "Steven D'Aprano" <[EMAIL PROTECTED]> wrote:
> >
> >> But it doesn't make sense to say that two flags are
ll cases though you should prefer "isinstance(variable,
sometype)" instead of "type(variable) == sometype", so that it doesn't
break for subclasses of sometype.
> Thanks for your help!
>
> -- Josiah
Regards,
George
--
http://mail.python.org/mailman/listinfo/python-list
your case. I would suggest SCons
(http://www.scons.org/), a modern make/automake/autoconf replacement
that uses python for its configuration files instead of yet another
cryptic half-baked mini-language or XML.
George
--
http://mail.python.org/mailman/listinfo/python-list
;ll get a NameError exception:
>>> import breakfast.spam as spam
>>> breakfast.spam
NameError: name 'breakfast' is not defined
In either form of import though, the __init__.py has to be in the
breakfast directory.
HTH,
George
--
http://mail.python.org/mailman/listinfo/python-list
re posting anything
you may regret later, but this doesn't mean you should leave this
group; as you saw already, it's far more tolerant and civilized than
other groups in this respect.
> But thank you for all your help about the re module,
>
> Noud Aldenhoven
Cheers,
George
--
http://mail.python.org/mailman/listinfo/python-list
ion that
doesn't require writing a replacement function: backreferences.
Replacement can be a string where \1 denotes the first group of the
match, \2 the second and so on. Continuing the example, you could hide
the dates by:
>>> rx.sub(r'\1 in ', 'I was hired in 2001
act by:
from itertools import imap
def flatten(iterable):
if not hasattr(iterable, '__iter__'):
return [iterable]
return sum(imap(flatten,iterable),[])
George
--
http://mail.python.org/mailman/listinfo/python-list
beats purity IMO). In any case, python
was never about minimizing keystrokes; theres another language that
strives for this .
So, who would object the full-word versions for python 3K ?
def -> define
del -> delete
exec -> execute
elif -> else if
George
--
http://mail.python.org/mailman/listinfo/python-list
"Terry Reedy" <[EMAIL PROTECTED]> wrote:
> "George Sakkis" <[EMAIL PROTECTED]> wrote in message
> news:[EMAIL PROTECTED]
> > Still it's hard to explain why four specific python keywords - def,
> > del, exec and elif - were chosen to be abbr
a set and don't add sets as keys in dictionaries, you currently
have a choice; both frozenset and set will work. So all other things
being equal, it makes sense to ask about the relative performance if
the only 'evil' it may introduce can be rectified in a single import.
George
--
http://mail.python.org/mailman/listinfo/python-list
"Steven D'Aprano" <[EMAIL PROTECTED]> wrote:
> On Wed, 06 Jul 2005 10:15:31 -0700, George Sakkis wrote:
>
> > Well, they *may* be interchangable under some conditions, and that was
> > the OP's point you apparently missed.
>
> I didn't m
t; > But what's wrong with properties?
>
> Huh?
I guess he means why not define foo as property:
class demo(object):
foo = property(fget = lambda self: self.v,
fset = lambda self,v: setattr(self,'v',v))
d = demo()
d.foo = 3
print d.foo
George
--
http://mail.python.org/mailman/listinfo/python-list
ish on Windows ? At best
this may say something about the difference in perfomance between the
two JREs (assuming that most Windows and Mac users of Eclipse have
similar experience with yours).
George
--
http://mail.python.org/mailman/listinfo/python-list
"Grant Edwards" <[EMAIL PROTECTED]> wrote:
> On 2005-07-07, George Sakkis <[EMAIL PROTECTED]> wrote:
>
> > I guess he means why not define foo as property:
> >
> > class demo(object):
> > foo = property(fget = lambda self: self.v,
> >
X in platform Y is Sun's JVM in Y" is
kinda misleading.
Disclaimer: I am neither Java's not Eclipse's advocate; I'll choose
python over Java any day, but let's put the blame where it is due.
George
--
http://mail.python.org/mailman/listinfo/python-list
stants, but it seems it has been excluded from the latest (and
final I believe) version of Numeric (24.0b2) that I have installed, so
I can't actually check it.
George
--
http://mail.python.org/mailman/listinfo/python-list
"George Sakkis" <[EMAIL PROTECTED]> wrote:
> Where exactly have you been looking ? I guess not in Google, because
> the fifth result after querying "dbl_max" is
> http://mail.python.org/pipermail/pythonmac-sig/2002-July/005916.html,
> which follows up
4
> Anyway, time to call it a night so tomorrow I don't make anymore silly
> mistakes on comp.lang.python. :)
That would be a great idea ;-) An even greater idea would be to give up
on this "None should mean undefined" babble; it looks like a solution
looking for a
o
runtime errors (at least for anyone that has been using python for a
week or more), so even if the syntax checker did report all of them at
once it wouldn't make much difference in the overall debugging time.
Third, at least one editor (Komodo) reports syntax error on the fly as
you edit and t
y among builtin data structures, not
overwhelmingly more useful than set or dict comprehensions), but
there's a long way till that day.
George
--
http://mail.python.org/mailman/listinfo/python-list
# respective outer instance if and only if the
# attribute is already defined in the outer instance
if hasattr(outer, attr): setattr(outer,attr,value)
else: super(this.__class__,this).__setattr__(attr,
s for ISet's so that a client
can use either or them transparently.
- Add an ISet.remove() for removing elements, Intervals, ISets as
complementary to ISet.append().
- More generally, think about mutable vs immutable Intervals and
ISets. The sets module in the standard library will give you
"Jacob Page" <[EMAIL PROTECTED]> wrote:
> George Sakkis wrote:
> > 1. As already noted, ISet is not really descriptive of what the class
> > does. How about RangeSet ? It's not that long and I find it pretty
> > descriptive. In this case, it would be a go
ore than once.
>
> Raymond Hettinger
Similar arguments can be given for dict comprehensions as well.
George
--
http://mail.python.org/mailman/listinfo/python-list
"Jacob Page" <[EMAIL PROTECTED]> wrote:
> George Sakkis wrote:
> > There are several possible use cases where dealing directly with
> > intervals would be appropriate or necessary, so it's good to have them
> > supported directly by the module.
>
>
"Jacob Page" <[EMAIL PROTECTED]> wrote:
> George Sakkis wrote:
> > As I see it, there are two main options you have:
> >
> > 1. Keep Intervals immutable and pass all the responsibility of
> > combining them to IntervalSet. In this case Interval.__ad
| [3,7] = (2,7]
but
(2,4] | [5,7] = { (2,4], [5,7] }
That is, the set of intervals is not closed under union. OTOH, the set
of intervals _is_ closed under intersection; intersecting two
non-overlapping intervals gives the empty interval.
George
--
http://mail.python.org/mailman/listinfo/python-list
a function, not method. Also, the pythonic way of writing it (since
2.4) is:
from math import sqrt
from itertools import izip
def distance(sequence1, sequence2):
return sqrt(sum((x-y)**2 for x,y in izip(sequence1, sequence2)))
> Thank you very much for your help.
>
> Phil
Regards,
George
--
http://mail.python.org/mailman/listinfo/python-list
nction(objtype)
def __set__(self, obj, value):
raise AttributeError, "can't set class attribute"
return Descriptor()
Accessing Foo.TheAnswer works as expected, however __set__ is
apparently not called because no exception is thrown when setting
Foo.TheAnswer.
re.search()
and they expose a set of useful methods (group(), groups(), etc.).
However if the user attempts to create a Match instance, a TypeError is
raised. Currently I like this option better; it's both user and
developer friendly :)
George
--
http://mail.python.org/mailman/listinfo/python-list
substantially annoying and error-prone.
I'm not sure what you mean here; where is the 'triple typing' ? And how
is this an argument against class decorators ?
George
--
http://mail.python.org/mailman/listinfo/python-list
at seems kind
> of awkward.)
>
> Is this possible using Python 2.3? Any better ways to accomplish this?
I don't know if it's "better", but since you know that self.__module__
has already been imported, you can access it through the sys.modules
dict:
a = sys.module
should happen for vectors of size != 3 ? I don't think that a
general purpose vector class should allow it; a Vector3D subclass would
be more natural for this.
George
--
http://mail.python.org/mailman/listinfo/python-list
x = re.compile(r'^abs:.*\\(.+)$')
input = FileInput(filename)
unparsed = []
for line in input:
try:
print regex.match(line).group(1)
except:
unparsed.append(input.filelineno())
print line
print "Unparsed lines:", ','.join(map(str,unparsed))
George
--
http://mail.python.org/mailman/listinfo/python-list
, so I don't see
how this can be generalized _usefully_ to arbitrary number of
dimensions.
George
--
http://mail.python.org/mailman/listinfo/python-list
rint "matched:", match.group(1)
else:
print "did not match"
#= output ===
line 1 matched: 'di_--v*-.ga_-t
line 2 matched: 'pas-*m
#
George
--
http://mail.python.org/mailman/listinfo/python-list
t:
def iterPermutations(num, seq):
if num:
for rest in iterPermutations(num-1, seq):
for item in seq:
yield rest + [item]
else:
yield []
for comb in iterPermutations(4, list("abc")):
print ''.join(comb)
George
--
http://mail.python.org/mailman/listinfo/python-list
pby:
import itertools as it
def hasConsequent(aString, minConsequent):
for _,group in it.groupby(aString):
if len(list(group)) >= minConsequent:
return True
return False
George
--
http://mail.python.org/mailman/listinfo/python-list
"Aries Sun" <[EMAIL PROTECTED]> wrote:
> I have tested George's solutions, it seems not complete. When pass (s,
> 3) to the function hasConsequent(), it returns the wrong result.
What are you talking about ? I get the correct answer for
>>> hasConsequent(&
"Aries Sun" <[EMAIL PROTECTED]> wrote:
> Hi George,
> I used Python 2.4.1, the following are the command lines.
> But the reslut was still False. Is there anything wrong with below
> codes?hasConsequent("taaypiqee88adbbba", 3)
All indentation was lost in you
of 'abc'
and when it ends get back to us, or rather our grand-grandchildren. In
the meantime, learn about recursion, generators and accumulating loops
and try to understand the right, efficient solutions already posted.
Cynically yrs,
George
PS: Btw, using ALL_CAPITALS (at least for local variables) is BAD
STYLE; the same holds for variables named 'list' and 'string',
independent of case.
--
http://mail.python.org/mailman/listinfo/python-list
earth is
Session and the other
attributes coming from. From a brief look, the api seems like a quick & dirty
solution that would
benefit from refactoring, so you'd rather not try to learn python from it.
George
--
http://mail.python.org/mailman/listinfo/python-list
640) uses the
prime number
computation you posted, so read it again if it's not clear what the "else"
clause does with loops.
George
--
http://mail.python.org/mailman/listinfo/python-list
t that doesn't mean there aren't any.
Hints:
- You have to take exactly one decision (flight or stop) every single day until
you reach the
destination; no more, no less.
- There is no time machine; days pass in one direction only, one at a time.
George
--
http://mail.python.org/mailman/listinfo/python-list
me. So any heavy
preprocessing on the schedule is rather unlikely to pay off.
George
--
http://mail.python.org/mailman/listinfo/python-list
string.maketrans('','')
>>> unprintable = identity.translate(identity, string.printable)
George
--
http://mail.python.org/mailman/listinfo/python-list
"Peter Hansen" <[EMAIL PROTECTED]> wrote:
> Jp Calderone wrote:
> > On Sat, 16 Jul 2005 19:01:50 -0400, Peter Hansen <[EMAIL PROTECTED]> wrote:
> >> George Sakkis wrote:
> >>>>>> identity = string.maketrans('','
"Peter Hansen" <[EMAIL PROTECTED]> wrote:
> George Sakkis wrote:
> > "Peter Hansen" <[EMAIL PROTECTED]> wrote:
> >>>> Where did you learn that, George?
> >
> > Actually I first read about this in the Cookbook; the
f, x):
self.x = x
class A(X):
def methodA():
pass # Ignore the details
class B(X):
def methodB():
pass # Ignore the details
class C:
def __init__(self, x1, x2):
self.x1 = x1
self.x2 = x2
So the constructor of C would take two X instan
alls as profitable
> as these obviously ignorant companies?
It should not really come as a shock that the same fellow who came up with a
brilliant efficient way
to generate all permutations (http://tinyurl.com/dnazs) is also in favor of
goto.
Coming next from rbt: "Pointer arithmetic in python ?".
George
--
http://mail.python.org/mailman/listinfo/python-list
function but in my real life code i already
> have several params shipped to the init so i wanted to solve it slightly
> more elegant.
>
> Regards,
> Benedict
Make printclass a class method:
class A(object):
def __init__(self):
print "I'm A"
# for
Look into STAF http://staf.sourceforge.net/index.php
-g
-Original Message-
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of yoda
Sent: Thursday, July 21, 2005 9:23 AM
To: python-list@python.org
Subject: Listing Processes Running on Remote Machines
Hello Hackers,
I'm develop
()
>
> Jeethu Rao
The performance penalty of the exception is imposed only the first time a
distinct item is found. So
unless you have a huge list of distinct items, I seriously doubt that this is
faster at any
measurable rate.
George
--
http://mail.python.org/mailman/listinfo/python-list
ion is a valid point for debate, so the PEP should definitely address
it. IMO os.path and
most (if not all) other equivalent modules and functions should be deprecated,
though still working
until 2.9 for backwards compatibility, and dropped for python 3K.
George
--
http://mail.python.org/mailman/listinfo/python-list
.groupby(sorted(L1))]
Or if you care about performance rather than number of lines, use this:
def hist(seq):
h = {}
for i in seq:
try: h[i] += 1
except KeyError: h[i] = 1
return h.items()
George
--
http://mail.python.org/mailman/listinfo/python-list
are we going to maintain both alternatives forever? (And what about
> > all the duplication with the os module itself, like the cwd()
> > constructor?) Remember TOOWTDI.
> > """
>
> Read literally, this says (at least to me) "I don't want to fix it be
common cases.
It's a tradeoff, so arguments for both cases should be discussed.
George
--
http://mail.python.org/mailman/listinfo/python-list
many (or most) common cases. It's a tradeoff, so
arguments for both cases
should be discussed.
George
--
http://mail.python.org/mailman/listinfo/python-list
"Andrew Dalke" <[EMAIL PROTECTED]> wrote:
> George Sakkis wrote:
> > You're right, conceptually a path
> > HAS_A string description, not IS_A string, so from a pure OO point of
> > view, it should not inherit string.
>
> How did you decide it
> if not line:
> break
> print 'LINE:', line,
>
> If anyone can do it the more Pythonic way with some sort of iteration
> over stdout, please let me know.
>
> Jeff
You can use the sentinel form of iter():
for line in iter(stdout.readline, '&
tion, one of them woud
be more natural choice than the other.
> I trust my intuition on this, I just don't know how to justify it, or
> correct it if I'm wrong.
My intuition also happens to support subclassing string, but for practical
reasons rather than
conceptual.
George
--
http://mail.python.org/mailman/listinfo/python-list
, blah.. })
And this would be equivalent to shallow copy. Whether you need a deep copy
depends on what each
"blah" is. More specifically it depends on whether the values of the dictionary
are mutable or not
(the keys are known to be immutable anyway). If they are immutable, a shallow
copy is enough. If
not, check whether all dictionaries refer to the same values or separate copies
of the values. Only
in the latter case you need deep copy.
HTH,
George
--
http://mail.python.org/mailman/listinfo/python-list
Michael,
Since you are on this topic, do you (or anyone else) have any type of
"code-completion" mode for python in emacs?
Thanks
-george
-Original Message-
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Michael Hoffman
Sent: Tuesday, July 26, 2005 1:36 PM
Yeah I have used tags with java and c before and they are very nice. Its just
that, I have been trying to find something similar to JDE/PythonWinEditor code
completion for an emacs-python mode.
I will keep trying and thanks for the input.
-george
-Original Message-
From: [EMAIL
able=string.maketrans(badcars, replaceChar*len(badcars))
def translate(text):
return text.translate(table)
# bind any attributes you want to be accessible
# translate.badcars = badcars
# ...
return translate
tr = translateFactory()
tr("Hel\xfflo")
George
--
http://mail.python.org/mailman/listinfo/python-list
Paolino wrote:
> >>Even worse I get with methods and function namespaces.
> >
> > What is "even worse" about them?
> >
> For my thinking, worse is to understand how they derive their pattern
> from generic namespaces.
> Methods seems not to have a wr
this is the case, check the following valid (though
highly discouraged) example:
class X:
def __init__(self, x):
if isinstance(x,str):
self._s = x
else:
self._n = x
x1 = X("1")
x2 = X(1)
dir(x1)
['__doc__', '__init__', '__module__', '_s']
dir(x2)
['__doc__', '__init__', '__module__', '_n']
George
--
http://mail.python.org/mailman/listinfo/python-list
ss
class Y1(X):
pass
class Y2(X):
pass
class Z(Y1,Y2):
pass
>>> z = Z()
>>> z.__class__.__mro__
(, , ,
, )
Old style classes don't have __mro__, so you have to write it yourself;
in any case, writing old style classes in new code is discouraged.
George
--
I prefer epydoc http://epydoc.sourceforge.net. Granted it is an add on and uses
"LaTex'ish" flags in the comments, but the final doc is very clean.
-g
-Original Message-
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Jan Danielsson
Sent: Wednesday, August 10, 2005 11:18
argument to sorted will make it simpler::
>>> sorted(namelist, key=lambda x:int(x.rsplit('.')[-1]))
-- george
--
http://mail.python.org/mailman/listinfo/python-list
he (optional) renaming of the imported modules/classes I would guess:
# Hippo.py
import Crypto as PythonCrypto
class Crypto:
pass
h1 = PythonCrypto.Hash
h2 = Crypto.Hash# refers to Hippo.Crypto
HTH,
George
--
http://mail.python.org/mailman/listinfo/python-list
e.f_globals,
caller_locals, [name])
# extract 'C' from 'A.B.C'
attribute = name[name.rfind('.')+1:]
if hasattr(module,attribute):
caller_locals[attribute] = getattr(module,attribute)
#==
Or even better, forget about the braindead java restriction of one
class per file and organize your code as it makes more sense to you.
HTH,
George
--
http://mail.python.org/mailman/listinfo/python-list
"Terry Hancock" <[EMAIL PROTECTED]> wrote:
> On Tuesday 13 September 2005 12:46 pm, George Sakkis wrote:
> > Or even better, forget about the braindead java restriction of one
> > class per file and organize your code as it makes more sense to you.
>
> W
Another epileptic seizure on the keyboard. Apart from clue deficit
disorder, this guy seems to suffer from some serious anger management
problems...*plonk*
"Xah Lee" <[EMAIL PROTECTED]> wrote:
> Python Doc Problem Example
>
> Quote from:
> http://docs.python.org/lib/module-os.path.html
>
#x27;2/7/2005', ... ]
Get the dateutil package (https://moin.conectiva.com.br/DateUtil):
import dateutil.rrule as rrule
from datetime import date
mondays2005 = tuple(rrule.rrule(rrule.WEEKLY,
dtstart=date(2005,1,1),
count=52,
t;)
> a.addScore(newScore,name)
> a.showScores()
> continue
"continue" doesn't do anything at the line you put it. When do you want
your program to exit ? As it is, it will loop forever.
> Anything I could have done differently or any "bad-habits" you think I
> have which could lead to ultimate doom I really appreciate to know.
>
> TIA
HTH,
George
--
http://mail.python.org/mailman/listinfo/python-list
"Peter Hansen" <[EMAIL PROTECTED]> wrote:
> George Sakkis wrote:
> > "Chris" <[EMAIL PROTECTED]> wrote:
> >>Is there a way to make python create a list of Mondays for a given year?
> >
> > Get the dateutil package (https://moin.cone
x27;d', 'e', 'a', 'b']
>>> list(islice(cyclefrom('abcde', 5), 9))
['a', 'b', 'c', 'd', 'e', 'a', 'b', 'c', 'd']
"""
# chain the last part with the first one and cycle over it. Needs
# to replicate the iterable for consuming each part
it1,it2 = tee(iterable)
return cycle(chain(islice(it1, start, None), islice(it2, start)))
By the way, these generators seem general enough to make it to
itertools. Actually cyclefrom can be accomodated by adding the optional
start argument to itertools.cycle. What do you think ?
George
--
http://mail.python.org/mailman/listinfo/python-list
"Jordan Rastrick" <[EMAIL PROTECTED]> wrote:
> I've written this kind of iterator before, using collections.deque,
> which personally I find a little more elegant than the list based
> approach:
Nice, that's *much* more elegant and simple ! Here's the class-based version
with append; note that
i
(), **sort_kwds)
# sort files by directory
sorted_by_dir = sorted(top.files(), **sort_kwds) \
+ sum((sorted(dir.files(), **sort_kwds)
for dir in path(top).walkdirs()), [])
George
--
http://mail.python.org/mailman/listinfo/python-list
t?
If you would give a chance to a task-oriented intermediate to advanced book,
check the second
edition of the python cookbook. It has over 200 practical recipes, covers 2.3
and 2.4 and has taken
excellent reviews.
George
--
http://mail.python.org/mailman/listinfo/python-list
e IDLE do.
exec statement in name_space
will do the trick.
>>> d = {}
>>> exec 'foo=555' in d
>>> d['foo']
555
>>> exec "print foo" in d
555
- george
--
http://mail.python.org/mailman/listinfo/python-list
d-style classes like exceptions:
>
> py> e = NameError("global name 'foo' is not defined")
> py> type(e)
>
> py> type(e).__name__
> 'instance'
>
> For old-style classes, you'll need to go through __class__
>
> py> e.__class__
>
> py> e.__class__.__name__
> 'NameError'
>
> STeVe
To sum up:
def typename(obj):
try:
return obj.__class__.__name__
except AttributeError:
return type(obj).__name__
George
--
http://mail.python.org/mailman/listinfo/python-list
ly not, integers and floats
typically are; on the other
hand, complex numbers are usually not expected, even though mathematically they
are 'numeric'. In
this case, you can write something like:
def isNumeric(obj):
# consider only ints and floats numeric
return isinstance(obj
False
>
> Michael
>
> --
> Michael D. Hartl, Ph.D.
> Chief Technology Officer
> http://quarksports.com/
>
Huh ? What python version has this ? Surely not 2.3 and 2.4.
George
--
http://mail.python.org/mailman/listinfo/python-list
> George Sakkis wrote:
> > "Steven Bethard" <[EMAIL PROTECTED]> wrote in message
> > news:[EMAIL PROTECTED]
> >
> >>Is there a good way to determine if an object is a numeric type?
> >
> > In your example, what does your application consid
ay comparison works as of now is error-prone, to say the least.
Comparing ints with
strings is no more valid than adding them, and python (correctly) raises
TypeError for the latter,
but not for the former. For the record, here's the arbitrary and undocumented
(?) order among some
main builtin types:
>>> None < 0 == 0.0 < {} < [] < "" < ()
True
George
--
http://mail.python.org/mailman/listinfo/python-list
ed in knowing if such efforts are on. Apart from that
> also any input on EDA softwares using Python will be useful.
>
> regards,
> Vishal
>
GIYF (Google Is Your Friend):
http://www-cad.eecs.berkeley.edu/~pinhong/scriptEDA/
Regards,
George
--
http://mail.python.org/mailman/listinfo/python-list
.next()
except StopIteration: return False
else: return True
def all(pred, iterable):
try: dropwhile(pred,iterable).next()
except StopIteration: return True
else: return False
George
--
http://mail.python.org/mailman/listinfo/python-list
s are expected to be part of the package
in the source
directories" means that you cannot specify a sibling directory as package data,
so the easiest way
is to make "schemas" child of foo. If this is not possible, you may check the
'data_files' option
(http://www.python.org/doc/current/dist/node12.html).
George
--
http://mail.python.org/mailman/listinfo/python-list
pe testing
> (for example, writing "isinstance(f, file)").
> """
>
> ... which more accurately reflects what I believe the consensus is
> about the usage of open vs. file.
>
> --
> |>|\/|<
> /--\
> |David M. Cooke
> |cookedm(at)physics(dot)mcmaste
<[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED]
> Thank you Hans. Could you give me a simple sample of using inspect?
>
http://www.python.org/doc/current/lib/module-inspect.html
George
--
http://mail.python.org/mailman/listinfo/python-list
ost]
The Essence is irrelevant.
-
-
-
All your thread are belong to us.
-
-
-
George
--
http://mail.python.org/mailman/listinfo/python-list
u jump?
>
> jump:
>
> [EVALUATION] - E02 - Support for MinGW Open Source Compiler
> Essence:
> http://groups-beta.google.com/group/comp.lang.python/msg/5ba2a0ba55d4c102
Lol, this guy is hopeless :-)
George
--
http://mail.python.org/mailman/listinfo/python-list
Dave
After a little googling, that's what I found:
http://citeseer.nj.nec.com/article/prechelt00empirical.html
http://www.sensi.org/~ak/impit/studies/report.pdf
George
--
http://mail.python.org/mailman/listinfo/python-list
think).
>
> And, finally, when doing scientific stuff, I found IPython
> (http://ipython.scipy.org/) to be an invaluable tool. It's a much
> improved Python interpreter.
>
> Peace
> Bill Mill
> bill.mill at gmail.com
Using numpy, your example would be:
>>> from Numeric import array
>>> matrix = array([1.5, 4.3, 5.5])
>>> integer_matrix = matrix.astype(int)
George
--
http://mail.python.org/mailman/listinfo/python-list
201 - 300 of 1560 matches
Mail list logo