t. I realize that the
errObj in this case may not have the ability to convert to string, but am not
sure how to get the output otherwise. Not sure how to handle a retry of a
failure, either.
Thank you for your help!
-Peter Schott
--
http://mail.python.org/mailman/listinfo/python-list
ace I know that I've written '\n' and can just
seek to the end minus 8 bytes (when on Windows, anyway...).
-Peter
--
http://mail.python.org/mailman/listinfo/python-list
sam wrote:
I m wondering which Excel module is good to be used by Python?
Just use Excel's COM interface.
See also this helpful page to improve future responses:
http://www.catb.org/~esr/faqs/smart-questions.html
-Peter
--
http://mail.python.org/mailman/listinfo/python-list
an read CSV files, so just use the standard Python module "csv"
and write your files that way.
-Peter
--
http://mail.python.org/mailman/listinfo/python-list
readm=YLedndIVKMWwhn3cRVn-rA%40powergate.ca
(Was it just on my server or did others get this strange repost?)
-Peter
--
http://mail.python.org/mailman/listinfo/python-list
It's me wrote:
For this code snip:
a=3
b=(1,len(a))[isinstance(a,(list,tuple,dict))]
Why would I get a TypeError from the len function?
What did you expect the "length" of the integer 3 to be?
-Peter
--
http://mail.python.org/mailman/listinfo/python-list
zable
read timeout, you're closer to being interrupt-driven
than you are to what is traditionally called "polling".)
-Peter
--
http://mail.python.org/mailman/listinfo/python-list
-16 should be used.
(It would be cute but pointless to allow 1x00000. :-)
-Peter
--
http://mail.python.org/mailman/listinfo/python-list
;s almost no place
better to start learning than with Python and c.l.p. :-)
-Peter
--
http://mail.python.org/mailman/listinfo/python-list
uld classic classes ever be removed without us having manually
to fix all __init__ calls to the superclass?
-Peter
--
http://mail.python.org/mailman/listinfo/python-list
e, it will work the same way as Tim's
original did with integers:
class Spam(object):
... eggs = [3]
...
spam = Spam()
spam2 = Spam()
spam.eggs = [7]
>>> spam2.eggs
[3]
-Peter
--
http://mail.python.org/mailman/listinfo/python-list
It's a time sink. It's up to you wether you
want to post to this thread or do something useful. :)
--
---
Peter Maas, M+R Infosysteme, D-52070 Aachen, Tel +49-241-93878-0
E-mail 'cGV0ZXIubWFhc0B
p://groups.google.ca/groups?q=parallel+ppdev0+failed+to+register+device
-Peter
--
http://mail.python.org/mailman/listinfo/python-list
laris with python 2.3.4.
Could anybody explain what is possibly wrong here? is it bug or
feature?
Differences in the underlying platform/C library. No difference
here with similar platforms.
-Peter
--
http://mail.python.org/mailman/listinfo/python-list
ax.
>
> How could I best automate the process of making the syntax digestible
> by Python2.3 ?
Have a look at Bill Mill's redecorate utility:
http://llimllib.f2o.org/files/redecorate.py
Peter
--
http://mail.python.org/mailman/listinfo/python-list
ately, there are now two ways to post screwed up Python
code, and using tabs is only one of them.
The other is to post from Google Groups, and that's what Xah Lee
is doing.
(The rest of your advice, about going away, is pretty good though. ;-)
-Peter
--
http://mail.python.org/mailman/listinfo/python-list
cer than more nicely. :)
--
---
Peter Maas, M+R Infosysteme, D-52070 Aachen, Tel +49-241-93878-0
E-mail 'cGV0ZXIubWFhc0BtcGx1c3IuZGU=\n'.decode('base64')
---
--
http://mail.python.org/mailman/listinfo/python-list
to
set up.
Having to add the news server by first selecting "File->New->Account"
might qualify as important enough to mention too. ;-)
-Peter
--
http://mail.python.org/mailman/listinfo/python-list
;m not sure what, if anything, it has in the
way of CGI support, but that could probably be hacked
on pretty darn quick if you needed. At least Twisted
has support for server-side SSL (i.e. it can deal with
certificates).
-Peter
--
http://mail.python.org/mailman/listinfo/python-list
it as code rather than inline in your text
would avoid the possibility of confusion.
-Peter
--
http://mail.python.org/mailman/listinfo/python-list
Peter Hansen wrote:
but merely a "b[3]" reference somewhere, it would be referencing
the third element of an array called "b", which is possibly a byte,
"*Fourth* element... I'll come in again. Amongst our elements..."
-Peter
--
http://mail.python.org/mailman/listinfo/python-list
e up to?
What is the simplest/fastest Python program to determine how many
IP addresses sum up to 666?
The simplest/fastest enumerator?
The simplest/fastest that determines which ones of them are home pages?
BTW, www.churchofsatan.org is 216.168.224.70
That adds up to 666 + 12
Are they hed
p again in c.l.py.
--
---
Peter Maas, M+R Infosysteme, D-52070 Aachen, Tel +49-241-93878-0
E-mail 'cGV0ZXIubWFhc0BtcGx1c3IuZGU=\n'.decode('base64')
---
--
can't satisfy them all at the same time.
And goals provide a direction but are rarely reached. :)
--
---
Peter Maas, M+R Infosysteme, D-52070 Aachen, Tel +49-241-93878-0
E-mail 'cGV0ZXIubWFhc0BtcGx1c3IuZGU=\n'
k you,
I'll be sure to hurry off now and subscribe) there's no longer
any reason to post to the newsgroups, is there? Please?
-Peter
--
http://mail.python.org/mailman/listinfo/python-list
ow,
it hasn't been updated recently and, while I can't say how
it compares to PySerial, I believe it's fair to say at
this point in time that PySerial is the _de facto_ standard
way to do serial port stuff in Python. If it doesn't do
what you need, it's probably a good idea
e.
Between the clarifications you've got and Duncan's post,
you shouldn't have much more trouble now. :-)
-Peter
--
http://mail.python.org/mailman/listinfo/python-list
Uwe Mayer wrote:
> I need to access class variables of a class I'd like to make private:
>
> i.e.
> class __Bar(object):
> pass
>
> class __Foo(__Bar):
> def __init__(self):
> super(__Foo, self).__init__()
>
__Foo()
> Name Error: global name '_Foo__Foo' is not defined
>
> Here I w
latter
reason see:
http://www.python.org/moin/DictionaryKeys
--
---
Peter Maas, M+R Infosysteme, D-52070 Aachen, Tel +49-241-93878-0
E-mail 'cGV0ZXIubWFhc0BtcGx1c3IuZGU=\n'.deco
d delivering it to the web which in several ways is far more
than I've contributed in over five years. ;-) (Doffs hat to the
former newbie who achieved this.)
-Peter
--
http://mail.python.org/mailman/listinfo/python-list
ise a TypeError? Or did you wrap them with an object?
--
---
Peter Maas, M+R Infosysteme, D-52070 Aachen, Tel +49-241-93878-0
E-mail 'cGV0ZXIubWFhc0BtcGx1c3IuZGU=\n'
and warns that
you are instantiating an abstract base class, while the intention of the
Set class author was to make Sets "uncomparable" and unhashable by
overriding the corresponding superclass methods.
Peter
--
http://mail.python.org/mailman/listinfo/python-list
;c'), 'b': Foo(id='b')}
Note that putting the instances into the cache prevents them from being
garbage collected -- you may even end up with higher memory usage.
Use a weakref.WeakValueDictionary instead of the normal dict to fix that.
Peter
--
http://mail.python.org/mailman/listinfo/python-list
Brane,
What are you wanting to know specifically? What is your client machine
running? I've started using the Win32 modules to connect using ADODB and that
works for me on Windows XP (hopefully 2003 as well, but not tested yet). I
pulled those samples from someplace on the net using Goog
Is there any way to retry sending files with some delay up to a set number on
failure? Sometimes we encounter a locked file on our server or the destination
server and we want to retry that file in X seconds.
Not exactly sure how to go about that right now short of moving the files
elsewhere and
:
>> > ... return "Foo(id=%r)" % self.id
>> > ...
>>
>> I'm not sure, but I think this code misses one thing: that __init__ is
>> called each time __new__ returns it, as per the docs Peter posted.
>
> Ahem, John I ment :)
You are right -- just put the initialization into the __new__() method,
then.
Peter
--
http://mail.python.org/mailman/listinfo/python-list
upon in Python code?
Sorry, no answer here, but do you really want a singleton?
Singleton: "Ensure a class only has one instance, and provide a global point
of access to it"
whereas
Flyweight: "Use sharing to support large numbers of fine-grained objects
efficiently"
as per "Design Patterns" by Gamma et al.
Peter
--
http://mail.python.org/mailman/listinfo/python-list
ta type in Python, since they're all
"high level", the "very" part is meaningless, and they're
pretty much all more "dynamic" than most similar things in,
say, a language that's, uh, "less dynamic". ;-)
Really, think of it as marketin
;pdb", starting perhaps with the
following line inserted shortly above where you think your
bug might be:
import pdb; pdb.set_trace()
(run the code, wait for the prompt, type "?" for help, then
read the docs ;-) )
-Peter
--
http://mail.python.org/mailman/listinfo/python-list
[EMAIL PROTECTED] wrote:
Peter Hansen wrote:
The best approach, if it's really intended to be a debugging
aid, might be to learn about "pdb"
This is more of a what if-ish question I guess. I use pdb fairly
regularly, I'm just looking to extend my debugging toolki
anese course in the area, if you think it's really urgent.
Also, should I plan on adopting various aspects of the Japanese
culture as well, or will a mastery of the language be sufficient?
-Peter
--
http://mail.python.org/mailman/listinfo/python-list
different ways to do printing under Windows, and we
can't guess which approach you are trying, nor which
might be suitable for your needs.
-Peter
--
http://mail.python.org/mailman/listinfo/python-list
rd(b) for b in s)
Oops. Should be:
' '.join(['%02x' % ord(b) for b in s])
The first works fine under Python 2.4, actually... you
need the list comprehension only on previous versions.
-Peter
--
http://mail.python.org/mailman/listinfo/python-list
the
Caveat listed in the docs for the MacOS system...
-Peter
--
http://mail.python.org/mailman/listinfo/python-list
Does the ftplib support SFTP or FTPS? Is that part of a different module? We
have a handful of partners who use FTPS or SFTP and I need to pull/push files
to/from them.
Thank you for all of your help.
-Pete Schott
--
http://mail.python.org/mailman/listinfo/python-list
Jeff Shannon wrote:
Timothy Fitz wrote:
Which I agree with, and which makes sense. However your "gist" is a
different meaning. It's not that "Flat is better than nested" it's
that "Too flat is bad and too flat is nested so be as nested (or as
flat) as you have to be and no more." Perhaps Tim Peters
n the meantime.
But this is unlikely because there is no export regulation to ban
512bit as far as I know :)
--
---
Peter Maas, M+R Infosysteme, D-52070 Aachen, Tel +49-241-93878-0
E-mail 'cGV0ZXIubWFhc0BtcGx1c3IuZGU=\n'
Can't seem to hit the site right now. I'll have to try back later. From what I
can tell, there aren't any mirrors set up, either. Two quick recommendations is
promising, though.
Thanks for the recommendations.
-Pete
"Roger Binns" <[EMAIL PROTECTED]> wrote:
u set it up, or you
go into the Properties and make sure you configure it
properly on the Ports tab...
-Peter
--
http://mail.python.org/mailman/listinfo/python-list
Hello!
I'd like to write a SOAP client and a SOAP server
in Python.
Is SOAPy still the way to go, or are there better
methods?
Regards,
Peter
--
Meine E-Mail Adresse enthält keine Zahlen.
My email address doesn't contain numbers.
--
http://mail.python.org/mailman/listinfo/python-list
t;SMMTrainInput.xml")
How is the first 'cp' a path to a file? why does the desired executable have to
be named again as the first parameter?
Marginally educated guessing:
1. "cp" is a shell command, so no path is required or possible.
2. The repetition of the executable nam
themselves far more
productive learning to work with hexadecimal, which is nice
in this case since you'll automatically get the hex
representation of any non-printable character if you just
print the string with repr() around it.
-Peter
--
http://mail.python.org/mailman/listinfo/python-list
gi?id=241438
HTH,
Peter
--
http://mail.python.org/mailman/listinfo/python-list
re running,
reduced to the simplest form which still reproduces the
problem. The above code runs perfectly well, even if you
add the missing call to print_value() at the end of the module.
-Peter
--
http://mail.python.org/mailman/listinfo/python-list
On 21.01.2005 01:16, Nelson Minar wrote:
Peter Schaefer <[EMAIL PROTECTED]> writes:
SOAPy hasn't been maintained in awhile. The two contemporary options
are ZSI or SOAPpy, both at
http://pywebsvcs.sourceforge.net/
ZSI seems to have more serious development now, but neither is perfect.
ormation you've provided,
that could well be far from suitable.
-Peter
--
http://mail.python.org/mailman/listinfo/python-list
My funny bone must be broken today, though, because I don't
see these as very funny...
(Did you understand *why* you got your error?
You don't call iterators, you call .next() on them...)
-Peter
--
http://mail.python.org/mailman/listinfo/python-list
"__main__":
print list(gen(range(1, 5), 2, 4))
# prints:
# [(1, 2), (1, 2, 3), (2, 3), (2, 3, 4), (3, 4)]
Peter
--
http://mail.python.org/mailman/listinfo/python-list
and do write XML files by hand often.)
-Peter
--
http://mail.python.org/mailman/listinfo/python-list
and() variant that is not restricted to lists but works with
arbitrary iterables:
from itertools import chain, repeat, islice
def expand(iterable, length, default=None):
return islice(chain(iterable, repeat(default)), length)
Peter
--
http://mail.python.org/mailman/listinfo/python-list
Peter Otten wrote:
> Paul McGuire wrote:
>
>>> Is there an elegant way to assign to a list from a list of unknown
>>> size? For example, how could you do something like:
>>>
>>> >>> a, b, c = (line.split(':'))
>>> if line co
object delivered by an Object Request Broker, and sometimes a
stream of bytes arriving at a network socket.
These can all be described as "data objects".
"""
I would ask what part of that, or of the simple phrase
"data object", or even of the basic concept
ly at what the OP
meant, one should also consider that the word "binary"
can be quite ambiguous in the hands of a newbie.
After all, source code is stored in binary too...
-Peter
--
http://mail.python.org/mailman/listinfo/python-list
that it is a problem with a specific
part of this system, rather than being entirely unclear just
_what_ the problem is).
-Peter
--
http://mail.python.org/mailman/listinfo/python-list
ower level than your code.
As to the specific question: a module is not really required.
The parity value of a character depends only on the binary
value of that one byte, so a simple 128-byte substitution
table is all you need, plus a call to string.translate for
each string.
-Peter
--
http://
Peter Hansen wrote:
snacktime wrote:
Is there a module that sets the parity of a string?
As to the specific question: a module is not really required.
But here's one for you anyway. It raises an exception if any
input character is non-ASCII, otherwise when you call set_parity()
with a s
Georg Brandl wrote:
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 o
actly that:
> http://www.python.org/sf/1108272
I like it. Of course you always have to bear in mind that one giant leap for
a list could be _many_ small steps for an iterator.
Peter
--
http://mail.python.org/mailman/listinfo/python-list
sam wrote:
Peter Hansen wrote:
After all, source code is stored in binary too...
Sorry for the vagues terms. I meant compile a python script into a
binary program.
As I said, "binary" is a very ambiguous term, so your
clarification by itself wouldn't have helped. (That is,
wh
e you measuring it?
Just by looking at the Mem Usage column in the Task Manager?
-Peter
--
http://mail.python.org/mailman/listinfo/python-list
rbt wrote:
Peter Hansen wrote:
I would expect to see such behaviour, given how difficult it is
to measure *actual* memory usage. How are you measuring it?
Just by looking at the Mem Usage column in the Task Manager?
That's right. I look at that column. Should I measue mem usage in some
othe
n old thread from 2001:
http://groups.google.ca/groups?selm=9db3oi01aph%40news2.newsguy.com
-Peter
--
http://mail.python.org/mailman/listinfo/python-list
an ActiveX interface. Then you could just
use it via COM, like any other COM object. Lots of references
available via Google if you want to learn more about this
approach...
-Peter
--
http://mail.python.org/mailman/listinfo/python-list
ou care
whether it is a "view" or a new object.
-Peter
--
http://mail.python.org/mailman/listinfo/python-list
have had any crypto needs. This alone
invalidates your statement as it stands.
What did you really mean to say? Maybe "could" instead
of "would"? That would make the statement true, yet
somewhat pointless, and it doesn't contradict what
Martin wrote in either case.
-P
ror: (10053, 'Software caused connection abort')
Try manually, but think about these options: a firewall that
has suddenly been enabled, an SMTP server that now requires
authentication, some kind of proxy like what virus scanners
use (though why they would intercept outgoing mail I don't
know)...
-Peter
--
http://mail.python.org/mailman/listinfo/python-list
On Tuesday 25 Jan 2005 17:50, Dan Perl wrote:
> I was wrong. He is just crossposting to the newsgroups without having
> them as members of the group.
>
> I wish there was a good way like that to stop these daily postings!
>
You can just filter on [perl-python]
Pete
--
http://mail.python.org/mai
)
return "".join(digits)
if __name__ == "__main__":
assert itoa(4, 3) == "11"
assert itoa(13, 4) == "31"
assert itoa(12, 4) == "30"
assert itoa(8, 4) == "20"
Peter
--
http://mail.python.org/mailman/listinfo/python-list
yet seen anything beyond
base-16 in the wild.
By the way, does anyone know the Greek name for 36?
Peter
--
http://mail.python.org/mailman/listinfo/python-list
, digit = divmod(val, base)
> ... val_digits.append(digits[digit])
> ... result = "".join(reversed(val_digits))
> ... return sign + ("0" * (min_digits - len(result))) + result
> ...
>
Yes, that is a bit more general. For the cookbook you might consider
f
e is no such restriction to the iterable. All data can be read,
processed and garbage-collected immediately.
The gen() generator is a bit more complex in that it has to store a few
adjacent items instead of only one and allows for an arbitrary number of
functions (inlined as yield of an n-tuple) i
just prints "^[[A".)
Do you have the GNU readline library installed and within Python's
reach (lib in LD_LIBRARY_PATH or in /etc/ld.so.conf with subsequent
call of ldconfig)?
--
---
Peter Maas, M+R Infosysteme, D-52070 A
Peter Otten wrote:
> def itoa(n, base):
> assert 2 <= base <= 16
> if n < 0:
> digits = ["-"]
> n = -n
> else:
> digits = []
> while n:
> n, m = divmod(n, base)
&
Christos TZOTZIOY Georgiou wrote:
> On Wed, 26 Jan 2005 08:58:45 +0100, rumours say that Peter Otten
> <[EMAIL PROTECTED]> might have written:
>
>>By the way, does anyone know the Greek name for 36?
>
> triakontahexadecimal would be a nice compromise of greek and the
t;
age = 0
friends=[]
comment=""""""
me = person()
# store
pf = file('/tmp/pickletest', 'w')
pickle.dump(me, pf)
pf.close()
# load
pf = file('/tmp/pickletest', 'r')
me2 = pickle.load(pf)
pf.close()
This is sequential access
.price = price
per = person(name = 'Smith', age = 35, sex = 'male')
inv = invoice(name = 'Smith', product = 'bike', price = 300.0)
print per
print inv
--snip---
Either your program is small. Then you can do it alone. Or you will
reach step 4.
--
---
Peter Maas, M+R Infosysteme, D-52070 Aachen, Tel +49-241-93878-0
E-mail 'cGV0ZXIubWFhc0BtcGx1c3IuZGU=\n'.decode('base64')
---
--
http://mail.python.org/mailman/listinfo/python-list
nt "accuracy" above, and
on other things, this is either irrelevant, or contradicts
your first statement...
-Peter
--
http://mail.python.org/mailman/listinfo/python-list
Steve Christensen wrote:
In article <[EMAIL PROTECTED]>, [EMAIL PROTECTED] wrote:
thank Peter, elbert, for the suggestions. I hadn't thought of using
telnet to try to connect to the SMTP server. and when I do try, telnet
can't connect either, at least on port 25. On port 110, i
nto Python (Advanced)
--
---
Peter Maas, M+R Infosysteme, D-52070 Aachen, Tel +49-241-93878-0
E-mail 'cGV0ZXIubWFhc0BtcGx1c3IuZGU=\n'.decode('base64')
---
--
http://mail.python.org/mailman/listinfo/python-list
'll have to modify the way you are
forming the transmission packet. It appears they may want
the STX/ETX pair to be sent without being affected by the
parity process...
-Peter
--
http://mail.python.org/mailman/listinfo/python-list
user manuals for stuff. :-)
import operator
lrc = reduce(operator.xor, [ord(c) for c in string])
Note that this returns an integer, so if you plan
to send this as a byte or compare it to a character
received, use chr(lrc) on it first.
-Peter
--
http://mail.python.org/mailman/listinfo/python-list
2.2.1/whatsnew/sect-rellinks.html#SECTION00031
(Summary: inheriting from object gives you a "new-style" class,
not doing so gives you a classic class, and there are a
variety of differences resulting from that.)
-Peter
--
http://mail.python.org/mailman/listinfo/python-list
uot;, or "rue" (other than as the French "street").
Sad, really. ;-)
(Neither has it been updated in the last two years. :-( )
-Peter
--
http://mail.python.org/mailman/listinfo/python-list
adline.so.4.3. I guess it does not define
> these newer functions and so that is why the readline module was not
> configured in Setup to start with? That is the presumption I am working
> on.
Have you ensured (with yast) that readline-devel is actually installed?
Peter
--
http:/
ng/mail client, it does
> on groups.google.com (the post was in UTF-8, dammit! --excuse my romance
> language)
It did show up correctly, but was garbled in the response through technical
incompetence of the poster.
Peter
--
http://mail.python.org/mailman/listinfo/python-list
b/c//" --> "a/b/c"
or
"a/b/c" --> "a/b/"
"a/b/c//" --> "a/b/c/"
That is much more important.
Peter
--
http://mail.python.org/mailman/listinfo/python-list
lad you like it :)
--
---
Peter Maas, M+R Infosysteme, D-52070 Aachen, Tel +49-241-93878-0
E-mail 'cGV0ZXIubWFhc0BtcGx1c3IuZGU=\n'.decode('base64')
---
--
http://mail.python.org/mailman/listinfo/python-list
The bad thing about OO preachers is not OO but preaching. And you
are preaching, too ;)
--
---
Peter Maas, M+R Infosysteme, D-52070 Aachen, Tel +49-241-93878-0
E-mail 'c
.
--
---
Peter Maas, M+R Infosysteme, D-52070 Aachen, Tel +49-241-93878-0
E-mail 'cGV0ZXIubWFhc0BtcGx1c3IuZGU=\n'.decode('base64')
---
--
http://mail.python.org/mailman/listinfo/python-list
There's a good chance you'll need to use PySerial, if the
cash registers are connected via RS-232, but beyond that
there's not much to say without more info. I believe I
heard somebody talking about a Python POS system before
in this newsgroup, but I'm not sure: chec
2301 - 2400 of 9341 matches
Mail list logo