On Tue, 03 Nov 2015 19:04:23 -0700, Michael Torrie wrote:
> On 11/03/2015 05:33 PM, rurpy--- via Python-list wrote:
>> I consider regexs more fundemental. One need not even be a programmer
>> to use them: consider grep, sed, a zillion editors, database query
>> languages, etc.
>
> Grep can use
On Thu, 05 Nov 2015 19:36:11 -0800, Larry Hudson wrote:
> Anyone besides me remember the CP/M editor Mince (Mince Is Not
> Complete EMACS)? It was an emacs-like editor, without any e-Lisp or
> other way of extending it. I believe it was my first exposure to a
> screen-oriented editor. I quite l
On Fri, 13 Jun 2014 17:17:06 +0200, BrJohan wrote:
> Or to put the namevariants in some sequence of sets having elements
> like: ("Kristina", "Christina", "Cristine", "Kristine")
> Matching is then just applying the 'in' operator.
That's definitely a better approach, for the reasons you mention
On Sun, 15 Jun 2014 22:17:57 -0400, Roy Smith wrote:
> I don't believe HandGrenade implements throw(). It does, however,
> implement lobbeth().
And therein lies the problem with Object Oriented Programming:
instances of HandGrenade neither throw nor lobbeth.
One, Two, Five'ly yours,
Dan
--
htt
On Sun, 06 Jul 2014 09:27:59 +1000, Chris Angelico wrote:
> How often do you ever have multiple consecutive blank lines? My
> newlines are either single (line end) or in pairs (one blank line),
> and I don't remember having anything else (at least, not
> intentionally). Greater separation than a b
On Mon, 07 Jul 2014 11:00:59 +1000, Ben Finney wrote:
> The makefile syntax is one of the excellent examples of why it's a
> terrible idea to use tab characters in source code. It's also an
> excellent example of how a poor design decision (a line beginning with
> U+0020 SPACE is semantically diff
On Thu, 04 Sep 2014 15:17:17 +1000, Chris Angelico wrote:
> On Thu, Sep 4, 2014 at 9:39 AM, MRAB wrote:
>> The key of a dict could also be int, float, or tuple.
>
> Yes! Yes! DEFINITELY do this!! Ahem. Calm down a little, it's not that
> outlandish an idea...
Using floats is a bad idea. Consi
On Thu, 08 Sep 2011 10:29:26 +1000, Steven D'Aprano wrote:
> I suppose "one class per file" might be useful for those using an editor
> with no search functionality. Other than that, is there any
> justification for this rule? Any Java fans want to defend this?
Back in the dark ages known as the
On Wed, 16 Nov 2011 17:57:27 +0100, Frederic Rentsch wrote:
> I'd like to log MySQL errors. If I do:
>
> try: (command)
> except MySQLdb.OperationalError, e: print e
>
> I may get something like:
>
> (1136, "Column count doesn't match value count at row 1")
>
> If I don't kno
On Wed, 28 Dec 2011 22:54:16 +, Steven D'Aprano wrote:
> On Wed, 28 Dec 2011 11:36:17 -0800, Rick Johnson wrote:
>
>> The point is people, we should be using string delimiters that are
>> ANYTHING besides " and '. Stop being a sheep and use your brain!
>
> "ANYTHING", hey?
>
> I propose we
On Wed, 04 Jan 2012 13:37:24 +1100, Chris Angelico wrote:
> And "import pickle" objectifies pickles ...
Not quite: "import pickle" merely readies the machinery that objectifies
pickles. In order to objectify a pickle, you have to call pickle.loads:
>>> import pickle # get ready to objectify
On Sun, 22 Jan 2012 05:25:25 +, Steven D'Aprano wrote:
> Or they've been writing Python code since before version 2.2 when True
> and False were introduced, and so they are used to the "while 1" idiom
> and never lost the habit.
That would be me.
As per a now-ancient suggestion on this maili
On Mon, 01 Apr 2013 21:45:30 -0700, Tim Roberts wrote:
> morphex wrote:
>>
>>While we're on the subject, wouldn't it be nice to have some cap there
>>so that it isn't possible to more or less block the system with large
>>exponentiation?
>
> There IS a cap. It's called the "MemoryError" excepti
s grayed out.
> Does anyone have any ideas?
You may have to "bundle" your app -- i.e., create the whole
application.app structure -- rather that just run the python program
from within a shell. Cocoa looks for a bunch of resources in standard
places before it will let your app inter
the PC world?
It can be like falling off a log in the Linux world.
Regards,
Dan
--
Dan Sommers
<http://www.tombstonezero.net/dan/>
--
http://mail.python.org/mailman/listinfo/python-list
er to get only
> the piece of zen knowledge you need.
That's just wrong. [throws hands and arms up in [mock] disgust]
Enlightenment does not come in discrete pieces, to be learned one at a
time, to be applied selectively.
Regards,
Dan
--
Dan Sommers
<http://www.tombstonezero.net/d
ad for
> each, or is there some other way I can listen on two sockets at once
> (maybe non-blocking ones?)
Try the select module:
http://www.python.org/doc/current/lib/module-select.html
Regards,
Dan
--
Dan Sommers
<http://www.tombstonezero.net/dan/>
--
http://mail.python.org/mailman/listinfo/python-list
instead:
result = reTest(True)
[ rest of example snipped ]
HTH,
Dan
--
Dan Sommers
<http://www.tombstonezero.net/dan/>
--
http://mail.python.org/mailman/listinfo/python-list
d language" ...
So does <http://www.python.org/doc/Summary.html>.
Regards,
Dan
--
Dan Sommers
<http://www.tombstonezero.net/dan/>
--
http://mail.python.org/mailman/listinfo/python-list
o set a
variable and not export it, which means that echo works but nothing else
does.
Regards,
Dan
--
Dan Sommers
<http://www.tombstonezero.net/dan/>
--
http://mail.python.org/mailman/listinfo/python-list
age and then erase it
> (again, using Disk Utility) and put UFS on it. You'll find that
> "touch foo FOO" will create two files.
You may also find some native Mac OS X applications failing in strange
ways.
Regards,
Dan
--
Dan Sommers
<http://www.tombstonezero.net/dan/>
--
http://mail.python.org/mailman/listinfo/python-list
that
> effect.
That would eliminate eval and exec, too.
Regards,
Dan
--
Dan Sommers
<http://www.tombstonezero.net/dan/>
--
http://mail.python.org/mailman/listinfo/python-list
idx = lst; _idx < lst + NLST; ++_idx ) {
int *i;
i = *_idx;
/* compare "the item to which i is bound" to "a constant" */
if( *i == *(&_i2) )
/* rebind i to _i4 */
i = &_i4;
}
> for (_idx = 0; _idx < NLST; ++_idx)
> printf("%d\n"
this
> entire URL (or even just the bit after the question mark) ...
import os
query_string = os.environ['QUERY_STRING']
HTH,
Dan
--
Dan Sommers
<http://www.tombstonezero.net/dan/>
--
http://mail.python.org/mailman/listinfo/python-list
On Thu, 05 Jan 2006 14:28:51 +0100,
David Murmann <[EMAIL PROTECTED]> wrote:
> Dan Sommers schrieb:
>> int **_idx;
>> for( _idx = lst; _idx < lst + NLST; ++_idx ) {
>> int *i;
>> i = *_idx;
>> /* compare "the item to which i is bound" to &quo
],'dict_'+devDictName]
Put the dictionaries you create into another dictionary instead:
devDict = { }
key = item[5].replace(' ','+')
devDict[key] = {'Group':item[2],
'Status':item[3], # etc.
}
HTH,
Dan
--
Dan Sommers
<http://www.tombstonezero.net/dan/>
--
http://mail.python.org/mailman/listinfo/python-list
asy to call them from within the dictionary.
The names of the child dictionaries exist as keys in the parend
dictionary.
> - also, they dictionary will be dynamic, thus the # of devices is
> always changing so they need to be created on-the-fly.
Yes, child dictionaries can be creat
oats, tuples, etc can be keys on
> initialization ...
That has nothing to do with your code:
>>> dict(1=4)
SyntaxError: keyword can't be an expression
>>> int(4=5)
SyntaxError: keyword can't be an expression
The names of keyword arguments have look like Python identif
On Fri, 13 Jan 2006 17:09:13 +,
Tom Anderson <[EMAIL PROTECTED]> wrote:
> Ah, of course - to an true believer, emacs *is* the unix toolset.
> :)
To the true believer, unix runs under emacs.
Regards,
Dan
--
Dan Sommers
<http://www.tombstonezero.net/dan/>
--
http://mail.
to Chapter 12, <http://www.lisp.org/HyperSpec/Body/chap-12.html>.
Regards,
Dan
--
Dan Sommers
<http://www.tombstonezero.net/dan/>
--
http://mail.python.org/mailman/listinfo/python-list
n though it *does* indeed work).
The __init__ method is an *initializer*, *not* a constructor. By the
time __init__ runs, the object has already been constructed; __init__
just does extra initialization.
Regards,
Dan
--
Dan Sommers
<http://www.tombstonezero.net/dan/>
--
http://mail.python.org/mailman/listinfo/python-list
bar"]
class A:
if "foo" in allow:
def foo( ):
...
if "bar" in allow:
def bar( ):
...
> Don't ask why I would need such a strange animal ...
Consider yourself not asked.
HTH,
Dan
--
Dan Sommers
<http://www.tombstonezero.net/dan/>
--
http://mail.python.org/mailman/listinfo/python-list
it magically appear and disappear).
By the principle of least surprise, if dir(some_sobject) contains foo,
then some_object.foo should *not* raise a NameError.
All of the posted solutions to the OP's problem could easily be extended
to do something noisy with the (dis-)allowed methods.
Regards,
Dan
--
Dan Sommers
<http://www.tombstonezero.net/dan/>
--
http://mail.python.org/mailman/listinfo/python-list
print pwd.getpwnam( unix_user_name )
except KeyError:
print unix_user_name, 'does not exist'
There's a grp module for making similar queries against /etc/group (or
the modern equivalent thereof).
Regards,
Dan
--
Dan Sommers
<http://www.tombstonezero.net/dan/>
--
http://mail.python.org/mailman/listinfo/python-list
achine by examining attributes of its argument).
And then there are (or should be!) purists who will claim that if your
state machine requires information to be shared between states, then you
don't have enough states! ;-)
> We want a goto.
No, we don't.
Regards,
Dan
--
Dan Sommers
<
sy for platform dependencies to sneak in without being caught.
Regards,
Dan
--
Dan Sommers
<http://www.tombstonezero.net/dan/>
"I wish people would die in alphabetical order." -- My wife, the genealogist
--
http://mail.python.org/mailman/listinfo/python-list
On Fri, 28 Jul 2006 13:03:25 +0200,
Sybren Stuvel <[EMAIL PROTECTED]> wrote:
> Dan Sommers enlightened us with:
>> We just did that at work (developed on the corporate-issued non-Unix
>> computers and then deployed on a Linux box), and had no problems at
>> all. In
gt; value '3e25960a79dbc69b674cd4ec67a72c62'. Is that possible? I've looked
> for initialization options in the documentation and searched c.l.p.,
> but no luck.
According to http://docs.python.org/lib/module-md5.html, you want the
copy method of your existing md5 object.
Rega
s, form letters, source
> code, whatever.
And don't forget Python's Template class:
http://docs.python.org/lib/node109.html
Regards,
Dan
--
Dan Sommers
<http://www.tombstonezero.net/dan/>
"I wish people would die in alphabetical order." -- My wife, the genealogist
--
http://mail.python.org/mailman/listinfo/python-list
if counter == n:
print
counter = 0
Regards,
Dan
--
Dan Sommers
<http://www.tombstonezero.net/dan/>
"I wish people would die in alphabetical order." -- My wife, the genealogist
--
http://mail.python.org/mailman/listinfo/python-list
On 15 Aug 2006 18:33:51 -0700,
"John Machin" <[EMAIL PROTECTED]> wrote:
> Dan Sommers wrote:
>>
>> counter = 0
>> for an_element in the_list:
>> print an_element,
>> counter = counter + 1
>> if counter == n:
>> print
>> coun
doing anything special; nans have [the equivalent
of] an __eq__ method that always returns False.
Regards,
Dan
--
Dan Sommers
<http://www.tombstonezero.net/dan/>
"I wish people would die in alphabetical order." -- My wife, the genealogist
--
http://mail.python.org/mailman/listinfo/python-list
rmation, and the web addresses in the source
code aren't available, so I hesitate to post my ancient copy.)
HTH,
Dan
--
Dan Sommers
<http://www.tombstonezero.net/dan/>
"I wish people would die in alphabetical order." -- My wife, the genealogist
--
http://mail.python.org/mailman/listinfo/python-list
better with grep and a decent REPL.)
Regards,
Dan
--
Dan Sommers
<http://www.tombstonezero.net/dan/>
"I wish people would die in alphabetical order." -- My wife, the genealogist
--
http://mail.python.org/mailman/listinfo/python-list
lass D(C):
pass
Why do you want to change a class' base class during runtime?
HTH,
Dan
--
Dan Sommers
<http://www.tombstonezero.net/dan/>
"I wish people would die in alphabetical order." -- My wife, the genealogist
--
http://mail.python.org/mailman/listinfo/python-list
s(text))
The newlines within the triple quoted string are important; use that
function something like this:
print ""
print "Title
print "
print "%s" % spam_averse_email_address( '[EMAIL PROTECTED]',
type said, "This is a press conference. The last thing I want to do is
answer a lot of questions."
Regards,
Dan
--
Dan Sommers
<http://www.tombstonezero.net/dan/>
"I wish people would die in alphabetical order." -- My wife, the genealogist
--
http://mail.python.org/mailman/listinfo/python-list
hat you can iterate
through the elements yourself.
HTH,
Dan
--
Dan Sommers
<http://www.tombstonezero.net/dan/>
"I wish people would die in alphabetical order." -- My wife, the genealogist
--
http://mail.python.org/mailman/listinfo/python-list
On Sat, 16 Sep 2006 10:06:25 -0700 (PDT),
Rich Shepard <[EMAIL PROTECTED]> wrote:
> On Sat, 16 Sep 2006, Dan Sommers wrote:
>> When you import random, all you're doing is importing the module; you
>> have to specify any given attribute thereof:
> I thought that wa
nction? Compiler
optimizations because of const and restrict keywords don't count.
And what other C code *isn't* inside a function?
Regards,
Dan
--
Dan Sommers
<http://www.tombstonezero.net/dan/>
"I wish people would die in alphabetical order." -- My wife, the genealogist
round than I have can probably tell you why or when one way might
be better than the other.)
The definitions of Person, Address, and Relationship, as well as the
user-interface(s) and the persistent storage mechanism(s), are left as
exercises to the interested reader. ;-)
Regards,
Dan
--
Dan
r than sorting the list just to pick off one element (O(n)
vs. O(n log n) for all of you Big-Oh notation fans out there; you know
who you are!).
Regards,
Dan
--
Dan Sommers
<http://www.tombstonezero.net/dan/>
"I wish people would die in alphabetical order." -- My wife, the genealogist
--
http://mail.python.org/mailman/listinfo/python-list
re no
more zombies. A good time/place to do this is right before you start
another process.
Regards,
Dan
--
Dan Sommers
<http://www.tombstonezero.net/dan/>
--
http://mail.python.org/mailman/listinfo/python-list
, 0)
> It seems to work without leaving zombies.
If your parent process just sits around and waits for each child process
to finish before moving on, why not use
os.spawnl(os.P_WAIT, 'ext_script.py')
instead of forking and execing "manually"?
Regards,
Dan
--
Dan Sommers
<http://www.tombstonezero.net/dan/>
--
http://mail.python.org/mailman/listinfo/python-list
2.3/.25)*.25
0.049822
Then check out <http://docs.python.org/tut/node16.html>.
Regards,
Dan
--
Dan Sommers
<http://www.tombstonezero.net/dan/>
--
http://mail.python.org/mailman/listinfo/python-list
On Fri, 27 Jan 2006 22:29:20 GMT,
Neil Hodgson <[EMAIL PROTECTED]> wrote:
> ... I'm so used to "/" for division that "÷" now looks strange.
Strange, indeed, and too close to + for me (at least within my
newsreader).
Regards,
Dan
--
Dan Sommers
<http:/
L = [] # or insert your favorite list-clearing/emptying statement here
What damage is done now that O is still referring to one of the items
that used to be in L?
The trouble begins when references to "the list to which L refers" end
up somewhere else. Then we have to wonder if re
mer: I have no financial or business ties to Trolltech or to
Riverbank.
Regards,
Dan
--
Dan Sommers
<http://www.tombstonezero.net/dan/>
--
http://mail.python.org/mailman/listinfo/python-list
stles (e.g.,
logging options) depending on the application.
But now we're off topic for comp.lang.python.
Regards,
Dan
--
Dan Sommers
<http://www.tombstonezero.net/dan/>
--
http://mail.python.org/mailman/listinfo/python-list
;re using enums as meaningful
names for pairwise distinct concepts, then I think otherwise. IMO, if
your program breaks if someone re-assigns the values randomly, then a
better solution than an enum exists. (Or maybe that's because I think
of the tags as nothing more than keywords that work
On 10 May 2005 16:49:25 -0700,
"[EMAIL PROTECTED]" <[EMAIL PROTECTED]> wrote:
> But I can't find any Qt widget that enables me to browse for a
> directory! ...
Try QFileDialog.getExistingDirectory.
HTH,
Dan
--
Dan Sommers
<http://www.tombstonezero.net/dan/>
-
dd 22 to a.myAttribute
> I want to use the power of polymorphism to modelate the problem.
Polymorphism in Python is a solution looking for a problem.
Regards,
Dan
--
Dan Sommers
<http://www.tombstonezero.net/dan/>
--
http://mail.python.org/mailman/listinfo/python-list
ne, step = 1 ):
if stop == None: # i,e., we only got one argument
stop = start
start = 1
# rest of function goes here
HTH,
Dan
--
Dan Sommers
<http://www.tombstonezero.net/dan/>
--
http://mail.python.org/mailman/listinfo/python-list
ossible.
> Many things in Python programs cannot be proved. But what about
> suggesting optimisations, not doing them automatically?
At that point, you can do the optimization yourself:
class A:
def method( self ):
pass
a = A( )
m = a.method # optimize runti
sult.append( [ somevar, per, s, t, v, n, l ] )
(Appending the results is probably quicker than inserting them, but I
don't know for sure.)
But a better-than-an-exhaustive-search algorithm sounds like a good
idea, too.
Regards,
Dan
--
Dan Sommers
<http://www.tombstonezero.net/dan/>
--
http://mail.python.org/mailman/listinfo/python-list
,m,n,o,p,q,r,s,t,u,v,w,x,y,z) = range( 1, 27 )
> Now if we really want some bonus points..
> a=1, b=2, c=3 ... z=26 aa=27 ab=28 etc..
It's still one line, following the pattern from above, just longer.
Now why do you want to do this?
Regards,
Dan
--
Dan Sommers
<http://www.tombston
and
multiplication have" is "the distributive property," but the
distributive property of multiplcation over addition does not translate
to a distributive property of repetition over concatenation:
2 * ( 3 + 4 ) == 14
2 * 3 + 2 * 4 == 14
but
2 * ( "ABC" + "DEF
On 25 May 2005 21:31:57 -0700,
"Sriek" <[EMAIL PROTECTED]> wrote:
> Similarly, why do we have to explicitly use the 'self' keyword
> everytime?
Why do they (the C++ programmers) prepend "m_" to otherwise perfectly
good member names?
Regards,
Dan
--
as your sample code corrupts punctuation.
> Wow, that's quite nice. You really learn something new every day :-) A
> minor improvement: Use string.ascii_letters as the first parameter for
> string.maketrans
And use string.ascii_letters[ 1 : ] + string.ascii_letters[ 0 ] for the
second parameter to string.maketrans.
Regards,
Dan
--
Dan Sommers
<http://www.tombstonezero.net/dan/>
--
http://mail.python.org/mailman/listinfo/python-list
On 27 May 2005 10:52:36 -0400,
Dan Sommers <[EMAIL PROTECTED]> wrote:
> And use string.ascii_letters[ 1 : ] + string.ascii_letters[ 0 ] for the
> second parameter to string.maketrans.
Oops. Thank you Duncan and Rocco for correcting my mistake.
Regards,
Dan
--
Dan S
ethods and recursion are *not*
mutually exclusive (e.g., an Integer class with a factorial method, or a
binary tree class whose nodes are also binary trees).
Regards,
Dan
--
Dan Sommers
<http://www.tombstonezero.net/dan/>
--
http://mail.python.org/mailman/listinfo/python-list
do not claim to be
an expert, but that doesn't seem very Pythonic to me.
AIUI, __cmp__ exists for backwards compatibility, and __eq__ and friends
are flexible enough to cover any possible comparison scheme.
Why make the rules, the documentation, and the implementation even more
"interesting" than they already are?
Regards,
Dan
--
Dan Sommers
<http://www.tombstonezero.net/dan/>
--
http://mail.python.org/mailman/listinfo/python-list
On Fri, 10 Jun 2005 09:50:56 -0500,
Rocco Moretti <[EMAIL PROTECTED]> wrote:
> Dan Sommers wrote:
>> On Thu, 09 Jun 2005 15:50:42 +1200,
>> Greg Ewing <[EMAIL PROTECTED]> wrote:
>>
>>> Rocco Moretti wrote:
>>>
>>>> The main problem
quot;foo" or 3j).
The biggest drawback here, as others have noted in previous discussions,
is that the do_* functions execute in a separate scope.
Regards,
Dan
--
Dan Sommers
<http://www.tombstonezero.net/dan/>
--
http://mail.python.org/mailman/listinfo/python-list
there's no need for my program to
recheck every parameter on every function call all the way down. Either
everything works, or that same UI code catches and logs a TypeError or
ValueError or KeyError exception and asks the user what to do next.
Regards,
Dan
--
Dan Sommers
<http://www.tombstonezero.net/dan/>
--
http://mail.python.org/mailman/listinfo/python-list
ry (PIL) at effbot.org.
Regards,
Dan
--
Dan Sommers
<http://www.tombstonezero.net/dan/>
--
http://mail.python.org/mailman/listinfo/python-list
x27;smith'+'%'
>sql += 'WHERE name LIKE %s' % searchterm
> Any Ideas?
Let the DB-API do more work for you:
cursor = connection.cursor( )
sql = """SELECT column2, columns3 FROM table WHERE name LIKE %s"""
values
irst_line == "FILE LOCKED" and read_if_locked == FALSE:
return False
[read the rest]
return True
def open_command():
if open_file("foo.bar") == False:
[ask the user what to do]
if ans == tkMessageBox.YES:
kernel or filesystem bug, in which case
all bets are off anyway).
Regards,
Dan
--
Dan Sommers
<http://www.tombstonezero.net/dan/>
--
http://mail.python.org/mailman/listinfo/python-list
On Tue, 14 Jun 2005 16:18:19 +0300,
Christos "TZOTZIOY" Georgiou <[EMAIL PROTECTED]> wrote:
> I believe that the suid bit on scripts (either *sh or python) is
> completely ignored on most *nix systems.
Most *modern* systems, yes. ;-)
I must be getting old. :-(
Regards
rith from
> the choosed nx class is this one.
> If there is a better approach, I can implement it.
class single(object):
pass
class n1(single):
pass
class n2(single):
pass
class n3(single):
pass
HTH,
Dan
--
Dan Sommers
<http://www.tombston
want to tend towards the beginning of the list, and
don't care what the envelope looks like, how about this:
def biasedselection(thelist):
index = random.random() * random.random() * len(thelist)
# or index random.random() ** 2 * len(thelist)
sign?
> Yes : coffee, beer, pizzas, cigarettes, paper napkins, pen, and a good
> wiki.
It is a well-known fact that the best engineering tools ever invented
are the cocktail napkin and the white board.
Regards,
Dan
--
Dan Sommers
<http://www.tombstonezero.net/dan/>
"I wish people
uld use in the standard library, or do I have to
> write my own C extension?
You could try the struct module. If your input comes in fixed sized
chunks, just call struct.unpack and struct.pack once per chunk.
HTH,
Dan
--
Dan Sommers
<http://www.tombstonezero.net/dan/>
Atoms are
On Sat, 24 Feb 2007 17:27:12 +, Toby wrote:
> Dan Sommers wrote:
>> You could try the struct module. If your input comes in fixed sized
>> chunks, just call struct.unpack and struct.pack once per chunk.
>
> Thanks, but it was a bit awkward to use for big chunks.
de
gt; but he somehow wasn't very interested :)
Then isn't that the perfect lullaby material? ;-)
Regards,
Dan
--
Dan Sommers
<http://www.tombstonezero.net/dan/>
"I wish people would die in alphabetical order." -- My wife, the genealogist
--
http://mail.python.org/mailman/listinfo/python-list
#x27;t.
I thought it was more cohesive, but googling for
python "what's new"
turns up a collection of such documents in various places.
Regards,
Dan
--
Dan Sommers
<http://www.tombstonezero.net/dan/>
"I wish people would die in alphabetical order." -- My wife
and 1, since x is now 2.
And another x.
Since this might be homework, I'll stop at a hint: you need to think
about when you want each printed line to end, and make sure that you
tell python to end it there.
Regards,
Dan
--
Dan Sommers
<http://www.tombstonezero.net/dan/>
&quo
;license" for more information.
>>>> a=[1,2,3,4,5]
>>>> print ', '.join (a)
> Traceback (most recent call last):
> File "", line 1, in ?
> TypeError: sequence item 0: expected string, int found
>>>> print ', '.join
st the code somewhere if anyone is interested.
> x = 0.032 +/- 0.5 x 10(-4)
> y = 0.032 +/- 1.0 x 10(-4)
> print x == y
> print out?
Regards,
Dan
--
Dan Sommers
<http://www.tombstonezero.net/dan/>
"I wish people would die in alphabetical order." -- My wife, the genealogist
--
http://mail.python.org/mailman/listinfo/python-list
just the opposite: that's 2MB of things someone else wrote in
order that your application code remain small.
Regards,
Dan
--
Dan Sommers
<http://www.tombstonezero.net/dan/>
"I wish people would die in alphabetical order." -- My wife, the genealogist
--
http://mail.python.org/mailman/listinfo/python-list
c/p' -e'/xyz/,$p' file.txt
Or even
awk '/abc/,/xyz/' file.txt
Excluding the abc and xyz lines is left as an exercise to the
interested reader.
Regards,
Dan
--
Dan Sommers
<http://www.tombstonezero.net/dan/>
"I wish people would die in alphabetical order." -- My wife, the genealogist
--
http://mail.python.org/mailman/listinfo/python-list
, then there's nothing wrong with a function consisting
solely of another function call. If you end up with a lot of those tiny
functions, though, and they persist through multiple development cycles,
then you may be making a systematic mistake in your design.
Regards,
Dan
--
Dan Sommers
<ht
7;, u'58.6', u'97.8', u'10.0', u'9.6', u'28.1']
Then you'll have to convert your strings to floats first:
[int(float(x)+0.5) for x in Test]
HTH,
Dan
--
Dan Sommers
<http://www.tombstonezero.net/dan/>
"I wish people would die
pysqlite and the API spec, I'd say no, not a
standard way.
OTOH, eventually, mysqldb has to create that SQL in order to pass it to
the database for execution, so it's probably as simple as finding the
right place to put a "print" statement and/or to store the fi
sql = 'select foo from test where foo regex %s'
cur.execute( sql, tuple( fooregex ) )
See the DP API spec for more information.
Regards,
Dan
--
Dan Sommers
<http://www.tombstonezero.net/dan/>
"I wish people would die in alphabetical order." -- My wife, the genealogist
--
http://mail.python.org/mailman/listinfo/python-list
' matches one or more characters, and '?' matches
> any single character - maybe add '#' to match any single digit and '@'
> to match any single alpha character).
Doesn't SQL already have lightweight wildcards?
SELECT somefield FROM sometable WHE
On Fri, 19 May 2006 18:52:38 GMT,
"Paul McGuire" <[EMAIL PROTECTED]> wrote:
> "Dan Sommers" <[EMAIL PROTECTED]> wrote in message
> news:[EMAIL PROTECTED]
>> Doesn't SQL already have lightweight wildcards?
>>
>> SELECT somefield FR
at the "Bunch" recipe in the Python Cookbook:
http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/52308
Regards,
Dan
--
Dan Sommers
<http://www.tombstonezero.net/dan/>
"I wish people would die in alphabetical order." -- My wife, the genealogist
--
http://mail.python.org/mailman/listinfo/python-list
ot;in"
operator may work better:
for thing in array_or_file_or_dictionary:
do_something_with(thing)
HTH,
Dan
--
Dan Sommers A death spiral goes clock-
<http://www.tombstonezero.net/dan/> wise north of the equator.
Atoms are n
301 - 400 of 456 matches
Mail list logo