FOO" will
>> create two files.
>
> You may also find some native Mac OS X applications failing in strange
> ways.
Oh, that's why. :(
tom
--
It involves police, bailiffs, vampires and a portal to hell under a
tower block in Hackney.
--
http://mail.python.org/mailman/listinfo/python-list
yield tuple(map(getnext, xiters))
else:
raise StopIteration
def hasnext(xit):
return xit.hasNext()
def getnext(it):
return it.next()
def izip_peek(*xiters):
xiters = map(xiter, xiters)
while True:
z = t
the use of the library,
without sharing its address space!
On the flip side, we could argue that an application which uses a dynamic
library *is* a derivative work, since we need a header file from the
library to compile it, and that header file is covered by the GPL. What
happpens when you compile with a non-GPL but compatible header (say, one
you've clean-roomed) but link to a GPL library at runtime, though?
tom
--
I am the best at what i do.
--
http://mail.python.org/mailman/listinfo/python-list
(and mutable objects generally)
being unhashable is brokenness. I do think there's room for a range of
opinion, though, and i'm not sure what i think is right.
tom
--
Rapid oxidation is the new black. -- some Mike
--
http://mail.python.org/mailman/listinfo/python-list
py
I guess the thing to do is extract the C code from the RFC and compile it,
verify that it works, then stick loads of print statements in the C and
the python, to see where the states of the checksum engines diverge.
tom
--
Death to all vowels! The Ministry of Truth says vowels are plus
un
On Sun, 8 Jan 2006, Tom Anderson wrote:
> On Fri, 6 Jan 2006 [EMAIL PROTECTED] wrote:
>
>> below you find my simple python version of MD2 algorithm as described
>> in RFC1319 (http://rfc1319.x42.com/MD2). It produces correct results
>> for strings shorter than 16 Byt
;s happened. Or ...
class ImpossibleException(Exception):
def __init__(self, *args):
raise ImpossibleException, args
Although crashing the interpreter is probably overkill.
tom
--
Like Kurosawa i make mad films; okay, i don't make films, but if i did
they'd have a samurai.
--
http://mail.python.org/mailman/listinfo/python-list
enter
"testcompressor()" (or, in most cases, hit up-arrow and return) to reload
and test. You can obviously extend this a bit to make the test routine
take parameters which control the nature of the test, so you can easily
test a range of things, and you can have multiple different tes
On Thu, 12 Jan 2006, Mike Meyer wrote:
> well, we need a term for development environment built out of Unix
> tools
Disintegrated development environment? Differentiated development
environment? How about just a development environment?
tom
--
NOW ALL ASS-KICKING UNTIL THE END
--
ndalone program.
Ah, of course - to an true believer, emacs *is* the unix toolset.
:)
tom
--
NOW ALL ASS-KICKING UNTIL THE END
--
http://mail.python.org/mailman/listinfo/python-list
of making ints and floats do the
right thing when the answer would be complex, but as a pragmatic decision,
it might not be the right thing to do. It evidently wasn't thought it was
when python's current number system was designed. I think Tim Peters has
an opinion on this.
tom
--
Socialism - straight in the mainline!
--
http://mail.python.org/mailman/listinfo/python-list
On Mon, 16 Jan 2006, it was written:
> There's something to be said for that. Should ['a'..'z'] be a list or a
> string?
And while we're there, what should ['aa'..'zyzzogeton'] be?
tom
--
Socialism - straight in the mainline!
--
http://mail.python.org/mailman/listinfo/python-list
ke to see lazy lists used here - these look like lists, and
can be used exactly like a list, but if all you want to do is iterate over
them, they don't need to instantiate themselves in memory, so they're as
efficient as an iterator. The best of both worlds! I've written a sketch
of a
*IF* we truly needed an occasional "up to X *INCLUDED*"
> sequence, it should be in a syntax that can't FAIL to be noticed, such
> as range(X, endincluded=True).
How about first,,last? Harder to do by mistake, but pretty horrible in its
own way.
tom
--
Socialism - straight in the mainline!
--
http://mail.python.org/mailman/listinfo/python-list
;t change the fact that x**0.5 as is meant here is
> the principal (positive) real square root, and that can be true whether
> your hierarchy of numeric types includes a complex type or not.
Er, actually, i meant to write -1, but evidently missed a key, and failed
to check what
m Generator:
http://www.elsewhere.org/pomo
tom
--
Taking care of business
--
http://mail.python.org/mailman/listinfo/python-list
On Tue, 16 Jan 2006, it was written:
> Tom Anderson <[EMAIL PROTECTED]> writes:
>
>> The natural way to implement this would be to make .. a normal
>> operator, rather than magic, and add a __range__ special method to
>> handle it. "a .. b" would tr
>
> which would be equivallent to
>
> for i in sequence.range() & (::2):
Oh, that is nice. Still, you could also extend enumerate to take a range
as an optional second parameter and do this with it. Six of one, half a
dozen of the other, i suppose.
tom
--
Taking care of business
--
http://mail.python.org/mailman/listinfo/python-list
On Wed, 18 Jan 2006, Steven D'Aprano wrote:
> On Tue, 17 Jan 2006 23:34:40 +0000, Tom Anderson wrote:
>
>>>> So I don't really know what point you are making. What solution(s) for
>>>> 1**0.5 were you expecting?
>>>
>>> He's p
style. Changing the
constructor to take *values rather than values, and to validate the length
of the value tuple against the length of the index tuple, would be good,
but, since i'm lazy, is left as an exercise to the reader.
tom
--
Throwin' Lyle's liquor away is like pickin' a fight with a meat packing
plant! -- Ray Smuckles
--
http://mail.python.org/mailman/listinfo/python-list
return f(*args)
return starred_f
Which lets us write:
mysecondtable = map(star(list), mytable)
While we're here, we should also have the natural complement of star, its
evil mirror universe twin:
def bearded_star(f):
def bearded_starred_f(*args):
ret
On Sat, 21 Jan 2006, it was written:
> Tom Anderson <[EMAIL PROTECTED]> writes:
>
>>> listx/dictx/setx would be the display forms as well as the constructor
>>> forms.
>>
>> Could these even replace the current forms? If you want the equivalent
&g
LAS compiled in). I would wait for it.
Pardon my failure to RTFM, but does NumPy pick up the vecLib BLAS on Macs?
tom
--
It's the 21st century, man - we rue _minutes_. -- Benjamin Rosenbaum
--
http://mail.python.org/mailman/listinfo/python-list
in the basket *gently*.
Your second construction isn't the equivalent of the Rowling sentence,
though, where the adverb goes right after the verb; that would make it
"Sally, put gently the flower in the basket", which would be completely
awful. Or maybe it would be "Sally,
On Sat, 21 Jan 2006, Robert Kern wrote:
> Tom Anderson wrote:
>
>> Pardon my failure to RTFM, but does NumPy pick up the vecLib BLAS on Macs?
>
> Yes.
Excellent, thanks.
tom
--
forget everything from school -- you are programmer
--
http://mail.python.org/mailman/listinfo/python-list
ht forward (inline-appropriate) way to count the number of
'%s'es in the 'boilerplate' strings? ...or maybe a different and more
Pythonic way to do this? (Maybe I could somehow use generators?)
thx.
-tom!
--
http://mail.python.org/mailman/listinfo/python-list
27;fair']
for w in words:
yield w
message = "%s %s %s %s"
print message % SentenceGenerator()
(I ask because the above doesn't work)?
-tom!
--
http://mail.python.org/mailman/listinfo/python-list
global_imports.has_key(module):
do_stuff_to_import_module
...then I'm not so worried about putting it into every constructor.
Otherwise I'll do this trick, starting myDeferredModule = None and
only do the import if not None.
Thanks!
-tom!
--
http://mail.python.org/mailman/listinfo/python-list
Justin Azoff wrote:
> Of course..
>
> I should read the python documentation at
> http://docs.python.org/lib/typesseq-strings.html
Excellent. Thanks. Has this been around long? I "learned" Python in
the 1.6 days iirc, but haven't done much except simple scri
eld v
v += 1
NextId = NewId().next
BUTTON_OK = NextId()
BUTTON_CANCEL = NextId()
BUTTON_YAY = NextId()
Hence my question being "something like" rather than "something
equivalent to". Alas, little did I know that the answer I was looking
for was not even up the same path.
-tom!
--
http://mail.python.org/mailman/listinfo/python-list
get_date()
self.wTree.get_widget("winCal").destroy()
if __name__ ==
'__main__':
app = winCal()
A
ng threads with Qt on Windows is a problem?
3) Threads in python on Windows is a problem?
Any ideas?
Thanks,
Tom
--
http://mail.python.org/mailman/listinfo/python-list
On Wednesday 02 August 2006 16:02, Tom Brown wrote:
> I've written a python app that r/w eight serial ports to control eight
> devices using eight threads. This all works very nicely in Linux. I even
> put a GUI on it using PyQt4. Still works nicely.
>
> Then I put the app on
for a form, I use wireshark
(www.wireshark.org) to capture the POST I do manually the first time.
However, I think I'm going to look into mechanize/clientform now that I
know about it.
Hope this helps,
Tom
--
http://mail.python.org/mailman/listinfo/python-list
gram. I
switched to the root directory and tried again, but got the same
result.I ran a very similar program earlier and it ran fine.
What am I doing wrong? The program is:
#!/usr/bin/python2.4
i=1
while i<1:
print 'step 1',i
i+=1
raw_input()
print 'step 2'
sage:
myFile.write(struct.pack('>H', ord(unicode(c
?
Thanks from a unicode n00b,
-tom!
--
http://mail.python.org/mailman/listinfo/python-list
cked that you don't have more than 32
> characters in each "line" (2) padding with unichr(0) is acceptable.
This works frighteningly well. ;)
-tom!
--
http://mail.python.org/mailman/listinfo/python-list
print '\n', '\t'*indent, stripped
files = glob.glob('*.cpp')
for f in files:
ConvertBraces(f)
...that may well get you started. ;)
For fancy stuff like comment matching I'll suggest the re library.
-tom!
--
http://mail.python.org/mailman/listinfo/python-list
class scope
like the OP has done:
> > class A:
> > name = ""
> > data = []
You define them when you attach them to an instance, e.g.
class A:
def __init__(self):
self.member1 = 'a'
def ThisWorksToo(self):
self.member2 =
understand that pulling the trigger will yield a large
hole in the back of your skull." My reading of the OP's post was that
shared attributes were not desired.
-tom!
--
http://mail.python.org/mailman/listinfo/python-list
#x27;t save
> xl.Application.Quit() # quit Excel
You've got a lot of sleep calls in there- did you find that things
behaved erratically without them? I haven't done any Office
automation with Python, but my DevStudio stuff has always worked a
treat without the sleep calls.
-tom!
--
http://mail.python.org/mailman/listinfo/python-list
Is there a cross-linked version of the python documentation available? Is
anyone interested in starting a project for such?
tom arnall
north spit, ca
usa
--
Posted via a free Usenet account from http://www.teranews.com
--
http://mail.python.org/mailman/listinfo/python-list
Simon Brunning wrote:
> On 10/20/06, tom arnall <[EMAIL PROTECTED]> wrote:
>> Is there a cross-linked version of the python documentation available? Is
>> anyone interested in starting a project for such?
>
> What do you mean by cross-linked?
If the term e.g. 'sp
r going the
unit-testing/'live code' route, which obviates the need for a debugger and
other clutter found in all of the IDEs i've seen. Also, you might think
about writing your own unit-tester. It's not difficult in python and will
give you a setup tailored to your own tastes.
on every machine before it'll work, but if that's what I need to
do, well, so be it. However, at this time I'm stumped as to what to
try except that I can have a dirty-feeling try/except bit to "enable"
that call...
thx,
-tom!
--
http://mail.python.org/mailman/listinfo/python-list
uble backslashing 'C:\\Temp\\Book1.csv' but it's
> uglier.
...alternatively you can just use 'unix slashes', e.g.
'c:/temp/book1.csv', since those work just fine 'cause the Windows
APIs deal with them properly.
-tom!
--
http://mail.python.org/mailman/listinfo/python-list
Tom Plunket wrote:
> I don't know anything about COM beyond the fact that I can look in the
> OLE/COM browser to maybe figure out the API that an object has that I
> need to operate on.
I'm still not entirely sure what's going on, because there are some
methods and prope
does anyone know of a utility to do a recursive dump of object data members?
--
Posted via a free Usenet account from http://www.teranews.com
--
http://mail.python.org/mailman/listinfo/python-list
Bruno Desthuilliers wrote:
> tom arnall a écrit :
>> does anyone know of a utility to do a recursive dump of object data
>> members?
>>
>
> What are "object data members" ? (hint: in Python, everything is an
> object - even functions and methods).
>
Steve Holden wrote:
> Bruno Desthuilliers wrote:
>> tom arnall a écrit :
>>
>>>does anyone know of a utility to do a recursive dump of object data
>>>members?
>>>
>>
>>
>> What are "object data members" ? (hint: in Python,
Steve Holden wrote:
> tom arnall wrote:
>> Steve Holden wrote:
>>
>>
>>>Bruno Desthuilliers wrote:
>>>
>>>>tom arnall a écrit :
>>>>
>>>>
>>>>>does anyone know of a utility to do a recursive dump of objec
d from the other thread...
def RequestFile(self, name):
self.fileQueue.append(name)
# called during the IO thread
def GetNextFile(self);
next = self.fileQueue[0]
self.fileQueue.pop(0)
return next
?
-tom!
--
http://mail.python.org/mailman/listinfo/python-list
() must be called with MyClass instance as
first argument (got nothing instead)
Please help...this is killing me!
-Tom
--
http://mail.python.org/mailman/listinfo/python-list
Language lovers:
Registration is now open for the 9th Annual ICFP Programming Contest!
http://icfpcontest.org/
The contest, associated with the International Conference on
Functional Programming, will be held on the weekend of July 21-24. The
contest task will be released at noon EDT on Frid
;
Messages = 0;
Size = 0;
UIDNext = 1;
UIDValidity = 287898056;
Unseen = 0;
};
Contacts = {
Class = IPF.Contact;
Messages = 0;
Size = 0;
UIDNext = 1;
UIDValidity = 287898056;
Unseen = 0;
};
}
-Tom
--
http://mail.python.org/mailman/listinfo
Well you cross-posted this enough, including a Java group, and didn't
even ask about us... What a pity.
In Java, classes can implement the Comparable interface. This interface
contains only one method, a compareTo(Object o) method, and it is
defined to return a value < 0 if the Object is considere
This just doesn't seem to work. It just brings me back to a login screen.
If you can lend a hand it would be much appreciated.
-Tom
--
http://mail.python.org/mailman/listinfo/python-list
y with it all until I tried to implement the 'Cancel' button.
Any more info, now several years after those threads I turned up?
thx,
-tom!
--
http://mail.python.org/mailman/listinfo/python-list
tp://python-mock.sourceforge.net/
>
> Oh yeah, and the download link for python-mock is:
> http://sourceforge.net/project/showfiles.php?group_id=138804
Heh, yeah I'm sure that's what I got when I went to sf.net and typed
in the project name, then submitted a bug for the homepag
, line 1, in ?
NameError: name 'function' is not defined
Is there a way I can know if 'foo' is a function?
thanks,
-tom!
--
http://mail.python.org/mailman/listinfo/python-list
s
"check box" if the value is a function
...I've still gotta figure out the exact API, this is for a plugin
sort of system that'll be used by the manually-driven version of the
build process and this data is explicitly to build the UI for the
various tools that are available.
thanks,
-tom!
--
http://mail.python.org/mailman/listinfo/python-list
George Sakkis wrote:
> tom arnall wrote:
>> >object data member dumper?
>> >George Sakkis george.sakkis at gmail.com
>> >Wed Nov 8 03:42:47 CET 2006
>>
>> > tom arnall wrote:
>> >
>> > > Bruno Desthuilliers wrote:
>> > &g
the
locals given by that function (is this a closure?) are changed each
iteration of the loop, whereas if the function definition is isn't
looped over, I get the behavior I desire. Can anyone provide any
insight for me?
thanks,
-tom!
First, the output:
Test 1 doesn't work the way I would
replaced by (count - 1).
Ah, I got it. Thanks. Thanks too to Gabriel.
-tom!
--
http://mail.python.org/mailman/listinfo/python-list
cially considering there's no
way to turn off the undesired changes, but were the changes /not/ made,
the same text could just be passed through TextWrapper and have them
removed...
thx,
-tom!
--
--
http://mail.python.org/mailman/listinfo/python-list
s this so you can mix tabs and spaces in Python source. Why anyone
would intentionally do that, though, I'm not sure. ;)
-tom!
--
--
http://mail.python.org/mailman/listinfo/python-list
eplacement though, that
started with textwrap.dedent(), removed the expandtabs() call, and
Does The Right Thing with tabs vs. spaces (e.g. it doesn't treat a tab
at the beginning of a line as the same as eight spaces).
-tom!
--
--
http://mail.python.org/mailman/listinfo/python-list
it not useful.
Stripping all leading spaces from text is as easy as calling lstrip() on
each line:
text = '\n'.join([line.lstrip() for line in text.split('\n')])
alas, that isn't what I am looking for, nor is that what
textwrap.dedent() is intended to do.
-tom!
--
--
http://mail.python.org/mailman/listinfo/python-list
o\n\tWorld"
expected = "\tHello\nWorld"
self.failUnlessEqual(expected, dedent(input, False))
def testFirstLineNotIndented(self):
input = "Hello\n\tWorld"
expected = input
self.failUnlessEqual(expected, dedent(input, False))
def testMixedTabsAndSpaces(self):
input = " \t Hello\n \tWorld"
expected = "\t Hello\n \tWorld"
self.failUnlessEqual(expected, dedent(input, False))
if __name__ == '__main__':
unittest.main()
-tom!
--
--
http://mail.python.org/mailman/listinfo/python-list
of thing in not-many-more-
lines-than-the-original-code-that-does-not-operate-to-its-published-
specification.
-tom!
--
--
http://mail.python.org/mailman/listinfo/python-list
has what appears to be a
considerably newer release than ActiveState in the first place, so I was
wondering if I could just install this entire package right over the
ActiveState installation, and everything would Just Work?
thanks,
-tom!
--
--
http://mail.python.org/mailman/listinfo/python-list
; >>>
I understand you're probably set, but instead of using readlines() you
could also do this:
g = os
h = g.read().split('\n')
and then your 'h' list would not have newlines.
-tom!
--
--
http://mail.python.org/mailman/listinfo/python-list
can have their preferred tabstop width, be it 8, 4, or 2 spaces.
Ironically, it has always seemed to me then that tabs are superior for
python editing, since mixing tabs and spaces in an environment like this
means that stuff won't run, whereas in C it'll still compile even if the
code loo
h is as much a statement about the lack of statement about
how you actually tested it as it is that an implementation was made
apparently without understanding of the requirements.
-tom!
--
--
http://mail.python.org/mailman/listinfo/python-list
t it's where I'd start looking.
Good luck,
-tom!
--
--
http://mail.python.org/mailman/listinfo/python-list
something on this
machine, but it was slow as death and only had dialup and I really
didn't want to deal with downloading and installing that stuff myself.
...of course your first problem is buying a machine with a ton of
shovelware on it. Second problem is uninstalling stuff without k
indows, that is required if you want to prevent a console
window from popping up if you're running in a GUI app.
-tom!
--
import subprocess
import sys
import time
if len(sys.argv) == 1:
# no command line arg means, "we're the parent process."
Tom Plunket wrote:
> while p.poll() == None:
> data = p.stdout.readline()
> if data:
> print data,
If you change that print to something more decorated, like,
print 'process said:', data,
Then it might be more
ubprocess.Popen(["python", "tobeforked.py"], ...
By default, python will execute in buffered mode if it's attached to a
pipe. Start it with the '-u' command line option and you may be good to
go. (`python -h` for more info on this, man pages may also discuss i
ding".
Right, but 'common leading whitespace' is a broader term but similarly
unambiguous. != , but there are two tabs of common
leading whitespace in '\t\t ' and '\t\t\t'.
-tom!
--
--
http://mail.python.org/mailman/listinfo/python-list
Gabriel Genellina wrote:
> Did you *actually* tried what Tom Plunket posted? Two tiny chars make
> a difference.
The sad irony is that before taking off for vacation I was struggling at
work with the same problem in some sense. I couldn't figure out why for
some processes I got
t its output to a
different window in your GUI. You could even make that window pop open
on demand, if errors occur.
good luck,
-tom!
--
--
http://mail.python.org/mailman/listinfo/python-list
and pasting the
clipboard into an email. Alternatively, they paste into MS Paint, save
the bitmap somewhere, and mail that to you.
Good luck,
-tom!
--
--
http://mail.python.org/mailman/listinfo/python-list
r set to show tabs
as fairly short, but my diff program shows them as eight characters. I
find that makes indentation changes easier to spot in the diffs.
-tom!
--
--
http://mail.python.org/mailman/listinfo/python-list
f you don't want to start all of your
commands at once, you need to not start all your commands at once. ;)
-tom!
--
--
http://mail.python.org/mailman/listinfo/python-list
actually
two, but the provided algorithm yields four.
-tom!
--
--
http://mail.python.org/mailman/listinfo/python-list
ult as it is today ("don't edit PATH"), though,
right? Doesn't make a whole lot of sense to add a new option and
default it to something completely different from the old behavior, does
it?
-tom!
--
--
http://mail.python.org/mailman/listinfo/python-list
iginal author deemed it important to
make those attributes private in the first place.
-tom!
--
--
http://mail.python.org/mailman/listinfo/python-list
y isn't useful
to me. My setup is, "tab equals this much space".
-tom!
--
--
http://mail.python.org/mailman/listinfo/python-list
d it!
Yep, I had a similar experience although a bit more forced. The editor
that I was using was configured out-of-the-box with variable-pitch, and
I didn't want to bother figuring out how to change it for the quickie
stuff I was writing, then eventually I found that it no longer bothered
me...
-tom!
--
--
http://mail.python.org/mailman/listinfo/python-list
word size of the machine. E.g. the MIPS 3000 and 4000 were
32 bits for every instruction, and PC was always a multiple of four.
...which means the parsing is pretty straight forward, but as you say,
simulating the rest of the machine is the hard part.
-tom!
--
--
http://mail.python.org/mailma
Bjoern Schliessmann wrote:
> Intels aren't RISC, are they?
Not the ones in PCs. The OP didn't specify the CPU that's being used,
however.
-tom!
--
--
http://mail.python.org/mailman/listinfo/python-list
[EMAIL PROTECTED] wrote:
> So, what library can I use to convert from RTF to PDF ? GPL / BSD
> Libraries are welcome.
If you could write to LaTeX files instead, you could then just use
pdflatex that comes with all of the LaTeX distributions.
-tom!
--
--
http://mail.python.org/m
I've used PDFfactory before,
but there are a number of free ones on SourceForge that may be worth a
shot), and just using MSWord via COM to print to that printer?
(This line of answers merely because nobody seems to know of a
directly-Python solution.)
-tom!
--
--
http://mail.python.org/mailman/l
n... line is enclosed in a try and then in an
if block.
The documentation on file.read() indicate that there's an option for
"non-blocking" mode, but I'm stumped as to how to even look for how to
enable and use that.
thanks,
-tom!
--
--
http://mail.python.org/mailman/listinfo/python-list
e
> language's author thought I might have meant.
Especially when that's Larry Wall ... :)
tom
--
Don't trust the laws of men. Trust the laws of mathematics.
--
http://mail.python.org/mailman/listinfo/python-list
e only serious
issue to me.
>> But with CPython I think we need the C versions.
Unless we use Shed Skin to translate the RPython into C++. Or maybe we
could write the code in Pyrex, generate C from that for CPython, then have
a python script which strips out the type definitions to genera
this is the wrong approach - if you
have a collection of serialised sparse matrices, for example, which
consist of identically-sized blocks of zeroes with a scattering of ones
throughout, then lengths and prefixes will be useless, whereas hashes will
work perfectly. However, here, we&
On Thu, 1 Feb 2006, it was written:
> Tom Anderson <[EMAIL PROTECTED]> writes:
>
>>> The obvious way is make a list of hashes, and sort the list.
>>
>> Obvious, perhaps, prudent, no. To make the list of hashes, you have to
>> read all of every single file f
table
displaying the information. It's probably neither the shortest nor the
cleanest bit of code in the universe, but it does the job and should, i
hope, be reasonably clear.
tom
[1] http://docs.hp.com/en/B2355-90743/ch06s02.html
--
Science Never Sleeps
--
http://mail.python.org/mailman/listinfo/python-list
401 - 500 of 667 matches
Mail list logo