On Sun, 23 Jan 2005 15:43:43 +1000, Nick Coghlan <[EMAIL PROTECTED]> wrote:
>aurora wrote:
>> I am think more in the line of string.ljust(). So if we have a
>> list.ljust(length, filler), we can do something like
>>
>> name, value = s.split('=',1).ljust(2,'')
>
>Eh?
>
>Py> s.split('=',1).ljus
> I would like it to be editable, through a web browser or a GUI
> application. With ConfigParser I can read the configuration file and
> edit the options, but when I write the result all the comments are
lost
Hey Pierre,
I came across a good review of a number of possible solutions for this
at h
Paul Rubin wrote:
Stephen Waterbury <[EMAIL PROTECTED]> writes:
I should note that I have to deal with XML a lot, but always
kicking and screaming (though much less now because of Fredrik's
Elementtree package ;). Thanks, Fredrik and Peter, for the
references. ;)
I love this old rant about XML:
h
On Sun, 23 Jan 2005 08:22:36 GMT, [EMAIL PROTECTED] (Bengt Richter) wrote:
>On Sun, 23 Jan 2005 15:43:43 +1000, Nick Coghlan <[EMAIL PROTECTED]> wrote:
>
>>aurora wrote:
>>> I am think more in the line of string.ljust(). So if we have a
>>> list.ljust(length, filler), we can do something like
>>
Tim Roberts wrote:
> Bob Smith <[EMAIL PROTECTED]> wrote:
>
> >Are these the same:
> >
> >1. f_size = os.path.getsize(file_name)
> >
> >2. fp1 = file(file_name, 'r')
> >data = fp1.readlines()
> >last_byte = fp1.tell()
> >
> >I always get the same value when doing 1. or 2. Is there a reason
adding to my previosu comment...
In the Python tutorial:
http://python.org/doc/2.3.4/tut/node11.html
the beginning two paragraphs should be deleted. Nobody gives a shit
except a few smug academicians where the author wrote it for pleasing
himself. For 99% of readers, it is incomprehensible and irr
Tim Roberts wrote:
> Bob Smith <[EMAIL PROTECTED]> wrote:
>
> >Are these the same:
> >
> >1. f_size = os.path.getsize(file_name)
> >
> >2. fp1 = file(file_name, 'r')
> >data = fp1.readlines()
> >last_byte = fp1.tell()
> >
> >I always get the same value when doing 1. or 2. Is there a reason
Xah Lee wrote:
>
... snip ...
>
> the first paragraph of 9.1 "A Word About Terminology" is epitome
> of masturbation. The entire 9.1 is not necessary.
>
> Large part of 9.2 "Python Scopes and Name Spaces" is again
> masturbatory.
PLONK for excessive OT crossposting and trolling.
--
"If you wa
Fredrik Lundh wrote:
Tim Daneliuk wrote:
Given an arbitrary string, I want to find each individual instance of
text in the form: "[PROMPT:optional text]"
I tried this:
y=re.compile(r'\[PROMPT:.*\]')
Which works fine when the text is exactly "[PROMPT:whatever]"
didn't you leave something out h
I have difficulties understanding your probelem - is your own method giving
you trouble (and the 'exceptions.ValueError:too many values to unpack')
error or is it the remote debugger? Or do you simply not understand the
error message itself.
The error itself is raised in cases like this:
a,b,c =
Tim Daneliuk wrote:
For some reason, I am having the hardest time doing something that should
be obvious. (Note time of posting ;)
Given an arbitrary string, I want to find each individual instance of
text in the form: "[PROMPT:optional text]"
I tried this:
y=re.compile(r'\[PROMPT:.*\]')
Whic
[Effbot]
ReST and YAML share the same deep flaw: both formats are marketed
as simple, readable formats, and at a first glance, they look simple and read-
able -- but in reality, they're messy as hell, and chances are that the thing
you're looking at doesn't really mean what you think it means (unle
Tim Daneliuk wrote:
> Thanks - very helpful. One followup - your re works as advertised. But
> if I use: r'\[PROMPT:[^]].*\]' it seems not to. the '.*' instead of just '*'
> it matches the entire string ...
it's not "just '*'", it's "[^]]*". it's the "^]" set (anything but ]) that's
repeate
Nick Coghlan wrote:
> André wrote:
> > So, students will be able to write:
> > pete = CreateRobot(2, 3)
> > pete.move()
> >
> > learning about objects and methods.
> >
> > As for things like
> > for robot in robots:
> > do stuff
> >
> > that will be for my use only: drawing robots on the screen,
u
Alan Kennedy <[EMAIL PROTECTED]> writes:
> However, I'm torn on whether to use ReST for textual content. On the
> one hand, it's looks pretty comprehensive and solidly implemented.
It seemed both unnecessary and horrendously overcomplicated when I
looked at it. I'd stay away.
> So, I'm hoping th
Alan Kennedy wrote:
> From what I've seen, pretty much every textual markup targetted for web
> content, e.g. wiki markup,
> seems to have grown/evolved organically, meaning that it is either
> underpowered or overpowered,
> full of special cases, doesn't have a meaningful object model, etc.
Scott David Daniels wrote:
> André Roberge wrote:
> > Craig Ringer wrote:
> >
> >> On Fri, 2005-01-21 at 16:13 -0800, André wrote:
> >>
> >>> Short version of what I am looking for:
> >>>
> >>> Given a class "public_class" which is instantiated a few times
e.g.
> >>>
> >>> a = public_class()
> >>>
Doug Holton wrote:
> You might like programming in XML then: http://www.meta-language.net/
> :)
http://www.meta-language.net/sample.html#class-metal
I'm not so sure ;-)
Daniel Bickett
--
http://mail.python.org/mailman/listinfo/python-list
Hi,
I have seen some software written in python and delivered as binary form.
How does these binary code get generated by python compiler?
Thanks
Sam.
--
http://mail.python.org/mailman/listinfo/python-list
"sam" <[EMAIL PROTECTED]> wrote:
> I have seen some software written in python and delivered as binary form.
>
> How does these binary code get generated by python compiler?
see section 6.1.2 in the tutorial:
http://docs.python.org/tut/node8.html
--
http://mail.python.org/mailman/list
Hello guys,
I convinced my CS teacher to use Python in school. We currently have 2.2
installed on a Windows 2000 Terminal server. I asked the system administrator
to upgrade to Python 2.4, but he didn't succeed in doing it. He used the
microsoft installer package, which according to him crashed
Well, I look forward to seeing the new version. I have the old version
of the Python cookbook, it was very useful!
--
http://mail.python.org/mailman/listinfo/python-list
I have a need for a time.clock() with >0.16 second (16us) accuracy.
The sleep() (on Python 2.3, Win32, at least) has a .001s limit.
Are they lower/better on other's platforms?
Test code, 2.4GHz P4
Python 2.3.3 (#51, Dec 18 2003, 20:22:39) [MSC v.1200 32 bit (Intel)] on win32
import time
t0
Kamilche <[EMAIL PROTECTED]> wrote:
> Well, I look forward to seeing the new version. I have the old version
> of the Python cookbook, it was very useful!
I hope the new one is even better -- many more recipes, all updated to
Python 2.3 and 2.4. The old one will remain useful for all those who
n
Ray Schumacher wrote:
I have a need for a time.clock() with >0.16 second (16us) accuracy.
The sleep() (on Python 2.3, Win32, at least) has a .001s limit.
Are they lower/better on other's platforms?
The meaning of time.clock() is entirely different on other platforms.
See the documentation. Yo
alternatively you could use the now() method of the datetime module, it
has a resolution of 1 microsecond
--
http://mail.python.org/mailman/listinfo/python-list
"Xah Lee" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> the beginning two paragraphs should be deleted. Nobody gives a shit
> except a few smug academicians where the author wrote it for pleasing
> himself. For 99% of readers, it is incomprehensible and irrelevant.
>
> the first p
Hi,
this is to let you know about a new release of eric3, the Python IDE. It
has a bunch of new functions. The most prominent ones are listed below.
- added some dialog wrappers that make eric3 use KDE dialogs, if KDE and
PyKDE are installed
- added a previewer for UI files
- added a previewer fo
Hello,
Is there someone who use PSE ?
I have a strange problem, i don't see how pse.conf
is managed.
Indeed althoug I make modifications on it nothind is take
in account.
I have also erases it !!! and PSE doesn't claim anything !!!
Can someone help me ?
Regards
Salvatore
--
http://mail.python.org/m
Ray Schumacher <[EMAIL PROTECTED]> writes:
> I have a need for a time.clock() with >0.16 second (16us) accuracy.
> The sleep() (on Python 2.3, Win32, at least) has a .001s limit.
>
> Are they lower/better on other's platforms?
>
> The alternative appears to be more C code...
C code is your
> Most texts in computing are written by authors to defend and showcase
> their existence against their peers.
When you aren't busy `showcasing' your ignorance, this is *all* i see
in everything you write.
> In a tutorial, nobody cares how
> the language compared to x y and z, or what technicalit
effbot.org proudly presents release 0.9.8 of the cElementTree library,
a fast and very efficient implementation of the ElementTree API, for
Python 2.1 and later. On typical documents, it's 15-20 times faster
than the Python version of ElementTree, and uses 2-5 times less
memory.
Here are some ben
Fredrik Lundh wrote:
> see section 6.1.2 in the tutorial:
> [snip]
I believe Sam was talking about "frozen" python scripts using tools
such as py2exe:
http://starship.python.net/crew/theller/py2exe/
As to how the actual process works, I'm not qualified to answer
(having only read an article in t
In perl, I might do (made up example just to illustrate the point):
if(/add (\d+) (\d+)/) {
do_add($1, $2);
} elsif (/mult (\d+) (\d+)/) {
do_mult($1,$2);
} elsif(/help (\w+)/) {
show_help($1);
}
or even
do_add($1,$2) if /add (\d+) (\d+)/;
do_mult($1,$2) if /mult (\d+) (\d+)/;
show_help($1
Fredrik Lundh wrote:
> oh, you mean that "python compiler" didn't mean "the python compiler".
> [snip]
I simply inferred that he was using the wrong terminology, being that
he said "binary" twice ;-)
sam wrote:
> I have seen some software written in python and delivered as binary form.
>
> How do
> My brain-teaser: What I'd like to do is read the last ~2K of a large
> number of large files on arbitrary servers across the net, without
> having to read each file from the beginning (which would be slow and
> resource inefficient)...
>
Proper googling would have revealed that HTTP 1.1 i
http://www3.boxke.net << click link for the good news
--
http://mail.python.org/mailman/listinfo/python-list
On Sun, 23 Jan 2005 08:27:49 -0800, EP wrote:
>
>> My brain-teaser: What I'd like to do is read the last ~2K of a large
>> number of large files on arbitrary servers across the net, without
>> having to read each file from the beginning (which would be slow and
>> resource inefficient)...
>>
>>
Understandable - i had difficulties understanding my problem too!
I don't really understand why I got that error message before - I
believe it was due to the fact that some other exception was being
raised inside results().
Anyway, the solution was to call rpdb.set_trace() inside the actual
metho
rm wrote:
Paul Rubin wrote:
Reinhold Birkenfeld <[EMAIL PROTECTED]> writes:
For those of you who don't know what YAML is: visit http://yaml.org/!
You will be amazed, and never think of XML again. Well, almost.
Oh please no, not another one of these. We really really don't need it.
well, I did lo
On Sat, 22 Jan 2005 10:03:27 -0800, aurora <[EMAIL PROTECTED]> wrote:
I am think more in the line of string.ljust(). So if we have a
list.ljust(length, filler), we can do something like
name, value = s.split('=',1).ljust(2,'')
I can always break it down into multiple lines. The good thing abo
QOTW: "XML with elementtree is what makes me never have [to] think about
XML again." -- Istvan Albert
"'Plays well with others' was a strong motivator for Python's design, and
that often means playing by others' rules." -- Tim Peters
Type mutability, and why some types are immutable. T
what about something like this?
>>> import re
>>> m = re.match(r"""(?Padd|mult) (?P\d+)
(?P\d+)""", 'add 3 5')
>>> from operator import add, mul
>>> op = {'add': add, 'mult: mul}
>>> op[m.groupdict()['operator']](int(m.groupdict()['int_1']),
int(m.groupdict()['int_2']))
8
--
http://mail.python.or
Daniel Bickett wrote:
> I believe Sam was talking about "frozen" python scripts using tools
> such as py2exe:
oh, you mean that "python compiler" didn't mean "the python compiler".
here are links to some more tools, btw:
http://effbot.org/zone/python-compile.htm
--
http://mail.python
Xah Lee wrote:
the first paragraph of 9.1 "A Word About Terminology" is epitome of
masturbation. The entire 9.1 is not necessary.
Large part of 9.2 "Python Scopes and Name Spaces" is again
masturbatory.
So I can just take a copy of the tutorial to the bathroom next time.
Thanks for the tip, man!
Fredrik Lundh wrote:
Daniel Bickett wrote:
I believe Sam was talking about "frozen" python scripts using tools
such as py2exe:
oh, you mean that "python compiler" didn't mean "the python compiler".
I wouldn't assume a novice uses terms the same way you would. It was
quite clear from his message
Nah, I don't think it's a function, but rather a builtin "statement". But it's
possible to invoke it as an function; print( "test" ) works fine.
So I wonder, what _is_ exactly the print statement? The untraditional way of
invoking it(without paranteses) makes me wonder.
The reason I thinks abo
Frans Englich wrote:
> Nah, I don't think it's a function, but rather a builtin "statement". But it's
> possible to invoke it as an function; print( "test" ) works fine.
>
> So I wonder, what _is_ exactly the print statement? The untraditional way of
> invoking it(without paranteses) makes me wond
Frans Englich wrote:
Nah, I don't think it's a function, but rather a builtin "statement". But it's
possible to invoke it as an function; print( "test" ) works fine.
That is not invoking it as a function. The parentheses are only for
ordering the expression on the right
You can do this too:
>>>
>> The reason I thinks about this is I need to implement a debug print for my
>> program; very simple, a function/print statement that conditionally prints
>> its message whether a bool is true. Not overly complex.
>>
>> I tried this by overshadowing the print keyword, but that obviously didn't
>>
On Sunday 23 January 2005 18:04, Michael Hoffman wrote:
> Frans Englich wrote:
[...]
> if command_line_debug_option:
> debug = _debug_true
> else
> debug = _debug_false
I find this a nice solution. The most practical would be if it was possible to
do this with print, of course. But prin
dear friends ,
I found a code which calculates pi with an interesting algorithm the programme code is below:
from sys import stdout
def f((q,r,t,k)): n = (3*q+r) / t if (4*q+r) / t == n: return (10*q,10*(r-n*t),t,k,n) else: return (q*k, q*(4*k+2)+r*(2*k+1),t*(2*k+1),k+1)
# C
Frans Englich wrote:
> I find this a nice solution. The most practical would be if it was possible to
> do this with print, of course. But print won't budge.
you can disable print, though:
class dev_null:
def write(self, text):
pass
sys.stdout = dev_null()
or pipe al
Python 2.3.4 (#53, May 25 2004, 21:17:02) [MSC v.1200 32 bit (Intel)] on win32
Type "help", "copyright", "credits" or "license" for more information.
>>> import math
>>> math.pi
3.1415926535897931
Daniel Bickett
--
http://mail.python.org/mailman/listinfo/python-list
Ali Polatel wrote:
> I found a code which calculates pi with an interesting algorithm the
> programme code is below:
> [code snipped]
> This code gives the number in an unusual format like "3.1415'None'" it has
> a number part and a string part.
are you sure?
$ python pi.py
How many d
that's just little near to pi... pi is so far away ;)__Do You Yahoo!?Tired of spam? Yahoo! Mail has the best spam protection around http://mail.yahoo.com --
http://mail.python.org/mailman/listinfo/python-list
write the code type str(pi(5)) and see what I mean__Do You Yahoo!?Tired of spam? Yahoo! Mail has the best spam protection around http://mail.yahoo.com --
http://mail.python.org/mailman/listinfo/python-list
I'm not sure if it's just me (or, indeed, just google groups), but my
"python-list" folder (label, that is) in my gmail account looks less
and less similar to Google Groups' comp.lang.python with each day.
Not only that, c.l.py has been acting rather strange. Example that
happened just now: Ali Po
[Alan Kennedy]
>> From what I've seen, pretty much every textual markup targetted
>> for web content, e.g. wiki markup, seems to have grown/evolved
>> organically, meaning that it is either underpowered or overpowered,
>> full of special cases, doesn't have a meaningful object model, etc.
[Fredrik
[Alan Kennedy]
>>So, I'm hoping that the learned folks here might be able to give me
>>some pointers to a markup language that has the following
>>characteristics
[Paul Rubin]
> I'm a bit biased but I've been using Texinfo for a long time and have
> been happy with it. It's reasonably lightweight
Ali Polatel wrote:
> write the code type str(pi(5)) and see what I mean
it helps if you post the code you want help with in your first post,
so people don't have to guess.
the pi function doesn't return anything, it prints the value to stdout
(that's what the stdout.write things are doing).
if
Daniel Bickett wrote:
John Lenton wrote:
On Sun, Jan 23, 2005 at 01:53:52PM -0500, Daniel Bickett wrote:
Is there a reason that Google Groups isn't mirroring python-list
exactly like it used to, or is it simply a conspiracy I'm not in on?
You should not ask this kind of question in a public forum,
Nick Coghlan wrote:
Steven Bethard wrote:
I wrote:
> If you really want locals that don't contribute to arguments, I'd be
> much happier with something like a decorator, e.g.[1]:
>
> @with_consts(i=1, deftime=time.ctime())
> def foo(x, y=123, *args, **kw):
>return x*y, kw.get('which_time'
> On Sun, Jan 23, 2005 at 01:53:52PM -0500, Daniel Bickett wrote:
> >
> > Is there a reason that Google Groups isn't mirroring python-list
> > exactly like it used to, or is it simply a conspiracy I'm not in on?
>
> You should not ask this kind of question in a public forum,
and *you* should kno
Hello,
to train my Python skills I am looking for some project I can contribute
to. I learned Python about one year ago, and had already some
programming background behind (I contributed to SharpDevelop for
instance), so I'm not the complete newbie.
About myself: I'm a 20 year old German with str
Bengt Richter wrote:
On Sat, 22 Jan 2005 16:22:33 +1000, Nick Coghlan <[EMAIL PROTECTED]> wrote:
Steven Bethard wrote:
I wrote:
> If you really want locals that don't contribute to arguments, I'd be
> much happier with something like a decorator, e.g.[1]:
>
> @with_consts(i=1, deftime=time.ctime()
Patch / Bug Summary
___
Patches : 273 open ( +1) / 2746 closed ( +9) / 3019 total (+10)
Bugs: 797 open ( +4) / 4789 closed (+12) / 5586 total (+16)
RFE : 166 open ( +1) / 141 closed ( +0) / 307 total ( +1)
New / Reopened Patches
__
fix distu
Orlando Vazquez wrote:
Tim Daneliuk wrote:
For some reason, I am having the hardest time doing something that should
be obvious. (Note time of posting ;)
Given an arbitrary string, I want to find each individual instance of
text in the form: "[PROMPT:optional text]"
I tried this:
y=re.compile
Hi,
I am trying to sort how to best programmatically run the debugger on a
program, and another way that I am trying to explore is by using the
bdb module. There isn't any documentation for this and I have tried
reading through the source, which includes an example/test at the end
of bdb.py on
Hi !
Very more simplistic, but easy for to code :
def pi(nb):
cpi=0
for i in xrange(1,nb,4):
cpi=cpi+4./i-4./(i+2.)
return(cpi)
print pi(99)
@-salutations
--
Michel Claveau
--
http://mail.python.org/mailman/listinfo/python-list
On Sat, Jan 22, 2005 at 01:54:17AM +0100, Uwe Mayer wrote:
> Any suggestions how I handle uninstallation? This was provided by automake
> rather mechanically. I didn't find a section on that in the distutils
> documentation... :(
I've been using distutils for a couple of projects I've written for
This is a summary of traffic on the `python-dev mailing list`_ from December
01, 2004 through December 15, 2004. It is intended to inform the wider Python
community of on-going developments on the list. To comment on anything
mentioned here, just post to `comp.lang.python`_ (or email
python-l
Michael Tobis wrote:
I have a similar problem. Here's what I do:
.def new_robot_named(name,indict=globals()):
. execstr = name + " = robot('" + name + "')"
. exec(execstr,indict)
.class robot(object):
. def __init__(self,name):
. self.name = name
. def sayhi(self):
. print "Hi! I
Michael Tobis wrote:
> I have a similar problem. Here's what I do:
>
> .def new_robot_named(name,indict=globals()):
> . execstr = name + " = robot('" + name + "')"
> . exec(execstr,indict)
>
> .class robot(object):
> . def __init__(self,name):
> . self.name = name
>
> . def sayhi(se
Frans Englich <[EMAIL PROTECTED]> wrote:
> Nah, I don't think it's a function, but rather a builtin "statement". But
> it's possible to invoke it as an function; print( "test" ) works fine.
That's not calling it as a function. The parens in this case are simply
evaluated as grouping operators a
In case anyone is interested, here is the latest.
I implemented an edit distance technique based on tokens. This
incorporated a number of the ideas discussed in the thread.
It works pretty well on my data. I'm getting about 95% matching now,
compared with 90% for the simple technique I originall
Roy Smith wrote:
>> So I wonder, what _is_ exactly the print statement? The untraditional way of
>> invoking it(without paranteses) makes me wonder.
>
> It's a statement, just like "write" in Fortran. When C came around, the
> idea of a language having no built-in print statement and having to
Hello
I'm not sure this is Python-related but it might be since Bash and vim
works perfectly.
I connect to my server using SSH and then run 'python' to enter the
shell. I can't use the arrow buttons (up, down, left and right).
Instead I get this ^[[A , ^[[B, ^[[C or ^[[D.
How do I get my arro
På 23. jan 2005 kl. 21:55 skrev Nils Emil P.Larsen:
I connect to my server using SSH and then run 'python' to enter the
shell. I can't use the arrow buttons (up, down, left and right).
Instead I get this ^[[A , ^[[B, ^[[C or ^[[D.
Your Python installation is probably compiled without readline su
Frans Englich <[EMAIL PROTECTED]> writes:
> The reason I thinks about this is I need to implement a debug print for my
> program; very simple, a function/print statement that conditionally prints
> its message whether a bool is true. Not overly complex.
As several folks have said, print is a sta
Nick Coghlan wrote:
It also directly addresses the question of aliasing. Think about how
Steven's modified dictionary would react to this code:
pete = CreateRobot(2, 3)
dad = pete
dad.move()
pete.move()
If you'd like to handle these cases, but you don't want to have to
explain aliasing right off
Dear Python Colleague:
The PyCon Program Committee is happy to announce that
the opening keynote speech, at 9:30 am on Wednesday
March 23 will be:
Python on the .NET Platform, by
Jim Hugunin, Microsoft Corporation
Jim Hugunin is well-known in the Python world for his
pioneering work on
Thanks for the response. However, I continue to have problems. Allow me
to give some more detail.
For simplicity of testing, I hard coded the classpath and JVM path
(BTW getDefaultJVMPath() returns None on my system)
import os, os.path
from jpype import *
startJVM("C:/jdk1.5.0/jre/bin/client/jvm
Hi,
First,
My deepest thanks to Craig Ringer, Alex Martelli, Nick Coghlan and Terry Reedy
for having generously answered on the "Need help on need help on generator"
thread. I'm compiling the answers to sketch myself a global pictures about
iterators, generators, iterator-generators and lazine
Frans Englich wrote:
The reason I thinks about this is I need to implement a debug print for my
program; very simple, a function/print statement that conditionally prints
its message whether a bool is true. Not overly complex.
Sounds like you want to override sys.stdout:
py> class ConditionalWrit
Is there a module that sets the parity of a string? I have an
application that needs to communicate with a host using even parity
So what I need is before sending the message, convert it from space to
even parity. And when I get the response I need to convert that from
even to space parity.
The
Fredrik Lundh wrote:
Tim Daneliuk wrote:
Thanks - very helpful. One followup - your re works as advertised. But
if I use: r'\[PROMPT:[^]].*\]' it seems not to. the '.*' instead of just '*'
it matches the entire string ...
it's not "just '*'", it's "[^]]*". it's the "^]" set (anything but ])
Daniel Bickett wrote:
Most texts in computing are written by authors to defend and showcase
their existence against their peers.
When you aren't busy `showcasing' your ignorance, this is *all* i see
in everything you write.
Um, maybe that was his point...
--
http://mail.python.org/mailman/listinf
Leif K-Brooks wrote:
I'm writing a relatively simple multi-user public Web application with
Python. It's a rewrite of a similar application which used PHP+MySQL
(not particularly clean code, either). My opinions on various Web
frameworks tends to vary with the phase of the moon, but currently, I
Your formulation in Python is recursive (hamming calls hamming()) and I
think that's why your program gives up fairly early.
Instead, use itertools.tee() [new in Python 2.4, or search the internet
for an implementation that works in 2.3] to give a copy of the output
sequence to each "multiply by N
I have a similar problem. Here's what I do:
.def new_robot_named(name,indict=globals()):
. execstr = name + " = robot('" + name + "')"
. exec(execstr,indict)
.class robot(object):
. def __init__(self,name):
. self.name = name
. def sayhi(self):
. print "Hi! I'm %s!" % self.nam
I'm looking at rewriting parts of Twisted and TwistedSNMP to eliminate
__del__ methods (and the memory leaks they create). Looking at the docs
for 2.3's weakref.ref, there's no mention of whether the callbacks are
held with a strong reference. My experiments suggest they are not...
i.e. I'm
"snacktime" wrote:
> Is there a module that sets the parity of a string? I have an
> application that needs to communicate with a host using even parity
> So what I need is before sending the message, convert it from space to
> even parity. And when I get the response I need to convert that from
John Lenton wrote:
> > On Sun, Jan 23, 2005 at 01:53:52PM -0500, Daniel Bickett wrote:
> > >
> > > Is there a reason that Google Groups isn't mirroring python-list
> > > exactly like it used to, or is it simply a conspiracy I'm not in on?
> >
> > You should not ask this kind of question in a publi
Andrew McLean wrote:
> In case anyone is interested, here is the latest.
> def insCost(tokenList, indx, pos):
> """The cost of inserting a specific token at a specific
normalised position along the sequence."""
> if containsNumber(tokenList[indx]):
> return INSERT_TOKEN_WITH_NUMBER
Mike C. Fletcher <[EMAIL PROTECTED]> wrote:
> weakref.ref( self, self.close )
>
> but the self.close reference in the instance is going away *before* the
> object is called.
Uh -- what's holding on to this weakref.ref instance? I guess the
weakreference _itself_ is going away right afte
Paul Rubin wrote:
There's tons of such examples, but python-dev apparently reached
consensus that the Python maintainers were less willing than the
maintainers of those other packages to deal with those issues.
As Andrew says, it is not apparent that there was consensus.
Martin, do you know more ab
Michael Goettsche wrote:
I convinced my CS teacher to use Python in school. We currently have 2.2
installed on a Windows 2000 Terminal server. I asked the system administrator
to upgrade to Python 2.4, but he didn't succeed in doing it. He used the
microsoft installer package, which according to
On Sun, 23 Jan 2005 23:52:29 +0100, Fredrik Lundh
<[EMAIL PROTECTED]> wrote:
> "snacktime" wrote:
>
> > Is there a module that sets the parity of a string? I have an
> > application that needs to communicate with a host using even parity
> > So what I need is before sending the message, convert i
Erik Max Francis wrote:
>> To do this efficiently on a large file (dozens or hundreds of megs), you
>> should use the
>> 'sizehint' parameter so as not to use too much memory:
>>
>> sizehint = 0
>> mylist = f.readlines(sizehint)
>
> It doesn't make any difference. .readlines reads the entire fi
1 - 100 of 139 matches
Mail list logo