e a hard time convincing the community
> at large to actually use it. You need to actually have a better mousetrap
> to present before you ask people to move their cheese. :)
>
+1
I agree with PJE almost entirely.
Peace
Bill Mill
bill.mill at gmail.com
--
http://mail.python.org/mailman/listinfo/python-list
x27;]
>>>
>>> #here's how the crazy hackers subclassing your code can break your super
... #special private variable!
...
>>> t._test__i += 6
>>> t.i
got i
7
But, if your users can't figure out that they shouldn't be changing
the variable called t._test__i without expecting side effects, what do
you think of the users of your class?
Python is for consenting adults.
Peace
Bill Mill
bill.mill at gmail.com
--
http://mail.python.org/mailman/listinfo/python-list
Error correction time!
> >>> #here's how the crazy hackers subclassing your code can break your super
> ... #special private variable!
> ...
That should be "using your code" not "subclassing your code". D'oh!
Peace
Bill Mill
bill.mill at gmail
> But, this post of his shows [Guido's] haughtiness
+1 IQOTW
(Ironic Quote Of The Week. Thanks for the laughs, Xah)
Peace
Bill Mill
bill.mill at gmail.com
--
http://mail.python.org/mailman/listinfo/python-list
of non zero regions..as (x1,y1,x2,y2)
> [(0,0,2,1),(0,4,2,5)] which show the top left(x1,y1) and bottom
> right(x2,y2) corners of each group.hope i am clear.
>
I don't understand. Could you give some inputs with expected outputs
and some explanation?
Peace
Bill Mill
bill.mill at gma
? Ask something that's answerable, and we'll
try to help you.)
Peace
Bill Mill
bill.mill at gmail.com
On 9/29/05, James Hu <[EMAIL PROTECTED]> wrote:
> Hi,
>
> I used python and PIL to capture image from a digital camera,
> It seems like it took more than 1 second to cap
gt; took only .2s or less for one image with the same size.
> > Don't know why python and PIL is so slow, any idea to improve the
> > performance? Thanks a lot!
> >
> > James
> >
> > --
> > http://mail.python.org/mailman/listinfo/python-list
> >
&
+1 QOTW.
>
> Tim
>
-1 XLEGQOTW
(Xah Lee Ever Getting QOTW'd)
Peace
Bill Mill
bill.mill at gmail.com
--
http://mail.python.org/mailman/listinfo/python-list
et, over a corporate LAN, on the same computer, on
Internet2)? Is there any framework in existance, or is this program
being written from scratch?
Peace
Bill Mill
bill.mill at gmail.com
--
http://mail.python.org/mailman/listinfo/python-list
office web
> > based. I sincerely enjoy the idea althoug I'd like to know what will be
> > the future of this wonderful language called Python??
>
> I think I know???? Although, the future is difficult to predict???
+1 QOTW
Peace
Bill Mill
bill.mill at gmail.com
--
http://mail.python.org/mailman/listinfo/python-list
x27;re not
used in ways you don't intend is to require the user to contact you to
use it, and that's a deal with the devil. One you might need to make
if security is that important to you, as Microsoft and Valve have
decided it is, but it's a deal with the devil nonetheless.
Peac
e self.data the default argument for self.f(). (I
> want to use 'A' class as following :
>
> myA = A(5)
> myA.f()
>
> and get printed '5' as a result.)
>
class A:
def __init__(self, n):
self.data = n
def f(self, x=None):
if not x:
ust
tossed off an answer without thinking much, and we see the result. It
could have been a good debugging lesson for him if he'd tried to pass
0; I think I'll use that as my excuse.
Peace
Bill Mill
bill.mill at gmail.com
--
http://mail.python.org/mailman/listinfo/python-list
The example that occurs to me is that "import smtplib" is better than
"import stdlib.inet.services.smtp".
Peace
Bill Mill
bill.mill at gmail.com
On Wed, 19 Jan 2005 14:13:47 -0500, Timothy Fitz <[EMAIL PROTECTED]> wrote:
> While I agree that the Zen of Python is
e = (1,1,1)
>>> cmd = '%s/mos user wmarch, cd /fa/wm/%s/%s, mkdir %s, put %s'\
... '%s' % (mosbin, jaar, filetype, filetype, filetype, filetype)
>>> cmd
'1/mos user wmarch, cd /fa/wm/1/1, mkdir 1, put 1, chmod 6441'
Peace
Bill Mill
bill.mill at
You are correct, sir. Didn't know you could do that. Neato.
Peace
Bill Mill
bill.mill at gmail.com
On Wed, 19 Jan 2005 22:10:05 +0100, Fredrik Lundh
<[EMAIL PROTECTED]> wrote:
> Bill Mill wrote:
>
> > You've got a couple problems. First, you need to end the
)) when you can, but
use it when you need to know the index of something without an
additional x.index() call.
Peace
Bill Mill
bill.mill at gmail.com
On Wed, 19 Jan 2005 22:04:44 -0500, Bob Smith
<[EMAIL PROTECTED]> wrote:
> Hi,
>
> I have a Python list. I can't figure out ho
read this thread, it should help you:
http://mail.python.org/pipermail/tutor/2005-January/035124.html
Peace
Bill Mill
bill.mill at gmail.com
On Tue, 25 Jan 2005 02:15:58 +, Frans Englich
<[EMAIL PROTECTED]> wrote:
>
> Hello all,
>
> Due to the size of my source, I want t
ot; function?
Peace
Bill Mill
bill.mill at gmail.com
--
http://mail.python.org/mailman/listinfo/python-list
On 28 Jan 2005 15:41:49 GMT, F. Petitjean <[EMAIL PROTECTED]> wrote:
> Le Fri, 28 Jan 2005 10:20:30 -0500, Bill Mill a écrit :
> > Hello all,
> >
> > I have a misunderstanding about dynamic class methods. I don't expect
> > this behavior:
> >
> >
le in
python 2.4, that's equivalent to:
self.m = type(self.__init__)(method, self, Test)
I didn't know that you could call types to create another type.
Peace
Bill Mill
bill.mill at gmail.com
--
http://mail.python.org/mailman/listinfo/python-list
ouble printing here is a typo?
> >>>
>
> To add m as a new method to the *instance*, use new.instancemethod, as
> Diez B. Roggisch already pointed out.
>
Thanks, you helped me understand it a lot.
Peace
Bill Mill
bill.mill at gmail.com
--
http://mail.python.org/mailman/listinfo/python-list
ot the object, as follows:
>
> |class Test:
> |def __init__(self):
> |self.method()
> |
> |def m(self):
> |print self
> |
> |setattr(Test, 'method', m)
> |Test()
>
beautiful; so this appears to be equivalent to the __class__ method
that Ha
On Fri, 28 Jan 2005 11:59:50 -0500, Hans Nowak <[EMAIL PROTECTED]> wrote:
> Bill Mill wrote:
>
> > On Fri, 28 Jan 2005 11:09:16 -0500, Hans Nowak <[EMAIL PROTECTED]> wrote:
> >
> >
> >>To add m as a new method to the *class*, do this:
> >&
you do *not* know the attribute name at coding time but
> will have it in a string at run time, as in
>
> methodname = 'method'
> ..# some time later
> setattr(Test, methodname, m)
>
> Sometime Python makes things easier than people are initially willing to
> believe ;-)
I felt like there had to be a simpler solution.
Peace
Bill Mill
bill.mill at gmail.com
--
http://mail.python.org/mailman/listinfo/python-list
ing,16);
Tell me what this does, give me an example or two, and I'll translate
it for you. I don't feel like going to read the java docs to figure it
out.
You probably want to look at the built-in int() function though. Type
help(int) at the python prompt.
Peace
Bill Mill
bill.mill at gm
Chad,
try "elif tries == 2" or just "else:". You are not allowed to put an
expression after an else statement.
I recommend you read the python tutorial at
http://docs.python.org/tut/tut.html .
Peace
Bill Mill
bill.mill at gmail.com
On Fri, 4 Feb 2005 12:49:51 -0600,
u're operating in-place on an array while it's
being iterated over. Since the iterator is only created once, you're
can't change the array while you're iterating over it. Instead, try a
list comprehension:
>>> ips = [ip for ip in ips if '255' not in ip]
>>> ips
['128.173.120.79', '198.82.247.98', '127.0.0.1']
Peace
Bill Mill
bill.mill at gmail.com
--
http://mail.python.org/mailman/listinfo/python-list
d, iterate over
> > a copy by using:
> >
> > for ip in ips[:]:
> > ...
> >
> > regards
> > Steve
>
> Very neat. That's a trick that everyone should know about. I vote it
> goes in Dr. Dobbs newsletter.
Once you know it, it's neat, and I use it sometimes. However, it's a
little too "magical" for my tastes; I'd rather be more explicit about
what's going on.
Peace
Bill Mill
bill.mill at gmail.com
> --
> http://mail.python.org/mailman/listinfo/python-list
>
--
http://mail.python.org/mailman/listinfo/python-list
import copy
>>> ips = ['255.255.255.255', '128.173.120.79', '198.82.247.98',
... '127.0.0.1', '255.0.0.0', '255', '128.173.255.34']
>>> for ip in copy(ips):
... if '255' in ip:
... ips.remove(ip)
...
>>> ips
['128.173.120.79', '198.82.247.98', '127.0.0.1']
But I still think that the list comprehension is the best.
Peace
Bill Mill
bill.mill at gmail.com
> --
> http://mail.python.org/mailman/listinfo/python-list
>
--
http://mail.python.org/mailman/listinfo/python-list
Brent,
You could write the Python program as a proxy of the internet stream.
Basically, you would point your proxy at the web stream and receive
the data it sends. At the same time, you would be listening for
connections on some socket on the local machine. You would then point
winamp towards the
vely, zc and zC close it non- and recursively. zr opens all
folds one level, zR opens them all recursively, zm closes them all one
level, and zM closes them all recursively.
It's pretty sweet. Maybe we should have a big Vim-python tip-a-thon thread?
Peace
Bill Mill
[EMAIL PROTECTED]
--
http://mail.python.org/mailman/listinfo/python-list
u know another one with 3D-capabilities as well?
> That would be very nice,
>
Perhaps gnuplot.py (http://gnuplot-py.sourceforge.net/) will work for
you? It is a thin wrapper around Gnuplot, which is very good at
producing ps format images, and is capable of producing 3 dimensional
graphs.
Pe
#x27;t know, but it causes a lot of errors
for windows folks. I'm a frequent linux/windows switcher, and it's
caused me no end of troubles - if you're getting "premature end of
script headers" in your apache error logs, this may be your problem.
Peace
Bill Mill
bill.mil
;)
y or n?y
>>> answer
'y'
Check out the documentation of both functions at
http://docs.python.org/lib/built-in-funcs.html for more details.
Peace
Bill Mill
--
http://mail.python.org/mailman/listinfo/python-list
string.maketrans('.,-', ' '))
#read the docs at
# http://docs.python.org/lib/node109.html
# for more details
#End program 3
Hope this helps; you should be able to put the pieces together to do
what you want to do. If you can't, feel free to
ers,
> Brian
> --
> http://mail.python.org/mailman/listinfo/python-list
>
Questions:
Will that random test generator (included in the download) be used to
perform the actual testing? How many tests will be run on each
program?
What is the penalty for a wrong answer?
Peace
Bill Mill
PS -
all
problem, I figure out that if I move it to my ext3 drive, it again
works perfectly. Prints out the same information, says it's waiting on
8080, but this time, I can access it.
Can anybody posit a guess as to why it would behave this way?
Peace
Bill Mill
bill.mill at gmail.com
--
http
On 7/16/05, Neil Hodgson <[EMAIL PROTECTED]> wrote:
> Bill Mill:
>
> > ... a FAT partition for data as a dmz which both linux and NT can
> > access ...
> > Yesterday, I downloaded the new release of cherrypy, and stuck it on
> > the dmz drive. ...
> > Ev
On 7/16/05, Dennis Lee Bieber <[EMAIL PROTECTED]> wrote:
> On Sat, 16 Jul 2005 19:54:31 -0400, Bill Mill <[EMAIL PROTECTED]>
> declaimed the following in comp.lang.python:
>
>
> > The FAT dirs are mounted with the following options:
> > defaults,user,umask=000
the last release.
>
> Do you know any idea about this change?
check out the CVS changelog to see what's changed with it:
http://cvs.sourceforge.net/viewcvs.py/python/python/dist/src/Lib/smtplib.py?rev=1.70&view=log
Peace
Bill Mill
bill.mill at gmail.com
--
http://mail.python.org/mailman/listinfo/python-list
yield (i, elt)
i += 1
for i, url in my_enumerate(links):
but it's not too bad as it is. Also, my function is completely
untested - it's close to right though.)
Peace
Bill Mill
--
http://mail.python.org/mailman/listinfo/python-list
On 7/20/05, Bill Mill <[EMAIL PROTECTED]> wrote:
> On 7/20/05, Simon Brunning <[EMAIL PROTECTED]> wrote:
> > On 7/20/05, Mage <[EMAIL PROTECTED]> wrote:
> > > Or is there better way?
> > >
> > > for (i, url) in [(i,links[i]) for i in ran
On 7/21/05, Steven D'Aprano <[EMAIL PROTECTED]> wrote:
> On Wed, 20 Jul 2005 16:30:10 -0400, Bill Mill wrote:
>
> > On 7/20/05, Simon Brunning <[EMAIL PROTECTED]> wrote:
> >> On 7/20/05, Mage <[EMAIL PROTECTED]> wrote:
> >> > Or is there bet
program? I bet there's an
equivalent you could symlink to it. Unfortunately, I've never BSDed,
so I can't help you find it. To get a workable subset of the normal
env functionality, you could try (assuming you use bash):
/home/llimllib $ echo "$@" > /usr/bin/env
/home/
On 7/21/05, Bill Mill <[EMAIL PROTECTED]> wrote:
> On 7/21/05, Jan Danielsson <[EMAIL PROTECTED]> wrote:
> > Hello all,
> >
> >How do I make a python script actually a _python_ in unix:ish
> > environments?
> >
> > I know about adding:
>
t;
>>> def foo(): print "foobarred"
...
>>> foo()
foobarred
>>> eval("foo()")
foobarred
>>>
Peace
Bill Mill
bill.mill at gmail.com
--
http://mail.python.org/mailman/listinfo/python-list
func_name):
... for e in lst:
... getattr(e, func_name)()
...
>>> call_this_func(x, 'func1')
func1 called
other func1
func1 called
>>>
Note that the getattr raises an AttributeError if func_name doesn't
exist in the object; you should probably wrap it in a try/except.
Peace
Bill Mill
bill.mill at gmail.com
--
http://mail.python.org/mailman/listinfo/python-list
> although, as some argue, it's
> possible [GvR] thinks in base 9.5, that just doesn't seem Pythonic to me.
+1 QOTW
Peace
Bill Mill
[EMAIL PROTECTED]
--
http://mail.python.org/mailman/listinfo/python-list
e this?
In [1]: x = "something something else and\nanother thing in
a td and again else"
In [2]: import re
In [3]: r = re.compile('(.*?)', re.S)
In [4]: r.findall(x)
Out[4]: ['something else', 'in a td']
If not, you'll have to explain more clearly
> I really wish Python could be more widely available on web server
> machines. This is just my own experience and I would like to hear your
> comments.
>
I would like a pony... no, wait, even better, a unicorn!
Peace
Bill Mill
bill.mill at gmail.com
PS (the gist is, why don'
#x27;s using LSI for his clustering.
I ask because I've done some LSI [1], and could help him out with that
if he is doing it.
While I'm on the subject, is there any general interest in my python LSI code?
[1] http://llimllib.f2o.org/files/lsi_paper.pdf
Peace
Bill Mill
--
http://mail.
They come out even in the computer language shootout:
http://shootout.alioth.debian.org/benchmark.php?test=all&lang=python&sort=fullcpu
(tied 8-8 in execution time, although perl wins 4-12 on memory consumption)
Peace
Bill Mill
On 8/23/05, km <[EMAIL PROTECTED]> wrote:
> Hi
> If you want a fast language, try Holden. I've just invented it.
> Unfortunately it gets the answer to every problem wrong unless the
> answer is 42, but boy it runs quickly.
+1 QOTW
(sometimes the zen master has to whack the student on the head)
Peace
Bill Mill
bill.mill at gmai
uot;
It seems to work (>19x speedup on my machine), I'm just curious what
path you followed to get there.
And, finally, you should forward this to the python-dev list, if
somebody hasn't already. There are more people who know a ton about
python internals there.
Peace
Bill Mill
bill.mill at gmail.com
--
http://mail.python.org/mailman/listinfo/python-list
es.
>
Unlikely; 2 people have confirmed these results already.
I did find, though, that if I remove all print statements from the
program, the dummy and non-dummy variable versions take indentical
time. Can others reproduce this?
I'm Investigating further...
Peace
Bill Mill
bill.mill at gmail.com
--
http://mail.python.org/mailman/listinfo/python-list
Bill Mill wrote:
>
> Pentium M 1.8 GHz Windows 2k. Here's the top of the profile results
> for fast and slow on my machine (these won't look decent except in a
> fixed-width font):
>
>
> Interestingly, the test.py:36 line, which takes 45 seconds (!!) in the
>
On 8/25/05, Jack Diederich <[EMAIL PROTECTED]> wrote:
> On Thu, Aug 25, 2005 at 01:35:04PM -0400, Bill Mill wrote:
> > On 8/25/05, Erik Max Francis <[EMAIL PROTECTED]> wrote:
> > > Mark Dickinson wrote:
> > >
> > > > Questions:
> > > >
On 8/25/05, Erik Max Francis <[EMAIL PROTECTED]> wrote:
> Bill Mill wrote:
>
> > Unlikely; 2 people have confirmed these results already.
> >
> > I did find, though, that if I remove all print statements from the
> > program, the dummy and non-dummy variable ve
at 0x00969710>)
(3, <__main__.LLentry object at 0x00969710>)
(3, <__main__.LLentry object at 0x00969710>)
(2, <__main__.LLentry object at 0x00969710>)
Although they appear in order here, they don't always. Often, multiple
objects have a value of 1, and he's going to ge
not one of the most important ones - but if I
> can write
>
> a, (b ,c) = 1, (2,3)
>
> I'd like to write
>
> def foo(a, (b,c)):
> ...
>
> foo(1, (2,3))
>
Agreed. I discovered them when I wondered "wouldn't it be neat if
functions unpacked tuples j
; > return math.sqrt((p2[0] - p1[0])**2 + (p2[1] - p1[1])**2)
>
> But not massively nicer than:
>
> def euclidian_distance(p1, p2):
> (x1, y1), (x2, y2) = p1, p2
> return math.sqrt((x2 - x1)**2 + (y2 - y1)**2)
>
But the question is - why go to the eff
You need to convert 1 or 3 to a float. How about:
>>> def pct(num, den): return (float(num)/den) * 100
...
>>> pct(1, 3)
33.3333329
Peace
Bill Mill
bill.mill at gmail.com
On 22 Sep 2005 10:51:43 -0700, Sen-Lung Chen
<[EMAIL PROTECTED]> wrote:
> Dear All:
&
node7.html#SECTION00714 .
Peace
Bill Mill
bill.mill at gmail.com
On Tue, 08 Feb 2005 06:50:08 -0800 (PST), Jim <[EMAIL PROTECTED]> wrote:
> Where did this type of structure come from:
>
> mat = ['a' for i in range(3)]?
>
> This will produce a list of t
On Fri, 11 Feb 2005 12:11:44 -0700, Steven Bethard
<[EMAIL PROTECTED]> wrote:
> Is there a good way to determine if an object is a numeric type?
> Generally, I avoid type-checks in favor of try/except blocks, but I'm
> not sure what to do in this case:
>
> def f(i):
> ...
>
Kent
> >
> >>
> >> André
> >>
>
> That is not exactly what I want. It should discover if some of
> the predefined words appear as substrings, not only as equal
> words. For instance, after matching "word2sgjoisejfisaword1yguyg", word2
> and word1 should be detected.
Show some initiative, man!
>>> known_words = set(["word1", "word2"])
>>> found_words = [word for word in known_words if word in "word2sgjoisejfisawo
rd1yguyg"]
>>> found_words
['word1', 'word2']
Peace
Bill Mill
bill.mill at gmail.com
--
http://mail.python.org/mailman/listinfo/python-list
9
-
3 3 9 7
8 3 8 7
9 5 9 8
4 7 5 9
-
real0m1.255s
user0m1.221s
sys 0m0.030s
Both solutions look correct to me; how about you? With clever enough
heuristics, problems that you can expect people to solve will almost
always fall to brute force algorithms, I feel.
Peace
Bill Mill
bill.mill at gmail.com
--
http://mail.python.org/mailman/listinfo/python-list
; 3 3 9 7
> 8 3 8 7
> 9 5 9 8
> 4 7 5 9
> -
>
> real0m1.255s
> user0m1.221s
> sys 0m0.030s
>
Peace
Bill Mill
bill.mill at gmail.com
--
http://mail.python.org/mailman/listinfo/python-list
Earl,
Please post the smallest snippet of code you can which illustrates
your problem. No list is an unsubscriptable object, so you seem to be
passing something that is not a list to your function.
As it stands, you don't give enough information to give an actual answer.
Peace
Bill
e first part is actually XYZ, is there an
> easy way of doing that?
>
data.startswith('XYZ')
Please read the python tutorial at http://docs.python.org/tut/tut.html .
Peace
Bill Mill
bill.mill at gmail.com
--
http://mail.python.org/mailman/listinfo/python-list
very very unlikely to happen in such a
way that the row and column sums are maintained; especially as the
number of rows and columns grows.
Better to just do a crc or a hash of the data though.
Peace
Bill Mill
bill.mill at gmail.com
--
http://mail.python.org/mailman/listinfo/python-list
dingly
obvious what your code does, which is a good thing. My list comp, on
the other hand, is seven kinds of confusing for a reader.
Peace
Bill Mill
bill.mill at gmail.com
--
http://mail.python.org/mailman/listinfo/python-list
e archives for that
(it was in february, I 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
>
> (In Matlab, "integer_matrix&qu
at it means python doesn't have "delayed evaluation").
Here are two ways to do what you want:
if 'x' in d: value = d['x']
else: value = bigscaryfunction()
or:
def sget(dict, key, func, *args):
if key in dict: return key
else: return func(*args)
sget
t())
>>> z
at 0x008D6870>
So this seems to be merely an obfuscation of:
>>> z = d.get('x', test)
>>> z
I just wanted to ask, am I missing something?
Peace
Bill Mill
bill.mill at gmail.com
--
http://mail.python.org/mailman/listinfo/python-list
it...
> def scary():
> print "scary called"
> return 22
>
> d = dict(x=1)
> d.get('x', lambda *a : scary())
>
> # print 1
> d.get('z', (lambda *a : scary())())
> scary called
> 22
but:
>>> d.get('x', (lambda *a: test())())
test called
1
So how is this different than d.get('x', test()) ?
Peace
Bill Mill
bill.mill at gmail.com
--
http://mail.python.org/mailman/listinfo/python-list
string.
I agree with everything said here. Furthermore, I don't like this PEP
because it introduces magic. When reading code, you just need to
magically know what the double-comma does in a print statement. Yes,
there are bits of magic involved in the solutions that already exist,
but I am o
rouping, and do not
unambiguously define a tuple. It's a python gotcha. To define a
one-tuple, put a comma after the '1':
>>>type(('1',))
>
> Because I have to treat this "special" case differently in my code.
you shouldn't have to; post your code if you still think you do.
Peace
Bill Mill
bill.mill at gmail.com
--
http://mail.python.org/mailman/listinfo/python-list
e, since the need to create
empty tuples is vanishingly rare, I'm okay with a little
inconsistency.
Peace
Bill Mill
bill.mill at gmail.com
--
http://mail.python.org/mailman/listinfo/python-list
and people
will find your blog. I know for a fact that the daily python-url
editors (when not away on vacation) read planet python, and they'll
send thousands of visitors to you if they link you.
Peace
Bill Mill
bill.mill at gmail.com
--
http://mail.python.org/mailman/listinfo/python-list
On 21 Mar 2005 12:47:07 -0800, Paul McGuire <[EMAIL PROTECTED]> wrote:
> Brian,
>
> Having reviewed your Cease and Desist petition, I'm afraid I must
> dispute some or all of your claims:
>
> 1. Your citation of prior art has one or more significant defects:
> a. In your citation, "brace" is clea
On 24 Mar 2005 10:29:40 -0800, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote:
> I am new to python and learning it. Can you please give me a simple
> example of user defined type through class mechanism.
GIYF:
http://www.python.org/2.2/descrintro.html#subclassing
Peace
Bill Mill
v1, v2):
v1, v2 = v1.split('.'), v2.split('.')
for x, y in zip(v1, v2):
if x < y: return v1
if y > x: return v2
It assumes that v1 and v2 have the same amount of '.'s and that all of
the version numbers are of the same length (i.e
half your colons, you're spending upwards
of 20 seconds per colon?
If you want, I'll write a script that checks for colons at the end of
lines before increased indentation, and asks you if you want to put
one there - I could save you 5.8 minutes per 100 lines of code. How's
that for a productivity boost?
Peace
Bill Mill
bill.mill at gmail.com
--
http://mail.python.org/mailman/listinfo/python-list
t sort of namespace problems? I think you need to tell us what your
specific problems were, so that we can help you more.
Peace
Bill Mill
bill.mill at gmail.com
--
http://mail.python.org/mailman/listinfo/python-list
#x27;ATT/GATA/G'): print g
...
['A']
['T']
['T', 'G']
['A']
['T']
['A', 'G']
Peace
Bill Mill
bill.mill at gmail.com
--
http://mail.python.org/mailman/listinfo/python-list
On Mon, 28 Mar 2005 09:18:38 -0800, Michael Spencer
<[EMAIL PROTECTED]> wrote:
> Bill Mill wrote:
>
> > for very long genomes he might want a generator:
> >
> > def xgen(s):
> > l = len(s) - 1
> > e = enumerate(s)
> >
l of
the problem. Also, item is a much clearer name than stack; I chose
stack just to point out how similar the solution to objection 2 was to
yours.
Peace
Bill Mill
bill.mill at gmail.com
--
http://mail.python.org/mailman/listinfo/python-list
nother table.
> Is it better and easier to use the pyparsing module or HTMLparser?
>
You might want to check out BeautifulSoup at:
http://www.crummy.com/software/BeautifulSoup/ .
Peace
Bill Mill
bill.mill at gmail.com
--
http://mail.python.org/mailman/listinfo/python-list
27;.
ummm, yes, of course they are. What's your point?
>
> Mixing data and program code, ie.. variable names as data, is not a
> good idea.
Down with eval! Exile exec! A pox on both their houses!
(i.e. I respectfully disagree that mixing data with program code is a bad idea)
Peace
Bill Mill
bill.mill at gmail.com
--
http://mail.python.org/mailman/listinfo/python-list
On Tue, 29 Mar 2005 18:08:04 GMT, Cameron Laird <[EMAIL PROTECTED]> wrote:
> In article <[EMAIL PROTECTED]>,
> Bill Mill <[EMAIL PROTECTED]> wrote:
> .
> .
> .
> >(i.e. I respectfully
;s going on so that you don't end up writing another language
in python. If you do this, it doesn't matter which of the three you
pick.
Peace
Bill Mill
bill.mill at gmail.com
--
http://mail.python.org/mailman/listinfo/python-list
nt when I hit send.
Naturally, I wasn't suggesting that anyone (shudder) do things like
your examples of poor code. I had a much smaller point, about which I
was not clear: Sometimes, it is handy to mix code and data. There
*are* legitimate uses of reflection, eval, and exec.
I was too glib in my response to you. I intended no disrespect, only silliness.
Peace
Bill Mill
bill.mill at gmail.com
--
http://mail.python.org/mailman/listinfo/python-list
because a
variable is simply a name binding doesn't mean Python couldn't return
the name of the binding.
I'm not definitely saying that I *want* an easy name() function -
there's a lot of potential for abuse - but I would at least like to
see it accomplished before I decide whether I like it or not.
Peace
Bill Mill
bill.mill at gmail.com
--
http://mail.python.org/mailman/listinfo/python-list
On Thu, 31 Mar 2005 03:33:10 -0500, Bill Mill <[EMAIL PROTECTED]> wrote:
> On 31 Mar 2005 08:13:30 GMT, Duncan Booth <[EMAIL PROTECTED]> wrote:
> > [EMAIL PROTECTED] wrote:
> >
> > > But surely if you create an integer object and assign it a value, e.g.
> &
using = are much
clearer, especially since you often write many of them in a row,
whereas you almost always make one assignment per line.
I use := every day in PL/SQL, and it's one of the few positive
syntactical features of the language.
Peace
Bill Mill
bill.mill at gmail.com
--
http://mail.pyth
port ... as ... idiom?
> > e.g. import os.path as op
> >
>
> This would, of course, require the user to qualify the names by
> prefixing them with "op.".
>
What the OP listed above requires that too.
Peace
Bill Mill
bill.mill at gmail.com
--
http://mail.python.org/mailman/listinfo/python-list
os.rename(in_file, str(name[0]) + '.' + 'text'))
>
you should really use in_file.splitext - your script renames
myfile.with.lots.of.dots.txt to myfile.text instead of
myfile.with.lots.of.dots.text .
If you *really* wanted to use split(), it oughta be
''.join(in_
> systems too.
>
> #!/usr/bin/env python
What the others have said already is true, that it will be ignored on
windows, with one caveat. The shebang is interpreted by Apache if your
script is a CGI script. So, if your script is a CGI, you will need to
have a windows version and a ni
ll available for
> Windows. Google is your friend.
>
> Symbolic links also work under uwin (don't know for sure about the
> others). That means you can install a link in /usr/bin to whereever
> python lives, and expect #!/usr/bin/python to work just fine.
This works in cygwin
1 - 100 of 154 matches
Mail list logo