Best way to trap errors in ftplib?

2005-01-11 Thread Peter A.Schott
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

Re: appending data to an xml file

2005-01-11 Thread Peter Hansen
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

Re: Excel module for Python

2005-01-12 Thread Peter Hansen
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

Re: Excel module for Python

2005-01-12 Thread Peter Hansen
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

Re: 2 versions of python on 1 machine

2005-01-12 Thread Peter Hansen
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

Re: Why would I get a TypeEror?

2005-01-12 Thread Peter Hansen
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

Re: pyserial and com port interrupts

2005-01-12 Thread Peter Hansen
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

Re: Octal notation: severe deprecation

2005-01-13 Thread Peter Hansen
-16 should be used. (It would be cute but pointless to allow 1x00000. :-) -Peter -- http://mail.python.org/mailman/listinfo/python-list

Re: pyserial and com port interrupts

2005-01-13 Thread Peter Hansen
;s almost no place better to start learning than with Python and c.l.p. :-) -Peter -- http://mail.python.org/mailman/listinfo/python-list

Re: why are people still using classic classes?

2005-01-13 Thread Peter Hansen
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

Re: Unclear On Class Variables

2005-01-13 Thread Peter Hansen
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

Re: [perl-python] 20050112 while statement

2005-01-13 Thread Peter Maas
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

Re: How to install pyparallel

2005-01-13 Thread Peter Hansen
p://groups.google.ca/groups?q=parallel+ppdev0+failed+to+register+device -Peter -- http://mail.python.org/mailman/listinfo/python-list

Re: python 2.3.4 for windows: float("NaN") throws exception

2005-01-13 Thread Peter Hansen
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

Re: from __future__ import decorators

2005-01-13 Thread Peter Otten
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

Re: [perl-python] 20050112 while statement

2005-01-13 Thread Peter Hansen
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

Re: Refactoring; arbitrary expression in lists

2005-01-13 Thread Peter Maas
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

Re: News Reader

2005-01-13 Thread Peter Hansen
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

Re: newbie ?s

2005-01-13 Thread Peter Hansen
;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

Re: porting C code

2005-01-13 Thread Peter Hansen
it as code rather than inline in your text would avoid the possibility of confusion. -Peter -- http://mail.python.org/mailman/listinfo/python-list

Re: porting C code

2005-01-13 Thread Peter Hansen
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

Re: Python.org, Website of Satan

2005-01-13 Thread Peter Renzland
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

Re: (objects as) mutable dictionary keys

2005-01-14 Thread Peter Maas
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') --- --

Re: python and macros (again) [Was: python3: 'where' keyword]

2005-01-14 Thread Peter Maas
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'

Re: [perl-python] 20050113 looking up syntax

2005-01-14 Thread Peter Hansen
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

Re: Com port interrupts again

2005-01-14 Thread Peter Hansen
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

Re: porting C code

2005-01-14 Thread Peter Hansen
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

Re: accessing class variables of private classes

2005-01-16 Thread Peter Otten
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

Re: why are some types immutable?

2005-01-16 Thread Peter Maas
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

Re: [perl-python] 20050115, for statement

2005-01-16 Thread Peter Hansen
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

Re: (objects as) mutable dictionary keys

2005-01-17 Thread Peter Maas
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'

Re: pychecker - sets.Set need to be overridden

2005-01-17 Thread Peter Otten
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

Re: Assigning to self

2005-01-17 Thread Peter Otten
;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

Re: python to mssql

2005-01-17 Thread Peter A.Schott
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

FTPLIB - retry files?

2005-01-17 Thread Peter A.Schott
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

Re: Assigning to self

2005-01-17 Thread Peter Otten
: >> > ... 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

Re: Assigning to self

2005-01-17 Thread Peter Otten
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

Re: dynamic data types

2005-01-17 Thread Peter Hansen
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

Re: python execution path

2005-01-17 Thread Peter Hansen
;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

Re: python execution path

2005-01-17 Thread Peter Hansen
[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

Re: Advice to a Junior in High School?

2005-01-18 Thread Peter Hansen
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

Re: Print to Windows default Printer

2005-01-18 Thread Peter Hansen
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

Re: hex notation funtion

2005-01-18 Thread Peter Hansen
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

Re: file copy portability

2005-01-18 Thread Peter Hansen
the Caveat listed in the docs for the MacOS system... -Peter -- http://mail.python.org/mailman/listinfo/python-list

FTPLIB & FTPS or SFTP?

2005-01-19 Thread Peter A.Schott
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

Re: Zen of Python

2005-01-19 Thread Peter Hansen
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

Re: rotor replacement

2005-01-20 Thread Peter Maas
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'

Re: FTPLIB & FTPS or SFTP?

2005-01-20 Thread Peter A.Schott
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:

Re: Print to Windows default Printer

2005-01-20 Thread Peter Hansen
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

Python and SOAP

2005-01-20 Thread Peter Schaefer
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

Re: spawn syntax + os.P_WAIT mode behavior + spawn stdout redirection

2005-01-20 Thread Peter Hansen
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

Re: Print a string in binary format

2005-01-20 Thread Peter Hansen
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

Re: Is there a library to parse Mozilla "mork" documents?

2005-01-20 Thread Peter Rowell
gi?id=241438 HTH, Peter -- http://mail.python.org/mailman/listinfo/python-list

Re: global variable, ok for string, bad for int

2005-01-20 Thread Peter Hansen
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

Re: Python and SOAP

2005-01-20 Thread Peter Schaefer
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.

Re: Graph and Table implementation

2005-01-21 Thread Peter Hansen
ormation you've provided, that could well be far from suitable. -Peter -- http://mail.python.org/mailman/listinfo/python-list

Re: Funny Python error messages

2005-01-21 Thread Peter Hansen
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

Re: need help on generator...

2005-01-21 Thread Peter Otten
"__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

Re: What YAML engine do you use?

2005-01-21 Thread Peter Hansen
and do write XML files by hand often.) -Peter -- http://mail.python.org/mailman/listinfo/python-list

Re: default value in a list

2005-01-22 Thread Peter Otten
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

Re: default value in a list

2005-01-22 Thread Peter Otten
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

Re: [OT] XML design intent [was Re: What YAML engine do you use?]

2005-01-22 Thread Peter Hansen
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

Re: compile python to binary

2005-01-23 Thread Peter Hansen
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

Re: OT: problems mirroring python-list to c.l.py?

2005-01-23 Thread Peter Hansen
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

Re: Set parity of a string

2005-01-23 Thread Peter Hansen
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://

Re: Set parity of a string

2005-01-23 Thread Peter Hansen
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

Re: Help on project, anyone?

2005-01-23 Thread Peter Hansen
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

Re: delay and force in Python

2005-01-24 Thread Peter Otten
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

Re: compile python to binary

2005-01-24 Thread Peter Hansen
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

Re: Memory Usage

2005-01-24 Thread Peter Hansen
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

Re: Memory Usage

2005-01-24 Thread Peter Hansen
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

Re: What YAML engine do you use?

2005-01-24 Thread Peter Hansen
n old thread from 2001: http://groups.google.ca/groups?selm=9db3oi01aph%40news2.newsguy.com -Peter -- http://mail.python.org/mailman/listinfo/python-list

Re: how to call python code from C#

2005-01-24 Thread Peter Hansen
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

Re: Tuple slices

2005-01-24 Thread Peter Hansen
ou care whether it is a "view" or a new object. -Peter -- http://mail.python.org/mailman/listinfo/python-list

Re: What's so funny? WAS Re: rotor replacement

2005-01-24 Thread Peter Hansen
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

Re: smtplib bug with Windows XP

2005-01-24 Thread Peter Hansen
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

Re: [perl-python] 20050125 standard modules

2005-01-25 Thread Peter Nuttall
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

Re: string.atoi and string.atol broken?

2005-01-25 Thread Peter Otten
) 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

Re: string.atoi and string.atol broken?

2005-01-26 Thread Peter Otten
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

Re: string.atoi and string.atol broken?

2005-01-26 Thread Peter Otten
, 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

Re: need help on generator... (re)

2005-01-26 Thread Peter Otten
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

Re: building Python: up arrow broken on SuSE Linux 8.2

2005-01-26 Thread Peter Maas
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

Re: string.atoi and string.atol broken?

2005-01-26 Thread Peter Otten
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) &

Re: string.atoi and string.atol broken?

2005-01-26 Thread Peter Otten
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

Re: "pickle" vs. f.write()

2005-01-26 Thread Peter Maas
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

Re: python without OO

2005-01-26 Thread Peter Maas
.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

Re: is there better 32 clock() timing?

2005-01-26 Thread Peter Hansen
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

Re: smtplib bug with Windows XP

2005-01-26 Thread Peter Hansen
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

Re: Help With Python

2005-01-26 Thread Peter Maas
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

Re: Set parity of a string

2005-01-26 Thread Peter Hansen
'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

Re: XOR on string

2005-01-26 Thread Peter Hansen
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

Re: Inherting from object. Or not.

2005-01-26 Thread Peter Hansen
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

Re: Responding to trollish postings.

2005-01-26 Thread Peter Hansen
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

Re: building Python: up arrow broken on SuSE Linux 8.2

2005-01-27 Thread Peter Otten
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:/

Re: string.atoi and string.atol broken? [OT]

2005-01-27 Thread Peter Otten
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

Re: Which is faster?

2005-01-27 Thread Peter Otten
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

Re: python without OO

2005-01-27 Thread Peter Maas
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

Re: python without OO

2005-01-27 Thread Peter Maas
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

Re: python without OO

2005-01-27 Thread Peter Maas
. -- --- 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

Re: Point of Sale

2005-01-27 Thread Peter Hansen
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

<    19   20   21   22   23   24   25   26   27   28   >