in groupby(sorted(cls.dArguments, key=truth), truth):
result[k].extend(g)
I like your initial attempt better.
P.S. I didn't realize until working out this example that extend
could consume an iterator.
--
Neil Cerutti
The word genius isn't applicable in football. A genius is a guy like Norman
Einstein
':
print SOME_CONST
if not do_something():
try_somethin_else()
That idiom is useful in modules for launching tests or examples
that should not be run when the module is imported.
--
Neil Cerutti
--
http://mail.python.org/mailman/listinfo/python-list
On 2007-10-26, Bruno Desthuilliers [EMAIL PROTECTED] wrote:
Neil Cerutti a écrit :
On 2007-10-25, Bruno Desthuilliers
[EMAIL PROTECTED] wrote:
The canonical case for small scripts is to have first all
functions and globals defined, then the main code protected by
a guard, ie:
There's
, os.R_OK | os.W_OK | os.X_OK)
which explicitly (rather than implicitly) spells it out?
And the equivalent of ``os.chmod(filename, 0777)`` looks like what!?
os.chmod(filename, int('777', 8))
It's good enough for most other bases. ;)
--
Neil Cerutti
--
http://mail.python.org/mailman/listinfo
32 bit (Intel)] on
win32
Type help, copyright, credits or license for more information.
import timeit
timeit.Timer('len(seq)', 'seq = range(100)').timeit()
0.20332271187463391
timeit.Timer('seq.__len__()', 'seq = range(100)').timeit()
0.48545737364457864
--
Neil Cerutti
--
http
, post_transaction
fred_balance, fred_post = account(1500)
joe_balance, joe_post = account(12)
fred_post(20)
joe_post(-10)
fred_balance()
1520
joe_balance()
2
Python classes will of course nearly always win, though the idiom
looks like it might be faster (I don't have Python 3000 to try it
out).
--
Neil
On 2007-10-30, Jean-Paul Calderone [EMAIL PROTECTED] wrote:
On Tue, 30 Oct 2007 15:25:54 GMT, Neil Cerutti [EMAIL PROTECTED] wrote:
On 2007-10-30, Eduardo O. Padoan [EMAIL PROTECTED] wrote:
This is a FAQ:
http://effbot.org/pyfaq/why-does-python-use-methods-for-some-functionality-e-g-list-index
On 2007-10-30, George Sakkis [EMAIL PROTECTED] wrote:
On Oct 30, 11:25 am, Neil Cerutti [EMAIL PROTECTED] wrote:
On 2007-10-30, Eduardo O. Padoan [EMAIL PROTECTED] wrote:
This is a FAQ:
http://effbot.org/pyfaq/why-does-python-use-methods-for-some-function...
Holy Airy Persiflage Batman
On 2007-10-31, George Sakkis [EMAIL PROTECTED] wrote:
On Oct 31, 8:44 am, Neil Cerutti [EMAIL PROTECTED] wrote:
On 2007-10-30, George Sakkis [EMAIL PROTECTED] wrote:
On Oct 30, 11:25 am, Neil Cerutti [EMAIL PROTECTED] wrote:
On 2007-10-30, Eduardo O. Padoan [EMAIL PROTECTED] wrote
any
methods at all).
Thanks for the interesting note. I didn't know that tuples
originally had no methods. That made len mandatory, I suppose.
--
Neil Cerutti
The Pastor would appreciate it if the ladies of the congregation would lend
him their electric girdles for the pancake breakfast next
implementation mechanism. That is
missing the point of closures.
It really depends on how wide your definition of primitive object
system is. Can you come up with a use-case for nonlocal that
doesn't appear to be a primitive object system?
--
Neil Cerutti
To succeed in the world it is not enough
On 2007-11-01, nico [EMAIL PROTECTED] wrote:
The following example returns a string type, but I need a tuple...
var = (Hello)
print type(var)
type 'str'
I need that for a method parameter.
var = hello,
--
Neil Cerutti
--
http://mail.python.org/mailman/listinfo/python-list
for Python?
I believe IPython can do this:
http://ipython.scipy.org/moin/
IPython's syntax coloring doesn't work with Windows 2000 and up,
since (last I checked) it relies on a readline.py file, which
relies on ANSI.SYS, which is not supported by the Windows
console.
--
Neil Cerutti
--
http
On 2007-11-01, Chris Mellon [EMAIL PROTECTED] wrote:
On Nov 1, 2007 3:01 PM, Neil Cerutti [EMAIL PROTECTED] wrote:
On 2007-11-01, Lee Capps [EMAIL PROTECTED] wrote:
On Nov 1, 2007, at 1:45 PM, braver wrote:
Greetings -- as a long time user of both Python and Ruby
interpreters, I got used
and every variable be a
field of that module?
You are almost correct. Every identifier/name in Python is
conceptually an attribute of an object. But identifiers in Python
are not typed. It is the objects that they refer to that are
typed.
--
Neil Cerutti
--
http://mail.python.org/mailman/listinfo
On 2007-11-02, Tim Golden [EMAIL PROTECTED] wrote:
Neil Cerutti wrote:
On 2007-11-01, Chris Mellon [EMAIL PROTECTED] wrote:
On Nov 1, 2007 3:01 PM, Neil Cerutti [EMAIL PROTECTED] wrote:
On 2007-11-01, Lee Capps [EMAIL PROTECTED] wrote:
On Nov 1, 2007, at 1:45 PM, braver wrote:
Greetings
(Word(alphas)) + Literal('end')
Is there not an ambiguity in the grammar?
In EBNF:
goal -- WORD { WORD } END
WORD is '[a-zA-Z]+'
END is 'end'
I think it is fine that PyParsing can't guess what the composer
of that grammar meant.
--
Neil Cerutti
--
http://mail.python.org/mailman/listinfo
On 2007-11-04, Just Another Victim of the Ambient Morality
[EMAIL PROTECTED] wrote:
Neil Cerutti [EMAIL PROTECTED] wrote in message
news:[EMAIL PROTECTED]
On 2007-11-03, Paul McGuire [EMAIL PROTECTED] wrote:
On Nov 3, 12:33 am, Just Another Victim of the Ambient Morality
[EMAIL PROTECTED
On 2007-11-04, Kay Schluehr [EMAIL PROTECTED] wrote:
On 4 Nov., 03:07, Neil Cerutti [EMAIL PROTECTED] wrote:
I wouldn't characterize it as pretending. How would you parse:
hello end hello end
WORD END WORD END and WORD WORD WORD END are both valid
interpretations, according to the grammar
.
--
Neil Cerutti
--
http://mail.python.org/mailman/listinfo/python-list
On 2007-11-04, Just Another Victim of the Ambient Morality
[EMAIL PROTECTED] wrote:
Neil Cerutti [EMAIL PROTECTED] wrote in message
news:[EMAIL PROTECTED]
I believe there's no cure for the confusion you're having except
for implementing a parser for your proposed grammar.
Alternatively, try
On 2007-11-05, Just Another Victim of the Ambient Morality [EMAIL PROTECTED]
wrote:
Neil Cerutti [EMAIL PROTECTED] wrote in message
news:[EMAIL PROTECTED]
On 2007-11-04, Just Another Victim of the Ambient Morality
[EMAIL PROTECTED] wrote:
Neil Cerutti [EMAIL PROTECTED] wrote in message
circumstances compared to other well-known
algotithms that you can't practically wait for an answer. Would
you consider bubble-sort a suitable general-purpose sorting
algorithm for Python?
--
Neil Cerutti
--
http://mail.python.org/mailman/listinfo/python-list
On 2007-11-05, Neil Cerutti [EMAIL PROTECTED] wrote:
def Ack(x, y):
The Ackermann function. Creates a humongous mess even
with quite tiny numbers.
if x 0 or y 0:
raise ValueError('non-negative integer')
elif x == 0:
return y + 1
elif y == 0
On 2007-11-05, Just Another Victim of the Ambient Morality
[EMAIL PROTECTED] wrote:
Neil Cerutti [EMAIL PROTECTED] wrote in message
news:[EMAIL PROTECTED]
There are different kinds of recursion. Compare:
While interesting, none of this actually addresses the
point I was making. I
ambiguous grammar without
trouble. It is not as convenient or as well documented as
PyParsing, but the parsing algorithm provides the power you're
looking for. It might serve as a backend for the library you're
currently working on.
http://www.cpsc.ucalgary.ca/~aycock/spark/
--
Neil Cerutti
a while loop and manual index
instead of an iterator, preallocate your list, e.g.,
[None]*1, and hope they don't have blasters!
--
Neil Cerutti
--
http://mail.python.org/mailman/listinfo/python-list
On 2007-11-07, Just Another Victim of the Ambient Morality
[EMAIL PROTECTED] wrote:
Neil Cerutti [EMAIL PROTECTED] wrote in message
news:[EMAIL PROTECTED]
You might be interested in the Early parsing algorithm. It is
more efficient than the naive approach used in your prototype,
and still
to go.
Python's library support for binary search trees consists of the
bisect module.
--
Neil Cerutti
Ask about our plans for owning your home --sign at mortgage company
--
http://mail.python.org/mailman/listinfo/python-list
proliferate.
--
Neil Cerutti
--
http://mail.python.org/mailman/listinfo/python-list
into the function as well.
I think lists are called arrays in C++. I don't know what the
set equivalent is though.
It is called set, oddly enough. ;)
There's an overload of the set::insert function that takes a
couple of iterators that will serve for Python's update method.
--
Neil Cerutti
--
http
at the Python library... sys.stdout.write(),
if following Law of Demeter would turn into:
myStdout = sys.getStdout()
myStdout.write()
The Law of Demeter doesn't apply to that example.
--
Neil Cerutti
--
http://mail.python.org/mailman/listinfo/python-list
On 2007-11-16, Robin Becker [EMAIL PROTECTED] wrote:
Neil Cerutti wrote:
...
see why.
You are no longer making m copies of active_nodes.
my profiling indicated that the main problem was the removes.
Yeah, I should've added, for one thing. I'm glad Chris
correctly pointed out
.
for i in xrange(m):
...
saved_nodes = []
for A in active_nodes[:]:
..
if not cond:
saved_nodes.append(A)
..
active_nodes = saved_nodes
.
--
Neil Cerutti
Sermon Outline: I. Delineate your fear II
On 2007-11-16, Neil Cerutti [EMAIL PROTECTED] wrote:
Instead, filter your list. It looks like you can't use filter
directly, so just do it manually.
for i in xrange(m):
...
saved_nodes = []
for A in active_nodes[:]:
I meant to remove the slice. That line should
language.
--
Neil cerutti
--
http://mail.python.org/mailman/listinfo/python-list
this, then?',
'Do you want to come back to my place?'])
--
Neil Cerutti
--
http://mail.python.org/mailman/listinfo/python-list
greatest to
lowest, which would make a linear search fast, but unfortunately
it would slow down removing probabilities.
--
Neil Cerutti
I make love to pressure. --Stephen Jackson
--
http://mail.python.org/mailman/listinfo/python-list
you'd also have to define
x[::2] = 'aaa'
as resulting in
['a', 1, 'a', 2, 'a', 3, 5, 7, 9]
But perhaps that's just adding more useless complexity to the
already complex slicing rules (kudos for 'slice.indices', though
curses that the method isn't cross-referenced in more places).
--
Neil
On 2007-11-20, Terry Reedy [EMAIL PROTECTED] wrote:
Neil Cerutti [EMAIL PROTECTED] wrote in message
news:[EMAIL PROTECTED]
| s[i:j:t] = t (1) t must have the same length as the slice it is
replacing.
This is essentially the same rule as requiring a proper length
of t for
a,b,c = t
= File.open(jopa)
= #File:jopa
f.read()
= jopa\n
f.eof
= true
Is there a Python analog?
Yes.
f = file('jopa')
f.read()
'jopa\n'
...and in both Ruby and Python you are at EOF by definition.
There's no need to check.
--
Neil Cerutti
--
http://mail.python.org/mailman/listinfo/python-list
to ask
about certain control flow equivalents. And comparisons will
always be good. :)
Language comparisons are sometimes good. They are best when
they are free of FUD.
--
Neil Cerutti
--
http://mail.python.org/mailman/listinfo/python-list
useful source of
confusion.
--
Neil Cerutti
--
http://mail.python.org/mailman/listinfo/python-list
and removes the need to wrap it.
7return math.sqrt(.x * .x + .y * .y + .z * .z)
+1 Readability counts, even on small screens.
-1 Refactoring is a more expedient response than language
redesign.
def sum_of_squares(*args):
return sum(arg*args for arg in args)
--
Neil Cerutti
--
http
is not \n-terminated?
Nothing bad happens as far as I know, but it may depend on the
underlying clib.
--
Neil Cerutti
--
http://mail.python.org/mailman/listinfo/python-list
-- not a completely new model.
There are more differences than similarities. Pointers are are a
low-level mechanism suitable for many purposes, referencing
values amongst them. Python identifiers are a high-level
machanism, suitable for only one purpose.
--
Neil Cerutti
--
http://mail.python.org
the time,
until I learned that in ABC, one of Python's precursors, you had
to use '__anInstanceOf_This_TYPE_or_Maybe_A__SubClassOfItInstead_arg0_'.
--
Neil Cerutti
Sermon Outline: I. Delineate your fear II. Disown your fear III. Displace your
rear --Church Bulletin Blooper
--
http
code and language implementations will get you nowhere
most of the time.
Hint 2: regular expressions and Python strings use the same
escape character.
Hint 3: Consult the Python documentation about raw strings, and
what they are meant for.
--
Neil Cerutti
--
http://mail.python.org/mailman
On 2007-11-28, hdante [EMAIL PROTECTED] wrote:
On Nov 28, 1:42 pm, Neil Cerutti [EMAIL PROTECTED] wrote:
On 2007-11-28, hdante [EMAIL PROTECTED] wrote:
On Nov 28, 1:09 am, Steven D'Aprano
[EMAIL PROTECTED] wrote:
On Tue, 27 Nov 2007 10:21:36 -0800, hdante wrote:
Python variables
:
quotelist.append(quote)
qfile.close()
sigfile = file(sigpath, w)
sigfile.write(-- \n)
sigfile.write(Neil Cerutti\n)
random.seed()
if random.choice([True, False]):
quote = random.choice(quotelist)
for line in textwrap.wrap(quote, 78):
sigfile.write(line)
sigfile.write('\n')
sigfile.close
On 2007-11-28, Neil Cerutti [EMAIL PROTECTED] wrote:
import textwrap
import random
import os
print Sigswap v0.4
[...]
Yikes!
That program was in dire need of Pythonification. It must have
been written early in my Pythonology.
--
Neil Cerutti
--
http://mail.python.org/mailman/listinfo
on each of the elements) and then pass
it onto something else that expects and iterable. I'm pretty
sure this something else doesn't need a list, either, and just
wants to iterate over elements.
Try itertools.imap.
something_else(imap(do_operation, an_iterable))
--
Neil Cerutti
You've got to take
update the value of a in C? I tried (greatly
simplified):
You cannot do it. You'll have to insist on a boxed value of some
kind, like one stored in a list or an object.
Python equivalent:
def foo(x):
... x[0] = 'foo'
...
a = [0]
foo(a)
a
['foo']
--
Neil Cerutti
--
http://mail.python.org
the above would be something like:
my_print(Error Squeezing %s... % the_thingy)
With my_print defined appropriately for the time and place.
Moreover, publishing code today with print(...) will, at best,
require a needless digression.
--
Neil Cerutti
--
http://mail.python.org/mailman/listinfo
in the side-effect. Anyhow,
Pythonistas know it should've been called C+=1.
--
Neil Cerutti
--
http://mail.python.org/mailman/listinfo/python-list
as a
scientist, but as the most important one who ever lived.
To paraphrase Bertrand Russell, Newton was too successful.
Over-veneration of Newton was eventually an impediment to
progress--this was not, of course, his fault.
--
Neil Cerutti
--
http://mail.python.org/mailman/listinfo/python-list
response, but failed. Others jumped in to
fill the gap, and well... things progressed from there.
But your opinion is noted. ;)
--
Neil Cerutti
--
http://mail.python.org/mailman/listinfo/python-list
is that it
doesn't explain how to come up with theories. You need luck,
genius, or both. The same applies to language naming. There's no
theory of good language names (except for a short list of
don'ts); you have to attempt it and see what happens.
--
Neil Cerutti
--
http://mail.python.org/mailman/listinfo
, key=itemgetter(1))
print minimum =, min(table, key=itemgetter(1))
--
Neil Cerutti
--
http://mail.python.org/mailman/listinfo/python-list
for
strings--oh never mind).
--
Neil Cerutti
--
http://mail.python.org/mailman/listinfo/python-list
On 2007-12-05, Tim Chase [EMAIL PROTECTED] wrote:
http://docs.python.org/lib/module-textwrap.html
The Python library has already done all the heavy lifting--no
need to re-invent the wheel.
Well no, clearly we need xwrap methods and a ctextwrap module. ;)
--
Neil Cerutti
--
http
:
rval.append(a[aix])
aix += 1
while bix bstop:
rval.append(b[bix])
bix += 1
return rval
It should beat ResortEverything consistently once the lists
become larger than a certain size. Do you get better results at
all with the above function?
--
Neil Cerutti
The audience
.
. . .
I'm beginning to think
a sorted list merger might make a nice tiny extension module
(at least for my purposes).
See recipes:
http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/491285
http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/305269
That's fairly awesome.
--
Neil
On 2007-12-06, Neil Cerutti [EMAIL PROTECTED] wrote:
It should beat ResortEverything consistently once the lists
become larger than a certain size. Do you get better results at
all with the above function?
With psyco, my merge_sorted becamse faster than relying on
timsort at roughly 80
On 2007-12-06, Aaron Watters [EMAIL PROTECTED] wrote:
On Dec 6, 2:14 pm, Neil Cerutti [EMAIL PROTECTED] wrote:
On 2007-12-06, Raymond Hettinger [EMAIL PROTECTED] wrote:
See recipes:
http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/491285
http://aspn.activestate.com/ASPN/Cookbook
. Looks like I stuck, however.
You have to implement only the operations you actually use. So to
save yourself drudge-work, use fewer operations. ;-)
--
Neil Cerutti
--
http://mail.python.org/mailman/listinfo/python-list
) of course) csv
reader/writer... before realizing there was such a thing as the
csv module :-/
Should have known better...
But probably it has made you a better person. ;)
--
Neil Cerutti
--
http://mail.python.org/mailman/listinfo/python-list
factors in deciding the tipping point are: clarity,
simplicity, and extensibility. ... The THREE major tipping point
factors ARE: clarity, simplicity, extensibility. And efficiency.
Among the many factors in deciding the tipping point are: (etc.,
etc.)
--
Neil Cerutti
--
http://mail.python.org/mailman
On 2007-12-07, Duncan Booth [EMAIL PROTECTED] wrote:
Neil Cerutti [EMAIL PROTECTED] wrote:
On 2007-12-07, Duncan Booth [EMAIL PROTECTED] wrote:
from __future__ import with_statement
def loaddomainowners(domain):
with open('/etc/virtual/domainowners','r') as infile:
I've been thinking
On 2007-12-07, Duncan Booth [EMAIL PROTECTED] wrote:
from __future__ import with_statement
def loaddomainowners(domain):
with open('/etc/virtual/domainowners','r') as infile:
I've been thinking I have to use contextlib.closing for
auto-closing files. Is that not so?
--
Neil Cerutti
verboseness of usage messages with setting exit codes
with calling the exit function seems a little bizarre.
But I believe optparse will handle parsing arguments and printing
usage messages, though not, I think, setting verbosity levels and
exiting the program.
--
Neil Cerutti
--
http
explain.
--
Neil Cerutti
--
http://mail.python.org/mailman/listinfo/python-list
?
--
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
and immutable objects that's the root
of your current confusion.
--
Neil Cerutti
--
http://mail.python.org/mailman/listinfo/python-list
as much is 1.2.1: Built-In Functions.
--
Neil Cerutti
--
http://mail.python.org/mailman/listinfo/python-list
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
on solving the problem completely with a binary search returning
a range (I'm not sure of the name), which would be more expensive
at run time, but might be fast enough, and would use a minimal
amount of 'resources'.
--
Neil Cerutti
--
http://mail.python.org/mailman/listinfo/python-list
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
(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' nodes would be (with 'e'
| referenced in the 'h' node
experience with Excel-related mistakes leads me to think that
column one contains dates that got somehow misformatted on
export.
--
Neil Cerutti
--
http://mail.python.org/mailman/listinfo/python-list
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).
--
Neil Cerutti
The doctors X-rayed my head and found nothing. --Dizzy Dean
' 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 analyze.
Try adding *more* backslashes. Sometimes, it's the only way. ;)
--
Neil Cerutti
There are two
[follow_end:end],
elem))
else:
return %s /%s % (elem, get_tree(text, tail))
--
Neil Cerutti
--
http://mail.python.org/mailman/listinfo/python-list
..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 mellifluous appellation.
--
Neil Cerutti
--
http://mail.python.org/mailman/listinfo
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 details). It's working now::
tree = xmltools.text_and_spans_to_etree('aaa aaa
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 parents
* the non-recursive part assigns text
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
implementing a browser take forever. ;)
--
Neil Cerutti
Potluck supper: prayer and medication
prefer, f.readlines(delim='') etc., a la C++
str::getline.
--
Neil Cerutti
--
http://mail.python.org/mailman/listinfo/python-list
and j preferable to overly generic terms like item.
--
Neil Cerutti
--
http://mail.python.org/mailman/listinfo/python-list
inputs and outputs.
--
Neil Cerutti
--
http://mail.python.org/mailman/listinfo/python-list
On 2007-06-06, Bruno Desthuilliers
[EMAIL PROTECTED] wrote:
Neil Cerutti a écrit :
On 2007-06-04, Michael Hoffman [EMAIL PROTECTED] wrote:
Wildemar Wildenburger wrote:
I agree with Bruno that i and j should be used only for
indices, but I'm usually less terse than that.
I find i and j
module.
--
Neil Cerutti
Beethoven wrote fewer symphonies than Haydn and Mozart because he wrote
longer, and besides he went death. --Music Lit Essay
--
http://mail.python.org/mailman/listinfo/python-list
On 2007-06-06, Josiah Carlson [EMAIL PROTECTED] wrote:
Neil Cerutti wrote:
On 2007-06-06, rhXX [EMAIL PROTECTED] wrote:
and/or
- SORTED - INSERT in the correct place using some criteria?
Consult the Python Docs about the heapq module.
Heaps (as produced by heapq) are not sorted
.
The 'other' program is called 'new.py'. Is that what's causing
my problem?
--
Neil Cerutti
--
http://mail.python.org/mailman/listinfo/python-list
On 2007-06-07, Robin Becker [EMAIL PROTECTED] wrote:
BartlebyScrivener wrote:
On Jun 7, 8:17 am, Neil Cerutti [EMAIL PROTECTED] wrote:
A good habit for naming your scripts: If you have a script and you
want to name it text.py, or list.py or new.py or old.py or some common
name
On 2007-06-07, Stebanoid [EMAIL PROTECTED] wrote:
if you have a list of functions you can try this:
import random
import math
m[int(math.floor(len(m)*random.random()))]() # seems like Lisp
Or rather m[random.randint(0, len(m))]()
--
Neil Cerutti
Caution: Cape does not enable user to fly
On 2007-06-07, Dustan [EMAIL PROTECTED] wrote:
On Jun 7, 1:30 pm, Neil Cerutti [EMAIL PROTECTED] wrote:
On 2007-06-07, Stebanoid [EMAIL PROTECTED] wrote:
if you have a list of functions you can try this:
import random
import math
m[int(math.floor(len(m)*random.random()))]() # seems
On 2007-06-08, Bruno Desthuilliers [EMAIL PROTECTED] wrote:
Neil Cerutti a écrit :
On 2007-06-06, Bruno Desthuilliers
[EMAIL PROTECTED] wrote:
Neil Cerutti a écrit :
On 2007-06-04, Michael Hoffman [EMAIL PROTECTED] wrote:
Wildemar Wildenburger wrote:
I agree with Bruno that i and j should
On 2007-06-08, Stebanoid [EMAIL PROTECTED] wrote:
On 8, 00:07, Dustan [EMAIL PROTECTED] wrote:
On Jun 7, 1:30 pm, Neil Cerutti [EMAIL PROTECTED] wrote:
On 2007-06-07, Stebanoid [EMAIL PROTECTED] wrote:
if you have a list of functions you can try this:
import random
import math
201 - 300 of 1188 matches
Mail list logo