Re: Yielding a chain of values

2005-08-31 Thread Bengt Richter
On Tue, 30 Aug 2005 21:23:39 -0400, Peter Hansen <[EMAIL PROTECTED]> wrote: >Bengt Richter wrote: >> On Tue, 30 Aug 2005 23:12:35 +0200, Reinhold Birkenfeld <[EMAIL PROTECTED]> >> wrote: >>>Bengt Richter wrote: Maybe yield in inner() could be sugar for the above and beco

Re: Bicycle Repair Man usability

2005-08-31 Thread Adriaan Renting
I know the Eric3 Python IDE integrates with BRM, but I haven't had a need for much refactoring yet, so I haven't installed BRM. I've only used Eric3's build-in limited refactoring yet. Adriaan Renting. -- http://mail.python.org/mailman/listinfo/python-list

Re: telnet.read_until() from telnetlib

2005-08-31 Thread Jacek Popławski
my newsreader told me that [EMAIL PROTECTED] wrote: > "If end of file is found and no text was read, raise EOFError. > Otherwise, when nothing matches, return (-1, None, text) where text is > the text received so far (may be the empty string if a timeout > happened). " What if: - exception has not

Re: Bug in string.find; was: Re: Proposed PEP: New style indexing, was Re: Bug in slice type

2005-08-31 Thread Antoon Pardon
Op 2005-08-30, Steve Holden schreef <[EMAIL PROTECTED]>: > Antoon Pardon wrote: >> Op 2005-08-29, Steve Holden schreef <[EMAIL PROTECTED]>: >> >>>Antoon Pardon wrote: >>> Op 2005-08-27, Steve Holden schreef <[EMAIL PROTECTED]>: >If you want an exception from your code when 'w' is

Re: Precise timings ?

2005-08-31 Thread Adriaan Renting
One of the limits of at least IBM compatible PC's is that in general they are not more accurate as about 1/64 th of a second if I recall correctly. I think this is the default tick size of the BIOS clock. Next to that the BIOS clock itself doesn't need to be very accurate, I can easily drift like

Re: Bug in string.find; was: Re: Proposed PEP: New style indexing,was Re: Bug in slice type

2005-08-31 Thread Antoon Pardon
Op 2005-08-30, Bengt Richter schreef <[EMAIL PROTECTED]>: > On 30 Aug 2005 10:07:06 GMT, Antoon Pardon <[EMAIL PROTECTED]> wrote: > >>Op 2005-08-30, Terry Reedy schreef <[EMAIL PROTECTED]>: >>> >>> "Paul Rubin" <"http://phr.cx"@NOSPAM.invalid> wrote in message >>> news:[EMAIL PROTECTED] >>> R

Re: Bug in string.find; was: Re: Proposed PEP: New style indexing,was Re: Bug in slice type

2005-08-31 Thread Bengt Richter
On 31 Aug 2005 07:26:48 GMT, Antoon Pardon <[EMAIL PROTECTED]> wrote: >Op 2005-08-30, Bengt Richter schreef <[EMAIL PROTECTED]>: >> On 30 Aug 2005 10:07:06 GMT, Antoon Pardon <[EMAIL PROTECTED]> wrote: >> >>>Op 2005-08-30, Terry Reedy schreef <[EMAIL PROTECTED]>: "Paul Rubin" <"http://ph

Re: Bug in string.find; was: Re: Proposed PEP: New style indexing,was Re: Bug in slice type

2005-08-31 Thread Antoon Pardon
Op 2005-08-31, Bengt Richter schreef <[EMAIL PROTECTED]>: > On 31 Aug 2005 07:26:48 GMT, Antoon Pardon <[EMAIL PROTECTED]> wrote: > >>Op 2005-08-30, Bengt Richter schreef <[EMAIL PROTECTED]>: >>> On 30 Aug 2005 10:07:06 GMT, Antoon Pardon <[EMAIL PROTECTED]> wrote: >>> Op 2005-08-30, Terry Reed

Re: Bicycle Repair Man usability

2005-08-31 Thread Sybren Stuvel
Rex Eastbourne enlightened us with: > Are there any Bicycle Repair Man users here? I am. > I recently got PyDev for Eclipse, which comes with BRM. I use it from VIM. > I am disappointed with what I've seen, although I'm not sure if I'm > using its full functionality. Why would it need more fun

Re: OpenSource documentation problems

2005-08-31 Thread Sybren Stuvel
Bryan Olson enlightened us with: > I don't see any need to look beyond Python for a good example of > poor documentation. Are there serious Python programmers who don't > constantly struggle with errors and omissions in the doc? I don't have any problems with the documentation. It just works for

Re: Jargons of Info Tech industry

2005-08-31 Thread John Bokma
Chris Head <[EMAIL PROTECTED]> wrote: > John Bokma wrote: >> And workplaces. Some people have more then one computer in the house. >> My partner can check her email when I had her over the computer. When >> I want to check my email when she is using it, I have to change the >> session, fire up T

Re: Jargons of Info Tech industry

2005-08-31 Thread John Bokma
"T Beck" <[EMAIL PROTECTED]> wrote: > John Bokma wrote: [ Death of Usenet has been predicted often ] > I suppose I was (as many people on the internet have a bad habit of > doing) being more caustic than was strictly necessary. I don't really > forsee the death of usenet anytime soon, I just do

Re: Yielding a chain of values

2005-08-31 Thread Matt Hammond
> Well, maybe it's right both ways ;-) I.e., even though yield "is" now > an expression, it is valid to use it as an expression-statement which > evaluates the expression and discards the value. So I think you could > still use the currently illegal "yield in" token sequence to mean that > what fol

Re: Code run from IDLE but not via double-clicking on its *.py

2005-08-31 Thread Richie Hindle
[n00m] > WHY ON THE EARTH <'module' object has no attribute 'AF_INET'> ??? Because you have a socket.py in d:\python23\00 which is being picked up instead of Python's own socket module. You shouldn't give your modules the same name as Python's own modules. -- Richie Hindle [EMAIL PROTECTED] --

Re: Adding bound methods dynamically...

2005-08-31 Thread Gregory Bond
Kevin Little wrote: > I want to dynamically add or replace bound methods in a class. I want I asked a seemingly-unrelated question a week or so ago, and learned something interesting: Python 2.3.4 (#2, Jul 12 2004, 12:46:36) [GCC 3.3] on sunos5 Type "help", "copyright", "credits" or "license"

Python doc problems example: gzip module

2005-08-31 Thread Xah Lee
today i need to use Python to decompress gzip files. since i'm familiar with Python doc and have 10 years of computing experience with 4 years in unix admin and perl, i have quickly located the official doc: http://python.org/doc/2.4.1/lib/module-gzip.html but after a minute of scanning, please

Re: OpenSource documentation problems

2005-08-31 Thread Michael Hudson
"Adriaan Renting" <[EMAIL PROTECTED]> writes: > The good commercial docs are better because there it is understood > how important this is. Also, they are probably written by people who are trained technical writers which has to help at least a bit... writing good documentation is hard. Whether

Re: Code run from IDLE but not via double-clicking on its *.py

2005-08-31 Thread n00m
Richie Hindle wrote: > Because you have a socket.py in d:\python23\00 which is being picked up > instead of Python's own socket module. You shouldn't give your modules > the same name as Python's own modules. Yes, Richie! YOU are dmndly RIGHT! Thanks. -- http://mail.python.org/mailman/listinfo

Re: Adding bound methods dynamically... CORRECTED

2005-08-31 Thread bruno modulix
Devan L wrote: > Kevin Little wrote: > >>I want to dynamically add or replace bound methods in a class. (snip) > I'm not an expert, but why do you need to dynamically add or replace > bound methods? To modify the behaviour at runtime ?-) There are a lot of idioms/patterns in dynamic language

Re: Python doc problems example: gzip module

2005-08-31 Thread Xah Lee
Today i need to use Python to compress/decompress gzip files. I quickly found the official doc: http://python.org/doc/2.4.1/lib/module-gzip.html I'd imagine it being a function something like GzipFile(filePath, comprress/decompress, outputPath) however, scanning the doc after 20 seconds there's

Re: Python doc problems example: gzip module

2005-08-31 Thread Peter Maas
Xah Lee schrieb: > today i need to use Python to decompress gzip files. > > since i'm familiar with Python doc and have 10 years of computing > experience with 4 years in unix admin and perl, i have quickly located > the official doc: > > http://python.org/doc/2.4.1/lib/module-gzip.html > > but

Re: Bug in string.find; was: Re: Proposed PEP: New style indexing,was Re: Bug in slice type

2005-08-31 Thread Bryan Olson
Paul Rubin wrote: > Not every sequence needs __len__; for example, infinite sequences, or > sequences that implement slicing and subscripts by doing lazy > evaluation of iterators: > > digits_of_pi = memoize(generate_pi_digits()) # 3,1,4,1,5,9,2,... > print digits_of_pi[5] # computes 6

[ANN] FreeImagePy 1.0.0

2005-08-31 Thread Michele Petrazzo
What is? It' a python wrapper for FreeImage, Open Source library for developers who would like to support popular graphics image formats. How work? It use a binary freeimage library present on the system and ctypes. It 's released with the two public license GPL/FIPL: GPL: GNU GENERAL PUBL

.pth files in working directory

2005-08-31 Thread Peter Maas
My goal is to have the top level of a directory tree in the Python path without touching anything outside the directory. I tried to create .pth files with the top level path in every subdirectory but this doesn't work despite working directory being part of the Python path. Creating the pth file i

strange behaviour of str()

2005-08-31 Thread Juho Vuori
Hello, I'm wondering about the following behaviour of str() with strings containing non-ASCII characters: str(u'foo') returns 'foo' as expected. str('lää') returns 'lää' as expected. str(u'lää') raises UnicodeEncodeError Is this behaviour sane? Possibly, but not documented at all. Somehow yo

Help with this error : Protocol wrong for this socket

2005-08-31 Thread bill . oldroyd
I am running Python 2.4.1 on a HP Tru64 Unix system. When try to carry out a DNS query as follows : t = socket.getaddrinfo("labs.bl.uk",None) I get the error message socket.error: (41, 'Protocol wrong type for socket') Am I right in thinking this is something to with the DNS lookup ?. Does any

change date format

2005-08-31 Thread Xah Lee
Apache by default uses the following format for date: 30/Aug/2005 is there a module that turn this directly into mmdd? Xah [EMAIL PROTECTED] ∑ http://xahlee.org/ -- http://mail.python.org/mailman/listinfo/python-list

Re: change date format

2005-08-31 Thread Lars Gustäbel
[Xah Lee] > Apache by default uses the following format for date: > 30/Aug/2005 > > is there a module that turn this directly into mmdd? Use time.strptime() and time.strftime(). Not a single occurrence of the f**k word. You're making progress. Keep it up! -- Lars Gustäbel [EMAIL PROTECTED]

Re: Python doc problems example: gzip module

2005-08-31 Thread Fredrik Lundh
Peter Maas wrote: > Please feel free to insert this fucking example into the fucking docs. or use the fucking search engine. searching for "python example" and clicking the "I feel lucky" button tends to work quite well. e.g. http://www.google.com/search?q=python+gzip+example&btnI=

Re: strange behaviour of str()

2005-08-31 Thread Fredrik Lundh
Juho Vuori wrote: > str(u'lää') raises UnicodeEncodeError > Is this behaviour sane? Possibly, but not documented at all. str() on a Unicode string attempts to convert the string to an 8-bit string using Python's default encoding, which is ASCII. "ä" is not an ASCII character. if this problem a

Re: Bicycle Repair Man usability

2005-08-31 Thread bruno modulix
matt wrote: (snip) > I'd like to hear other's experiences with refactoring in python. Most > of the projects I work on are quite small relative to some of the Java > projects I've worked on. Python being much less verbose and much more dynamic than Java, the LOCs/functionnalities ratio can be v

use threading without classes

2005-08-31 Thread billiejoex
Hi all. Hi would like to use two threads in a program but all the examples I found on the net use oop programming that I doesn't love too much. :-) Can you code me a short example in wich two different functions are executed at the same time, plz? Thank you all. -- http://mail.python.org/mail

strange behaviour of str()

2005-08-31 Thread Uwe Schmitt
> > Hello, > > I'm wondering about the following behaviour of str() with strings > containing non-ASCII characters: > > str(u'foo') returns 'foo' as expected. > > str('lää') returns 'lää' as expected. > > str(u'lää') raises UnicodeEncodeError > This does not work, because you need an encode

Re: use threading without classes

2005-08-31 Thread Harlin Seritt
Is there any reason why you wouldn't want to do this using the the threading class? To each his own I suppose. You can try the following though you'll at least need to use functions: import time import thread def myfunction(string,sleeptime,*args): while 1: print string time

Re: Yielding a chain of values

2005-08-31 Thread Reinhold Birkenfeld
Matt Hammond wrote: >> Well, maybe it's right both ways ;-) I.e., even though yield "is" now >> an expression, it is valid to use it as an expression-statement which >> evaluates the expression and discards the value. So I think you could >> still use the currently illegal "yield in" token sequence

Re: change date format

2005-08-31 Thread Fredrik Lundh
Lars Gustäbel wrote: > Not a single occurrence of the f**k word. You're making progress. perhaps, but why is he posting apache questions to the python list? -- http://mail.python.org/mailman/listinfo/python-list

Re: Yielding a chain of values

2005-08-31 Thread Kay Schluehr
Reinhold Birkenfeld wrote: > > x = [ yield r for r in iterable ] > > Which is quite different from > > x = (yield) in iterable > > which is currently (PEP 342) equivalent to > > _ = (yield) > x = _ in iterable > > So, no further tinkering with yield, I'm afraid. > > Reinhold Is the statement

Re: Code run from IDLE but not via double-clicking on its *.py

2005-08-31 Thread n00m
Funnily but I still can't get the code working... WITHOUT IDLE. I think it's because of "import thread" line. Seems something wrong with "opening" this module. In IDLE it works OK. -- http://mail.python.org/mailman/listinfo/python-list

Re: OpenSource documentation problems

2005-08-31 Thread Bryan Olson
Terry Hancock wrote: > Bryan Olson wrote: > >>I don't see any need to look beyond Python for a good example of >>poor documentation. Are there serious Python programmers who >>don't constantly struggle with errors and omissions in the doc? > > Uh, yes, actually. > > IMHO, the available Py

Re: .pth files in working directory

2005-08-31 Thread Peter Hansen
Peter Maas wrote: > My goal is to have the top level of a directory tree in the Python > path without touching anything outside the directory. I tried to > create .pth files with the top level path in every subdirectory > but this doesn't work despite working directory being part of the > Python pa

Re: use threading without classes

2005-08-31 Thread Peter Hansen
billiejoex wrote: > Hi all. Hi would like to use two threads in a program but all the examples I > found on the net use oop programming that I doesn't love too much. :-) > Can you code me a short example in wich two different functions are executed > at the same time, plz? import time from threa

module not found in IIS virtual dir

2005-08-31 Thread Peter Maas
I'm trying to call python scripts from IIS in the following tree: upgrade/ util/ __init__.py logonUser.py select/ selectFiles.py - select/ is referred from IIS as a virtual dir vselect. - upgrade/ is inserted into the Python path via .pth file in .../site-

Re: Code run from IDLE but not via double-clicking on its *.py

2005-08-31 Thread Richie Hindle
[n00m] > Funnily but I still can't get the code working... WITHOUT IDLE. > I think it's because of "import thread" line. Seems something > wrong with "opening" this module. In IDLE it works OK. It's difficult to diagnose your problem with so little information. Please post: o The command you're

Re: Bicycle Repair Man usability

2005-08-31 Thread Kay Schluehr
Sybren Stuvel wrote: > > -Get rid of extra variables by shifting them inline (e.g.: > > a=1;b=2;c=a+b --> c=1+2) > > This is already excess functionality IMO. I don't think that Rex talked about his programming style but about three and only three refactoring methods survived in BRM from ~30 Fow

Re: Code run from IDLE but not via double-clicking on its *.py

2005-08-31 Thread Steve Holden
n00m wrote: > Funnily but I still can't get the code working... WITHOUT IDLE. > I think it's because of "import thread" line. Seems something > wrong with "opening" this module. In IDLE it works OK. > Now, let's see ... [presses fingers to temples and exercises psychic powers] ... ah yes, its be

Sockets: code works locally but fails over LAN

2005-08-31 Thread n00m
import socket, thread host, port = '192.168.0.3', 1434 s1 = socket.socket(socket.AF_INET, socket.SOCK_STREAM) s2 = socket.socket(socket.AF_INET, socket.SOCK_STREAM) s2.connect((host, 1433)) s1.bind((host, port)) s1.listen(1) cn, addr = s1.accept() def VB_SCRIPT(): while 1: data = cn.re

Re: .pth files in working directory

2005-08-31 Thread Peter Maas
Peter Hansen schrieb: > Not sure from the above description exactly what it is you want, I want a tree top/ install.py sub1/ __init__.py mod1.py sub2/ mod2.py where I can do "from sub1 import mod1" in mod2.py no matter what the absolute path of top is. T

Re: .pth files in working directory

2005-08-31 Thread Michael Ekstrand
On Wed, 31 Aug 2005 15:07:41 +0200 Peter Maas <[EMAIL PROTECTED]> wrote: > I want a tree > > top/ > install.py > sub1/ > __init__.py > mod1.py > sub2/ > mod2.py > > where I can do "from sub1 import mod1" in mod2.py no matter what the > absolute path of to

Re: use threading without classes

2005-08-31 Thread billiejoex
Thank you for your helping. -- http://mail.python.org/mailman/listinfo/python-list

Re: Sockets: code works locally but fails over LAN

2005-08-31 Thread Peter Hansen
n00m wrote: > import socket, thread > host, port = '192.168.0.3', 1434 > s1 = socket.socket(socket.AF_INET, socket.SOCK_STREAM) > s2 = socket.socket(socket.AF_INET, socket.SOCK_STREAM) > s2.connect((host, 1433)) > s1.bind((host, port)) > s1.listen(1) > cn, addr = s1.accept() > > def VB_SCRIPT(): >

Re: .pth files in working directory

2005-08-31 Thread Peter Hansen
Peter Maas wrote: > Peter Hansen schrieb: >> generally such non-standard sys.path and .pth manipulations are best >> handled by a sitecustomize.py file, possibly which makes its own calls >> to site.addsitedir() and such. Try "help(site)" for more. > > But sitecustomize.py changes the Python in

Re: Bicycle Repair Man usability

2005-08-31 Thread Fredrik Lundh
Kay Schluehr wrote: > Instead of writing f(g(h(...))) it is sometimes adaequate to write > > x = h(...) > f(g(x)) > > I use this a lot in particular in C++. Optimzing compilers eliminate > runtime penalties. This is of course different in CPython. if "x" is a local variable, the penality isn't th

Re: module not found in IIS virtual dir

2005-08-31 Thread Peter Maas
Peter Maas schrieb: > I'm trying to call python scripts from IIS in the following tree: [...] > If I run selectFiles.py from the command line everything is ok. But > if I call it via IIS (http://localhost/vselect/selectFiles.py) there > is an error "No module named util" [...] Forget it. It was an

Re: Sockets: code works locally but fails over LAN

2005-08-31 Thread Grant Edwards
On 2005-08-31, Peter Hansen <[EMAIL PROTECTED]> wrote: > 2. I'm not at all sure that accessing the same socket object > simultaneously from two threads is safe. It's OK under Unix. Having one thread handle rx and a different one handle tx is a pretty widely used method. Don't know about Win32.

Re: Python doc problems example: gzip module

2005-08-31 Thread Sybren Stuvel
Xah Lee enlightened us with: > but after a minute of scanning, please someone tell me what the fuck > is it talking about? How difficult is it? The first line of the Gzip class explains it all to me: "Constructor for the GzipFile class, which simulates most of the methods of a file object" Sybren

Re: .pth files in working directory

2005-08-31 Thread Peter Maas
Michael Ekstrand schrieb: > If top/ is the working directory for your Python interpreter, the > problem is solved automatically. Python puts the current working > directory in the default search path. So, if you run IIS sets the the site path as working directory. So I would probably have to chang

Re: .pth files in working directory

2005-08-31 Thread Peter Maas
Peter Hansen schrieb: > Peter Maas wrote: >> But sitecustomize.py changes the Python installation, doesn't it? >> This wouldn't be an advantage over putting a .pth file into >> .../site-packages. > > > You can have a local sitecustomize.py in the current directory, which > wouldn't change the Py

Re: new line

2005-08-31 Thread Kuljo
Kuljo wrote: > Kuljo wrote: > >> Dear friends >> I'm so sorry to bore you with this trivial problem. Allthou: I have >> string having 0x0a as new line, but I should have \n instead. >> How should I solve it? >> I've tried >text_new=tex_old.replace(str(0x0a), '\n') >> and other things, but non

Re: Problem with string -> int conversion ?

2005-08-31 Thread Madhusudan Singh
Fredrik Lundh wrote: >> The code is : >> >> void Form3::getNPrange() >> { > > what language is this? Its python embedded in the designer workflow. pyuic extracts stuff from it, and generates a python script from the ui.h file. > > if the callback code is Python, you should be able to add a pr

socket.sslerror:(1, 'error:140770FC:SSL routines:SSL23_GET_SERVER_HELLO:unknown protocol')

2005-08-31 Thread Robert
socket.sslerror:(1, 'error:140770FC:SSL routines:SSL23_GET_SERVER_HELLO:unknown protocol') Got this from another computer/setup, which I cannot debug. What can be the cause for this problem? Python 2.3.5 trace: [ ...(\'ClientCookie_urllib2_support.pyo\', 572, \'open\', None), (\'ClientCooki

Re: What are new-style classes?

2005-08-31 Thread Terry Hancock
On Tuesday 30 August 2005 04:09 pm, Reinhold Birkenfeld wrote: > The customary way is to use "class new_class(object):". There's no advantage > in using > __metaclass__ except that you can set it globally for all classes in that > module > (which can be confusing on its own). > > My comment most

Epydoc - Documenting class members?

2005-08-31 Thread Miki Tebeka
Hello, Is there a way to document class members in Epydoc? Something like: class Point: def __init__(self, x, y): '''Create new point @param x: X coord @param y: Y coord ''' self.x = x # How do I document here?

'ps -A' command freezes Popen3

2005-08-31 Thread gao_bolin
Does anybody know why the following lines would freeze python [2.4.1 on Linux]: import popen2 a = popen2.Popen3('ps -A') a.wait() Thanks B. -- http://mail.python.org/mailman/listinfo/python-list

Infinity syntax. Re: Bug in string.find; was...

2005-08-31 Thread Kay Schluehr
Bengt Richter wrote: > How about interpreting seq[i] as an abbreviation of seq[i%len(seq)] ? > That would give a consitent interpretation of seq[-1] and no errors > for any value ;-) Cool, indexing becomes cyclic by default ;) But maybe it's better to define it explicitely: seq[!i] = seq[i%

Infinity syntax. Re: Bug in string.find; was...

2005-08-31 Thread Kay Schluehr
Bengt Richter wrote: > How about interpreting seq[i] as an abbreviation of seq[i%len(seq)] ? > That would give a consitent interpretation of seq[-1] and no errors > for any value ;-) Cool, indexing becomes cyclic by default ;) But maybe it's better to define it explicitely: seq[!i] = seq[i%

Python doc problems example: gzip module

2005-08-31 Thread Chermside, Michael
Title: Python doc problems example: gzip module Xah Lee writes:     [...] > Fuck the Python programing[sic] morons.     [...] Peter Maas replies: > Here's the example:     [...] > Have a nice ... eh fucking day :) Thank you Peter... you're a hero. THIS is why c.l.py is such a helpfu

Re: Problem with string -> int conversion ?

2005-08-31 Thread Fredrik Lundh
Madhusudan Singh wrote: >> if the callback code is Python, you should be able to add a print >> statement to the line just before the failing "int" call: >> >> print repr(signalrangestr), type(signalrangestr) >> signalrange = int(signalrangestr) >> >> that print statement should be all you

Re: dynamicly updating an objects fields

2005-08-31 Thread Robert Kern
Uwe Lauth wrote: > kyle.tk wrote: > >>I want to make a function that will work like this: >> >>def updateField(object, fieldName, newValue): >> object.fieldName = newValue > > This function already exists in python. > It is called settattr. Or rather setattr. -- Robert Kern [EMAIL PROTECT

plone site in separate database - MountFolder

2005-08-31 Thread krzychu
Hallo, I have an existing plone site called "info", I've added some scripts to it. I would like to have that plone site into a separate ZODB database(separate .fs file). There is a MountFolder product (1.2 - the latest release), by mean of this you can create MountFolder which data is stored in sep

Re: Bicycle Repair Man usability

2005-08-31 Thread Peter Maas
Sybren Stuvel schrieb: > I use BRM if I need to rename a function or variable, and that's about > it. I do the rest by hand faster than I can figure out how to use > additional software. Sounds like "I can walk from Aachen to Cologne faster than figure out how to drive a car" ;) I don't know BRM n

Re: Bug in string.find; was: Re: Proposed PEP: New style indexing,was Re: Bug in slice type

2005-08-31 Thread Ron Adam
Antoon Pardon wrote: > Op 2005-08-31, Bengt Richter schreef <[EMAIL PROTECTED]>: > >>On 31 Aug 2005 07:26:48 GMT, Antoon Pardon <[EMAIL PROTECTED]> wrote: >> >> >>>Op 2005-08-30, Bengt Richter schreef <[EMAIL PROTECTED]>: >>> On 30 Aug 2005 10:07:06 GMT, Antoon Pardon <[EMAIL PROTECTED]> wrot

Re: Uploading images via cgi?

2005-08-31 Thread Paul Boddie
Chris Dewin wrote: > chunk = fileitem.file.read(10), and fout.write (chunk) seem to be the > key statements. Could someone elaborate on these for me please? And why > do they need to be in a while loop? I imagine that the intention of reading only 10 bytes at a time is to limit the amount

using python_ldap for authentication

2005-08-31 Thread tooper
Hello all, I'd like to use an ldap server just for authentication, but I'm a complete beginner with all the ldap stuff... I've tried this from the python_ldap Demo examples : -- import ldap, getpass ldap_url="... validation ldap server URL & port ..." l = ldap.initialize(ldap_url) logi

Re: change date format

2005-08-31 Thread dimitri pater
On 8/31/05, Fredrik Lundh <[EMAIL PROTECTED]> wrote: Lars Gustäbel wrote:> Not a single occurrence of the f**k word. You're making progress.perhaps, but why is he posting apache questions to the python list? because we know all, we see all,  we are "Python programing (sic) morons" dimitri -- http:

Re: 'ps -A' command freezes Popen3

2005-08-31 Thread Thomas Guettler
Am Wed, 31 Aug 2005 07:12:49 -0700 schrieb gao_bolin: > Does anybody know why the following lines would freeze python [2.4.1 on > Linux]: > > import popen2 > a = popen2.Popen3('ps -A') > a.wait() Because "ps -A" produces a lot of output to stdout, so that it blocks. It blocks until you read from

HTML tags optimization [ interesting problem]

2005-08-31 Thread DENG
hi all, i use SGMLParser to process HTML files, in order to do some optimizations, something like this: TEXT1TEXT2 optimise to TEXT1TEXT2 at the very beginning, i was thinking of analysing each text-block, to know their color, size, if is bold or italic, but i found it was too complicated.

Re: Sockets: code works locally but fails over LAN

2005-08-31 Thread Jp Calderone
On 31 Aug 2005 06:03:00 -0700, n00m <[EMAIL PROTECTED]> wrote: >import socket, thread >host, port = '192.168.0.3', 1434 >s1 = socket.socket(socket.AF_INET, socket.SOCK_STREAM) >s2 = socket.socket(socket.AF_INET, socket.SOCK_STREAM) >s2.connect((host, 1433)) >s1.bind((host, port)) >s1.listen(1) >cn,

Improving my text processing script

2005-08-31 Thread pruebauno
I am sure there is a better way of writing this, but how? import re f=file('tlst') tlst=f.read().split('\n') f.close() f=file('plst') sep=re.compile('Identifier "(.*?)"') plst=[] for elem in f.read().split('Identifier'): content='Identifier'+elem match=sep.search(content) i

Re: Infinity syntax. Re: Bug in string.find; was...

2005-08-31 Thread Bengt Richter
On 31 Aug 2005 07:13:26 -0700, "Kay Schluehr" <[EMAIL PROTECTED]> wrote: >Bengt Richter wrote: > >> How about interpreting seq[i] as an abbreviation of seq[i%len(seq)] ? >> That would give a consitent interpretation of seq[-1] and no errors >> for any value ;-) > >Cool, indexing becomes cyclic by

command line arguments

2005-08-31 Thread Jon Hewer
hi i am writing a little script and currently implementing command line arguments following the guide by mark pilgrim from dive into python; http://diveintopython.org/scripts_and_streams/command_line_arguments.html thats all fine, however i am not sure of the BEST way to handle multiple command

Re: SpamBayes wins PCW Editors Choice Award for anti-spam software.

2005-08-31 Thread Paul Boddie
Alan Kennedy wrote: [PCW award to SpamBayes] > (PCW, for those who don't know it, is sort of the UK's equivalent of Byte > Magazine, > except that it's still publishing after almost 25 years). Hmmm. Even Byte at its lowest point was far better than PCW ever was. [...] > The only problem was t

graphical or flow charting design aid for python class development?

2005-08-31 Thread William Gill
Being somewhat new to Python, and having a tendency to over complicate things in my class design, I was wondering if anyone can suggest a simple graphical or flowcharting tool that they use to organize their class and program design? Because of a 55 mph head-on accident a few years back, I ha

ANN: Dabo 0.4.1

2005-08-31 Thread Paul McNett
We are happy to announce the release of Dabo 0.4.1, available for download from: http://dabodev.com/download Dabo is a framework for developing 3-tier database applications, and comes with database wrappers for MySQL, PostgreSQL, Firebird, and SQLite. It wraps the wxPython GUI toolkit, making it

Re: command line arguments

2005-08-31 Thread Peter Hansen
Jon Hewer wrote: > i am writing a little script and currently implementing command line > arguments following the guide by mark pilgrim from dive into python; > > http://diveintopython.org/scripts_and_streams/command_line_arguments.html > > thats all fine, however i am not sure of the BEST way to

To the python-list moderator

2005-08-31 Thread Terry Reedy
For a couple of years, I have been reading and posting and posting to python-list and c.l.p via gmane.news.orgs gmane.comp.python.general group. Today I got this from 'python-list-bounces', which I presume is a 'machine' rather than a 'human' address. --- Your mail to 'P

Re: OpenSource documentation problems

2005-08-31 Thread A.M. Kuchling
On Wed, 31 Aug 2005 12:14:35 GMT, > I use dir() all the time; help() not so much. Typing help(help) > shows: > > Help on _Helper in module site: > > Type help() for interactive help, or help(object) for help > about object. > > That strikes me as not-particularly-helpful. Surely it

can't start new thread

2005-08-31 Thread jdonnell
I posted this about a month ago and peter asked for a stack trace. I didn't get the error again until yesterday and here is the stack trace and what I posted before. Traceback (most recent call last): File "./ab.py", line 240, in ? main() File "./ab.py", line 217, in main abThread.star

Re: What are new-style classes?

2005-08-31 Thread Reinhold Birkenfeld
Terry Hancock wrote: > On Tuesday 30 August 2005 04:09 pm, Reinhold Birkenfeld wrote: >> The customary way is to use "class new_class(object):". There's no advantage >> in using >> __metaclass__ except that you can set it globally for all classes in that >> module >> (which can be confusing on it

Re: can't start new thread

2005-08-31 Thread Paul Rubin
"jdonnell" <[EMAIL PROTECTED]> writes: > This script has worked without a problem for months, but I did make > some changes recently. I don't see how those changes would cause > this error though. It's also on a VPS so it's possible that they > changed something in the OS. Does anyone have any sugg

Re: Yielding a chain of values

2005-08-31 Thread Reinhold Birkenfeld
Kay Schluehr wrote: > Reinhold Birkenfeld wrote: > >> >x = [ yield r for r in iterable ] >> >> Which is quite different from >> >> x = (yield) in iterable >> >> which is currently (PEP 342) equivalent to >> >> _ = (yield) >> x = _ in iterable >> >> So, no further tinkering with yield, I'm afra

Re: can't start new thread

2005-08-31 Thread jdonnell
>Maybe some other VPS(s) under the host OS have spun enough processes >or threads to make the host OS exhaust some limit. I'm not familiar with any hard limits in linux. Is there a config file with these settings? -- http://mail.python.org/mailman/listinfo/python-list

ANN: Python GUI Editor...

2005-08-31 Thread [EMAIL PROTECTED]
I named this tool - FarPy GUIE, and is available at: http://farpy.holev.com/ This is a quote from the site: "GUIE (GUI Editor) provides a simple WYSIWYG GUI editor for wxPython. The program was made in C# and saves the GUI that was created to a XML format I called GUIML. This GUIML is a pretty st

Re: To the python-list moderator

2005-08-31 Thread Gregory Piñero
I got this same message.  I'm using gmail. GregOn 8/31/05, Terry Reedy <[EMAIL PROTECTED]> wrote: For a couple of years, I have been reading and posting and posting topython-list and c.l.p via gmane.news.orgs gmane.comp.python.general group.Today I got this from 'python-list-bounces', which I pres

Re: can't start new thread

2005-08-31 Thread Terry Reedy
"jdonnell" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > I'm using Python 2.2.3 on a custom vps version of FC1. I am pretty sure there have been thread-related bug fixes since then. Trying the latest release (even if you can't use it for production) might give you some idea of

Re: What are new-style classes?

2005-08-31 Thread Steve Holden
Reinhold Birkenfeld wrote: > Terry Hancock wrote: > >>On Tuesday 30 August 2005 04:09 pm, Reinhold Birkenfeld wrote: >> >>>The customary way is to use "class new_class(object):". There's no advantage >>>in using >>>__metaclass__ except that you can set it globally for all classes in that >>>modu

Retrieving Filename from Path

2005-08-31 Thread Rob Cowie
Hi, Given a string representing the path to a file, what is the best way to get at the filename? Does the OS module provide a function to parse the path? or is it acceptable to split the string using '/' as delimiters and get the last 'word'. The reason I'm not entirely happy with that method is t

Re: What are new-style classes?

2005-08-31 Thread Reinhold Birkenfeld
Steve Holden wrote: > Reinhold Birkenfeld wrote: >> Terry Hancock wrote: >> >>>On Tuesday 30 August 2005 04:09 pm, Reinhold Birkenfeld wrote: >>> The customary way is to use "class new_class(object):". There's no advantage in using __metaclass__ except that you can set it globally for

Re: Retrieving Filename from Path

2005-08-31 Thread robert . dowell
>>> import os.path >>> help(os.path) Help on module ntpath: NAME ntpath - Common pathname manipulations, WindowsNT/95 version. FILE c:\data\utils\python24\lib\ntpath.py DESCRIPTION Instead of importing this module directly, import os and refer to this module as os.path. FUNCTION

Re: Code run from IDLE but not via double-clicking on its *.py

2005-08-31 Thread n00m
Richie; Steve; Thanks for your replies! > o The command you're typing into the command prompt > o The error message you're getting > o The full traceback > o The code you're trying to run, or if it's too big then the piece that >the last line of the traceback refers to 1. D:\>python23\pyt

Re: global interpreter lock

2005-08-31 Thread [EMAIL PROTECTED]
phil hunt wrote: > Some times concurrency is the best (or only) way to do a job. Other > times, it's more trouble than its worth. A good programmer will know > which is which, and will not use an overly complex solution for the > project he is writing. Also, a good programmer won't conflate concur

  1   2   >