Re: Time for : comp.lang.python.newbies ??

2004-12-06 Thread Tim Roberts
gmduncan <[EMAIL PROTECTED]> wrote: > >Am I correct in detecting a greater presence of Newbies in >this "Pierian Spring" aka c.l.p. ?? > >Seems there's more than the usual bunch of pleas for help >esp. from the Newbie Windoze fraternity. > >And it seems the Uber-Gurus (You Know Who You ARE) have

Re: Python in debug version?

2004-12-06 Thread "Martin v. Löwis"
mep wrote: I view my python 2.3.4 from python.org by VC6's dependency walker tool. What suprise me is that python.exe and python32.dll are built into *DEBUG* version. What precisely did the tool report? To my knowledge, the DLLs are not in the debug version. Regards, Martin -- http://mail.pytho

Re: Win32 Libs for 2.4

2004-12-06 Thread "Martin v. Löwis"
Robin Becker wrote: I thought that static .libs didn't make reference to the dll's they need; isn't that done at load time? Unfortunately, thanks to Microsoft's infinite wisdom, static libs *do* reference DLLs. The C lib headers contain things like #pragma lib("msvcrt.lib") // or some such The com

Re: RPC with Python - Comparison?

2004-12-06 Thread Jeremy Bowers
On Mon, 06 Dec 2004 21:38:16 -0800, johng2001 wrote: > Anyone has any insights on REST Vs SOAP/XML-RPC? I have seen these debates > else where on the web. Just want to know what the view point here is. I've seen people argue this point a bajillion times, and honestly, I think the best insight is t

Forums based on python

2004-12-06 Thread Florian Lindner
Hello, which free forums, based on mod_python and MySQL are around there? Something like phpBB... Thanks, Florian -- http://mail.python.org/mailman/listinfo/python-list

Python in debug version?

2004-12-06 Thread mep
Hi, all I view my python 2.3.4 from python.org by VC6's dependency walker tool. What suprise me is that python.exe and python32.dll are built into *DEBUG* version. Is it intend to do so?Is a release version faster? -- Best Regards, Wang Kebo http://www.huihoo.org/~mep -- http://mail.pytho

python programming help

2004-12-06 Thread Alfred Canoy
Hello, Thanks for the input:-) I made a mean, median & mode program. I'm trying to figure how can I store this program in another file and opens the file to display. Any idea what to add in my source code. Thanks!     # compute the Mean, Median & Mode of a list of numbers:   sum = 0.0   prin

Chicago Python Users Group Meeting, Thurs Dec 9

2004-12-06 Thread Ian Bicking
The Chicago Python User Group, ChiPy, will have its next meeting on Thursday, December 9th, starting at 7pm. For more information on ChiPy see http://chipy.org Topic - This month's topic is testing and profiling strategies in Python. Chris McAvoy will talk about doctest. Brian Ray will ta

Re: embedded python and interpreter threads

2004-12-06 Thread Charlie DeTar
Quick correction, sorry - the command should read like this (I had omitted the "log" before 'CaptureStdout' and 'CaptureStderr'). Same problems exist. PyRun_SimpleString( "import log\n" "import sys\n" "class StdoutCatcher:\n" "\tdef write(self, str):\n"

embedded python and interpreter threads

2004-12-06 Thread Charlie DeTar
So, I have an amazing, functioning foobar class that embeds python. Only trouble is, I want to be able to have multiple foobar objects at once, each with their own interpreters, stdouts, and stderrs. My initialization of the python interpreter in the class "x" is as follows: [snip] if (!

ANN: Wing IDE 2.0.1 released

2004-12-06 Thread Stephan Deibel
Hi, I'm happy to announce version 2.0.1 Wing IDE, an advanced integrated development environment for Python. This is a free upgrade for Wing IDE 2.0 users. It can be downloaded from: http://wingware.com/downloads Highlights of this release include: * Support for Python 2.4 * Optimized debugge

Re: RPC with Python - Comparison?

2004-12-06 Thread johng2001
> Candidates could be: > > - Pyro > - Twisted.spread > - OSE (XML-RPC) > - ICE > - ...others? Anyone has any insights on REST Vs SOAP/XML-RPC? I have seen these debates else where on the web. Just want to know what the view point here is. -- http://mail.python.org/mailman/listinfo/python-list

Re: Deadlock detection

2004-12-06 Thread Paul Du Bois
(warning: pedantic and off-topic response) NP-Complete does not mean "equivalent to the halting problem." It means "poly-time equivalent to any other NP-Complete problem". NP-Complete problems are "only" exponential-time. The halting problem is much harder! And of course, just the fact that a prob

ANN: GallerPy 0.5.0

2004-12-06 Thread Freddie
GallerPy is a fairly basic dynamic web gallery written in Python and uses the Python Imaging Library. It is licensed under the terms of the BSD License. Features include: * Fluid CSS layout * SCGI support * Other exciting stuff GallerPy is available for download from the MadCowDisease web sit

Weekly Python Patch/Bug Summary

2004-12-06 Thread Kurt B. Kaiser
Patch / Bug Summary ___ Patches : 259 open ( +1) / 2705 closed ( +4) / 2964 total ( +5) Bugs: 800 open (-12) / 4662 closed (+20) / 5462 total ( +8) RFE : 160 open ( +0) / 137 closed ( +1) / 297 total ( +1) New / Reopened Patches __ add key

Re: GUI Frames and classmethod

2004-12-06 Thread Jeremy Bowers
On Mon, 06 Dec 2004 14:11:04 -0800, Scott David Daniels wrote: > Second, I was referring to code like: > > try: > inner = table[state] > except KeyError: > table[state] = inner = {} > inner[action] = whatever > > vs. code like this: > > table[state, ac

Re: why python is slower than java?

2004-12-06 Thread Jeremy Bowers
On Mon, 06 Dec 2004 13:01:47 -0800, fuzzylollipop wrote: > yeah, but a lie unanswered by the truth becomes the truth. You know, it's bad enough that somebody starts this thread anew about every two months anyhow, do you really have to try to resurrect dead ones? Be patient and I'm sure you'll ha

httpconnection class handle 302 redirect?

2004-12-06 Thread Joe Wong
Hi , it looks like that HTTPConnection class is not capable to handle 302 redirect response. Is there any sample implementation that tackle this problem? I am using python 2.3.3 on Windows platform.   best regards,   - Joe     ---Outgoing mail is certified Virus Free.Checked by AVG anti-virus

Python Boost, help

2004-12-06 Thread To Forum
Hi, My problem is the following 1/ I install Python 2.4 at D:\Programs\Python24 using the binary file from www.python.org 2/ following the document from the boost.org I type the command >bjam "-sTOOLS=vc-7_1 --with-python-root=D:\Programs\Python24" stage But I receive the following error > --

Re: regex syntax

2004-12-06 Thread and-google
Andreas Volz <[EMAIL PROTECTED]> schrieb: > Ich hab mir schon überlegt einfach die letzten viel Stellen des > strings "per Hand" auf die Zeichenfolge zu vergleichen und so > regex zu umgehen. Aber ich muss es irgendwann ja doch mal nutzen "Muss"? stimme nicht zu! Regexps sind ja fuer begrenzte Zw

Re: better regular expression?

2004-12-06 Thread Steve Holden
Vivek wrote: [third request ...] Any suggestions? Thanx. Well, you could try asking just once and then waiting a bit :-) regards Steve -- http://www.holdenweb.com http://pydish.holdenweb.com Holden Web LLC +1 800 494 3119 -- http://mail.python.org/mailman/listinfo/python-list

RE: better regular expression?

2004-12-06 Thread Robert Brewer
Vivek wrote: > I am trying to construct a regular expression using the re module that > matches for > 1. my hostname > 2. absolute from the root URLs including just "/" > 3. relative URLs. > > Basically I want the attern to not match for URLs that are not on my > host. Far easier would be grabbin

better regular expression?

2004-12-06 Thread Vivek
Hi, I am trying to construct a regular expression using the re module that matches for 1. my hostname 2. absolute from the root URLs including just "/" 3. relative URLs. Basically I want the attern to not match for URLs that are not on my host. The following statement satisfies numbers 1 and 2,

Re: better regular expression?

2004-12-06 Thread Roy Smith
"Vivek" <[EMAIL PROTECTED]> wrote: > Hi, > > I am trying to construct a regular expression using the re module that > matches for > 1. my hostname > 2. absolute from the root URLs including just "/" > 3. relative URLs. Is your goal to learn more about regexes, or to parse URLs? If the latter,

better regular expression?

2004-12-06 Thread Vivek
Hi, I am trying to construct a regular expression using the re module that matches for 1. my hostname 2. absolute from the root URLs including just "/" 3. relative URLs. Basically I want the attern to not match for URLs that are not on my host. The following statement satisfies numbers 1 and 2,

Re: better regular expression?

2004-12-06 Thread Andy Gross
Check out the 'urlparse' module, in the standard library, unless for some reason you *have* to use regular expressions. /arg On Dec 6, 2004, at 7:46 PM, Vivek wrote: Hi, I am trying to construct a regular expression using the re module that matches for 1. my hostname 2. absolute from the root UR

better regular expression?

2004-12-06 Thread Vivek
Hi, I am trying to construct a regular expression using the re module that matches for 1. my hostname 2. absolute from the root URLs including just "/" 3. relative URLs. Basically I want the attern to not match for URLs that are not on my host. The following statement satisfies numbers 1 and 2,

Re: cut strings and parse for images

2004-12-06 Thread Paul McGuire
"Andreas Volz" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > Am Mon, 06 Dec 2004 20:36:36 GMT schrieb Paul McGuire: > > > Check out the urlparse module (in std distribution). For images, you > > can provide a default addressing scheme, so you can expand > > "images/marine.jpg" rela

Re: [Python-Help] Programming help

2004-12-06 Thread Bob Gailer
At 07:07 PM 12/5/2004, Alfred Canoy wrote: Please help me out:(.. I've been trying to figure this out for 2 days now.. I don't know what to use to print all the list of numbers. I hve know idea how should I do this. I tried a lot of trial & error for the the def, dict, .list( ). have no luck. I

regex syntax

2004-12-06 Thread Andreas Volz
Hi, ich kann nicht gut regex, aber für das nötigste reicht es eigentlich. Irgendwie komm ich aber mit der Syntax der re.* Befehle in Python nicht klar Vielleicht kann mir das an diesem Beispiel jemand zeigen: string = "bild.jpg" ich möchte jetzt einfach wissen ob in dem string ein ".jpg" vorkomm

Re: why no python setup.py uninstall?

2004-12-06 Thread alia_khouri
Peter Hansen wrote: > On your specific reason for asking: I would suggest > just not worrying about "being extra clean about it". > Python's generally pretty good about not messing up > when you install a new version of something without > uninstalling the previous version. Granted. However, the

Re: RPC with Python - Comparison?

2004-12-06 Thread has
Wolfgang Keller wrote: > > MacPython also supports Apple events > > I know, but I was thinking of OS-independent RPC protocols. :-) Pity, you're missing some good stuff... :/ -- http://mail.python.org/mailman/listinfo/python-list

Re: pre-PEP generic objects

2004-12-06 Thread Carlos Ribeiro
On 06 Dec 2004 10:09:25 +0100, Jacek Generowicz <[EMAIL PROTECTED]> wrote: [great explanation about function descriptors] Thanks. Now I know more about function descriptors than I ever wanted to :-) With a little polish, this post would make a great addition to the descriptors documentation, don't

SOAP failure

2004-12-06 Thread savio
Hi I am trying to run the following code snip - it works on my machine at home - does not work in the office - is it a firewall thing? Can anyone help? from SOAPpy import WSDL wsdlFile = 'http://www.xmethods.net/sd/2001/TemperatureService.wsdl' server = WSDL.Proxy(wsdlFile) server.soapproxy.co

Re: why no python setup.py uninstall?

2004-12-06 Thread alia_khouri
Peter Hansen wrote: > On your specific reason for asking: I would suggest > just not worrying about "being extra clean about it". > Python's generally pretty good about not messing up > when you install a new version of something without > uninstalling the previous version. Granted. However, the

Re: Win32 Libs for 2.4

2004-12-06 Thread Daniel Dittmar
Robin Becker wrote: I guess that it won't work if something malloc'ed from the MSC 6 runtime is free'd by the MSC 7.1 runtime. I thought that static .libs didn't make reference to the dll's they need; isn't that done at load time? You're right, DLL-phobia made my thinking less than precise. The o

Re: cut strings and parse for images

2004-12-06 Thread Andreas Volz
Am Mon, 06 Dec 2004 20:36:36 GMT schrieb Paul McGuire: > Check out the urlparse module (in std distribution). For images, you > can provide a default addressing scheme, so you can expand > "images/marine.jpg" relative to the current location. Ok, this looks good. But I'm a really newbie to pytho

Re: Help with super()

2004-12-06 Thread Steven Bethard
Christopher J. Bottaro wrote: Why don't this code work? import PRI class Poscdnld_PYIO(PRI.BasicBatch): def __init__(self, *argv): super(Poscdnld_PYIO, self).__init__(*argv) x = Poscdnld_PYIO() I get this exception: File "poscdnld_pyio.py", line 52, in __init__ super(Poscdnld_PYIO

Re: Mean, median, and mode

2004-12-06 Thread Steven Bethard
Paul Rubin wrote: median = x.sorted()[len(x)//2] In Python 2.4: >>> [10, 8, 6, 4, 2, 1].sorted() Traceback (most recent call last): File "", line 1, in ? AttributeError: 'list' object has no attribute 'sorted' Perhaps you meant "sorted(x)"? Steve -- http://mail.python.org/mailman/listinfo/python-

Re: Help with super()

2004-12-06 Thread Peter Otten
Christopher J. Bottaro wrote: > Why don't this code work? > > import PRI > > class Poscdnld_PYIO(PRI.BasicBatch): > >def __init__(self, *argv): > super(Poscdnld_PYIO, self).__init__(*argv) > > x = Poscdnld_PYIO() > > I get this exception: > File "poscdnld_pyio.py", line 52, in __

[Plone] Form Controller

2004-12-06 Thread Ro
Help! Using the CMFController actions, how do I POST the results of the validated form to another site? I am trying to integrate my plone site with salesforce.com so that leads automatically get created when users fill out the contact me form. This works - but no validation obviously: http://www.

RE: byte code generated under linux ==> bad magic number under windows

2004-12-06 Thread Delaney, Timothy C (Timothy)
Philippe C. Martin wrote: > I understand from my reading that a .pyc generated by python anywhere > should run anywhere else - is that true ? > > If I generate 'compile.all' a pyc with python 2.3.3 under Linux, I ^ > get a 'bad magic number' try

Re: GUI Frames and classmethod

2004-12-06 Thread Scott David Daniels
Zak Arntson wrote: On Mon, 06 Dec 2004 13:08:15 -0800, Scott David Daniels <[EMAIL PROTECTED]> wrote: Zak Arntson wrote: On Fri, 03 Dec 2004 14:48:30 -0800, Scott David Daniels wrote: ...The real advantage is clarity: the inner dictionaries in a dict-of-dict implementation have no real "meaning."

Re: Mean, median, and mode

2004-12-06 Thread Fredrik Lundh
Paul Rubin wrote: > > > median = lambda x: x.sort() or x[len(x)//2] > > Yucch!! > > median = x.sorted()[len(x)//2] that doesn't do the same thing, and doesn't work on pre-2.4 releases. try again. (learning how "or" and "and" works in Python doesn't hurt, either; "value or value" is a very commo

Help with super()

2004-12-06 Thread Christopher J. Bottaro
Why don't this code work? import PRI class Poscdnld_PYIO(PRI.BasicBatch): def __init__(self, *argv): super(Poscdnld_PYIO, self).__init__(*argv) x = Poscdnld_PYIO() I get this exception: File "poscdnld_pyio.py", line 52, in __init__ super(Poscdnld_PYIO, self).__init__(*argv) Typ

Re: Mean, median, and mode

2004-12-06 Thread Paul Rubin
Josiah Carlson <[EMAIL PROTECTED]> writes: > > > median = lambda x: x.sort() or x[len(x)//2] > > > > That...is a really sneaky use of null return values. I like. :) > > Thank you, I'm just using a paradigm (exploiting lambdas) that I picked > up while going through various functional programming

Re: GUI Frames and classmethod

2004-12-06 Thread Zak Arntson
On Mon, 06 Dec 2004 13:08:15 -0800, Scott David Daniels <[EMAIL PROTECTED]> wrote: > Zak Arntson wrote: > > On Fri, 03 Dec 2004 14:48:30 -0800, Scott David Daniels > Most likely so. Possibly an equal amount of has work -- hash of a pair > is a function of hashes of the lelements, but fewer trips i

Re: Mean, median, and mode

2004-12-06 Thread Scott David Daniels
How about: def median(lst): lst = sorted(lst) inner = lst[(len(lst) - 1) // 2 : (len(lst) + 2) // 2] if len(inner) > 1: return sum(inner) / 2. else: return inner[0] --Scott David Daniels [EMAIL PROTECTED] -- http://mail.python.org/mail

Re: How is Python designed?

2004-12-06 Thread Limin Fu
Hi, > So I guess you don't use classic parser techniques > then? You are right. The Yuan interpreter scans the tokens resulted from lexical analysis and matches them to the syntax patterns. There are 3 basic patterns defined in Yuan: arithmetic "a*b+c", chain (as I called it) "objs[i]->func()" an

RE: Mean, median, and mode - third time's the charm!!!

2004-12-06 Thread Frohnhofer, James
> > median = lambda x: x.sort() or ((len(x) % 2) and (x[(len(x)>>1)])) or > (sum(x[((len(x)>>1)-1):(len(x)>>1)+1])/2.0) > > >>> median( [2,3,4,5,6,7]) > 4.5 > >>> median( [2,3,4,5,6]) > 4 How about >>> median = lambda x: x.sort() or (x[(len(x)-1)/2] + x[len(x)/2])/2.0 >>> median([2,3,4,5,6,7])

Re: GUI Frames and classmethod

2004-12-06 Thread Scott David Daniels
Zak Arntson wrote: On Fri, 03 Dec 2004 14:48:30 -0800, Scott David Daniels <> wrote: question: A dictionary of dictionaries is slower than a dictionary of tuples, right? Because when Python accesses a dictionary, it produces a hash from the key and finds that in its hash table. Producing a has

Re: Seeking Python + Subversion hosting.

2004-12-06 Thread remi
> Anyone know of a good hosting company that offers both server-side > Python and a subversion repository? > > I know of one: www.textdrive.com - they're a bit pricey, but I s'pose > you gets what you pays for - they look good. > > Just FYI - right now I'm with sapphiresoft.co.uk. They're cheap and

Re: why python is slower than java?

2004-12-06 Thread fuzzylollipop
yeah, but a lie unanswered by the truth becomes the truth. you state opinon as fact and someone comes along reads your statement that Python is so much slower and believes it is true because there is no disententing voice to say, wait just a sec, this guy is clueless and has no idea what he is tal

Re: cut strings and parse for images

2004-12-06 Thread Steve Holden
Andreas Volz wrote: Hi, I used SGMLParser to parse all href's in a html file. Now I need to cut some strings. For example: http://www.example.com/dir/example.html Now I like to cut the string, so that only domain and directory is left over. Expected result: http://www.example.com/dir/ I know how

PyAr - Python Argentina 4th Meeting, Thursday, December 9th

2004-12-06 Thread Batista, Facundo
Title: PyAr - Python Argentina 4th Meeting, Thursday, December 9th The Argentinian Python User Group, PyAr, will have its next meeting this Thursday, December 9th at 8.30pm. Please see http://pyar.decode.com.ar/Members/pziliani/event.diciembre for details (in Spanish.) Agenda -- Desp

Re: byte code generated under linux ==> bad magic number under windows

2004-12-06 Thread Jarek Zgoda
Fredrik Lundh wrote: AFAIK, they *are* platform dependent. You can not share pyc files between ASCII and EBCDIC machine. however, that could be seen as be a flaw in the EBCDIC ports. We'll see if this could be fixed. I try to foster some "movement" in Python/400 (I love this name, please, dont ca

Re: Python installation breaks Outlook Express

2004-12-06 Thread Mike
I have the same problem. It isn't a problem with Outlook. It is with Python. I loose my wired AND wireless connections. Removing Python bringst them back to operational. Mike M. Laymon wrote: > I just installed Python 2.3.3 under Windows XP professional. After I > did, my wife tried to acces

Re: Mean, median, and mode

2004-12-06 Thread Josiah Carlson
[EMAIL PROTECTED] (Michael Fuhr) wrote: > > Josiah Carlson <[EMAIL PROTECTED]> writes: > > > > "Robert Brewer" <[EMAIL PROTECTED]> wrote: > > > > > > Josiah Carlson wrote: > > > > > > > > median = lambda x: x.sort() or x[len(x)//2] > > > > > > That...is a really sneaky use of null return val

Re: cut strings and parse for images

2004-12-06 Thread Paul McGuire
"Andreas Volz" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > Hi, > > I used SGMLParser to parse all href's in a html file. Now I need to cut > some strings. For example: > > http://www.example.com/dir/example.html > > Now I like to cut the string, so that only domain and directory i

Re: file descriptors & fdopen

2004-12-06 Thread Scott Frankel
foo = open('foo.txt', 'w') duh. Thanks - Scott On Dec 6, 2004, at 11:27 AM, Scott Frankel wrote: Why does os.fdopen('foo.txt', 'w') require an integer? Ultimately, I want to create a new file on disk. Funny, I can't seem to suss-out how to create a new file without resorting to os.system('touch fo

Re: Mean, median, and mode - third time's the charm!!!

2004-12-06 Thread Paul McGuire
"Paul McGuire" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > > "Paul McGuire" <[EMAIL PROTECTED]> wrote in message > news:[EMAIL PROTECTED] > > This median expression is incorrect. median is *not* the midpoint between > > max and min values. It is the middle value when all values

Re: byte code generated under linux ==> bad magic number under windows

2004-12-06 Thread Fredrik Lundh
Jarek Zgoda wrote: > AFAIK, they *are* platform dependent. You can not share pyc files between > ASCII and EBCDIC > machine. however, that could be seen as be a flaw in the EBCDIC ports. -- http://mail.python.org/mailman/listinfo/python-list

Re: python-mode question

2004-12-06 Thread Skip Montanaro
Thomas> I assume you meant the python-mode project? Whoops. Yeah. Thanks. Skip -- http://mail.python.org/mailman/listinfo/python-list

Re: file descriptors & fdopen

2004-12-06 Thread Jeremy Jones
Scott Frankel wrote: Why does os.fdopen('foo.txt', 'w') require an integer? Ultimately, I want to create a new file on disk. Funny, I can't seem to suss-out how to create a new file without resorting to os.system('touch foo.txt'). ... Or maybe not so funny ... >>> foo = os.fdopen('foo.txt', 'w')

Re: Seeking Python + Subversion hosting.

2004-12-06 Thread remi
> Anyone know of a good hosting company that offers both server-side > Python and a subversion repository? > > I know of one: www.textdrive.com - they're a bit pricey, but I s'pose > you gets what you pays for - they look good. > > Just FYI - right now I'm with sapphiresoft.co.uk. They're cheap and

Re: [Python-Help] Programming help

2004-12-06 Thread Danny Yoo
On Mon, 6 Dec 2004, Alfred Canoy wrote: > Please help me out:(.. I've been trying to figure this out for 2 days > now.. I don't know what to use to print all the list of numbers. I hve > know idea how should I do this. I tried a lot of trial & error for the > the def, dict, .list( ). have no luc

Re: byte code generated under linux ==> bad magic number under windows

2004-12-06 Thread Jarek Zgoda
Aaron Bingham wrote: .pyc files are platform-independant but are incompatible between major Python versions. You can not use a .pyc file generated with Python 2.3 with Python 2.4 or vice versa. AFAIK, they *are* platform dependent. You can not share pyc files between ASCII and EBCDIC machine.

Re: Mean, median, and mode

2004-12-06 Thread Peter Hansen
Michael Fuhr wrote: Josiah Carlson <[EMAIL PROTECTED]> writes: "Robert Brewer" <[EMAIL PROTECTED]> wrote: Josiah Carlson wrote: median = lambda x: x.sort() or x[len(x)//2] That...is a really sneaky use of null return values. I like. :) Thank you, I'm just using a paradigm (exploiting lambdas) that

Re: Any affordable Python-based CRM & ERP solutions?

2004-12-06 Thread EuGeNe
Will wrote: Hi all, Please excuse the longish post. I'm new to Python (and programming), but love what I see and believe it to be an important language. I have (at least) one retail client (with single outlet at present) that requires a total business solution for their operation, preferably open s

cut strings and parse for images

2004-12-06 Thread Andreas Volz
Hi, I used SGMLParser to parse all href's in a html file. Now I need to cut some strings. For example: http://www.example.com/dir/example.html Now I like to cut the string, so that only domain and directory is left over. Expected result: http://www.example.com/dir/ I know how to do this in ba

Re: Trying to understand a little python

2004-12-06 Thread Jeremy Jones
McCarty, Greg wrote: Ok, I'm new to python, and I'm trying to come to grips with a few things.  Got lots of years of experience with Java and asp/aspx, etc.  Trying to relate Python's behavior to what I already know.   Here's the python code (line #'s added for my questio

Re: Mean, median, and mode

2004-12-06 Thread Paul McGuire
"Paul McGuire" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > This median expression is incorrect. median is *not* the midpoint between > max and min values. It is the middle value when all values are sorted (for > an odd number of values), or the average of the two middle values

Re: GUI Frames and classmethod

2004-12-06 Thread Zak Arntson
On Fri, 03 Dec 2004 14:48:30 -0800, Scott David Daniels <[EMAIL PROTECTED]> wrote: > Zak Arntson wrote: > > My current approach is that in the Frame class, I have a method to > > call _after_ initialization that creates a bunch of dummy methods so > > the user doesn't have to implement EVERY sta

file descriptors & fdopen

2004-12-06 Thread Scott Frankel
Why does os.fdopen('foo.txt', 'w') require an integer? Ultimately, I want to create a new file on disk. Funny, I can't seem to suss-out how to create a new file without resorting to os.system('touch foo.txt'). ... Or maybe not so funny ... >>> foo = os.fdopen('foo.txt', 'w') Traceback (most rece

Trying to understand a little python

2004-12-06 Thread McCarty, Greg
Ok, I'm new to python, and I'm trying to come to grips with a few things.  Got lots of years of experience with Java and asp/aspx, etc.  Trying to relate Python's behavior to what I already know.   Here's the python code (line #'s added for my question) -   01 class Tester: 02 de

Re: Mean, median, and mode

2004-12-06 Thread Michael Fuhr
Josiah Carlson <[EMAIL PROTECTED]> writes: > "Robert Brewer" <[EMAIL PROTECTED]> wrote: > > > > Josiah Carlson wrote: > > > > > > median = lambda x: x.sort() or x[len(x)//2] > > > > That...is a really sneaky use of null return values. I like. :) > > Thank you, I'm just using a paradigm (exploi

Re: using cmd.exe as a telnet client

2004-12-06 Thread Donnal Walter
I wrote: I've been wanting to get acquainted with Twisted for awhile now, ... BTW, do you know if Twisted's option negotiation uses a callback function? I might download it to take a look, ... Sorry I did not do this earlier, before I posted. It is obvious (now that I have downloaded it) that Twis

ANN: eGenix mx Experimental Package 0.9.0 (mxNumber, mxTidy, mxURL, etc.)

2004-12-06 Thread M.-A. Lemburg
ANNOUNCING eGenix.com mx Experimental Extension Package Version 0.9.0 Experimental Python extensions providing important and useful services for Python programm

ANN: eGenix mxODBC Python Database Interface Version 2.0.7

2004-12-06 Thread M.-A. Lemburg
ANNOUNCING eGenix.com mxODBC Database Interface Version 2.0.7 Full Source Python extension providing ODBC database connectivity to Python applications on Windows and Unix platform

ANN: eGenix mx Base Package 2.0.6 (mxDateTime, mxTextTools, etc.)

2004-12-06 Thread M.-A. Lemburg
ANNOUNCING eGenix.com mx Base Extension Package Version 2.0.6 Open Source Python extensions providing important and useful services for Python programmers. __

Re: RPC with Python - Comparison?

2004-12-06 Thread Wolfgang Keller
>> Candidates could be: >> >> - Pyro I forgot to mention Corba here: - Omniorb - Orbit - Fnorb BTW: It seems to me that none of these provides an AMI implementation...? >> - Twisted.spread >> - OSE (XML-RPC) >> - ICE >> - ...others? > MacPython also supports Apple events (high-level bridge: >

Re: Recursive list comprehension

2004-12-06 Thread Peter Hansen
Timothy Babytch wrote: Serhiy Storchaka wrote: >>>sum([['N', 'F'], ['E'], ['D']], []) ['N', 'F', 'E', 'D'] THE BEST! Hmmm. Maybe, unless readability as in "self-documenting code" is important to you... Preceding the above with "flatten = sum" would perhaps be an adequate improvement. -Peter -- ht

Re: using cmd.exe as a telnet client

2004-12-06 Thread Grant Edwards
On 2004-12-06, Donnal Walter <[EMAIL PROTECTED]> wrote: > Grant Edwards wrote: > > You don't have to start from scratch. The telnet module has > > hooks built-into it1 so that you can have it call your routines > > to handle option negotiation. I did it once to impliment some > > extra Telnet prot

Re: using cmd.exe as a telnet client

2004-12-06 Thread Donnal Walter
Grant Edwards wrote: > You don't have to start from scratch. The telnet module has > hooks built-into it1 so that you can have it call your routines > to handle option negotiation. I did it once to impliment some > extra Telnet protocol features, and it wasn't difficult. Ok, you've inspired me to

Re: Mean, median, and mode

2004-12-06 Thread Josiah Carlson
"Robert Brewer" <[EMAIL PROTECTED]> wrote: > > Josiah Carlson wrote: > > [EMAIL PROTECTED] (Sean McIlroy) wrote: > > > > > > >>> median = lambda x: (max(x)-min(x))/2 > > > > That is /not/ the median in the general case. > > > > median = lambda x: x.sort() or x[len(x)//2] > > That...is a reall

Re: xmlrpclib or twisted?

2004-12-06 Thread Andy Gross
If you're not concerned about interoperability with other languages and are already using Twisted, I'd go with PB. Especially if you are using complicated datatypes that have to be serialized and sent over the wire - PB has a nice Cacheable type that doesn't serialize the whole object. XMLRPC

Re: asynchat and threading

2004-12-06 Thread Fredrik Lundh
Anthony Baxter wrote: > > AFAICT, the main complaint is that it is tied to the TCP transport, > > the sockets API, and the select/poll API. IOW, it cannot easily: > > - integrate TLS on top of TCP (because TLS might involve no-data > >communications, e.g. when TLS negotation happens in the mid

Re: Mean, median, and mode

2004-12-06 Thread Paul McGuire
This median expression is incorrect. median is *not* the midpoint between max and min values. It is the middle value when all values are sorted (for an odd number of values), or the average of the two middle values when all values are sorted (for an even number of values). In Python 2.4 (needed

Re: using cmd.exe as a telnet client

2004-12-06 Thread Donnal Walter
Grant Edwards wrote: > You don't have to start from scratch. The telnet module has > hooks built-into it1 so that you can have it call your routines > to handle option negotiation. I did it once to impliment some > extra Telnet protocol features, and it wasn't difficult. Ok, you've inspired me to

Re: PIL and antialiasing problem

2004-12-06 Thread Fredrik Lundh
Laszlo Zsolt Nagy wrote: > Statement: Sometimes PIL is better than Adobe Photoshop. :-) > > I also found these with the aid of the wonderful dir() function: > > MinFilter, MaxFilter, MedianFilter, ModeFilter, RankFilter, BuiltInFilter > > They do not have a docstring and they are not documented in

Re: help using sockets, and OOP?

2004-12-06 Thread Andy Gross
On Dec 6, 2004, at 12:04 PM, Dfenestr8 wrote: Ok, so are there other types of sockets that aren't "blocking" ? Yes, sockets can be either blocking or non-blocking. An I/O operation on a 'blocking' socket will not return until the operation is complete. If you try to read more bytes than are cur

Re: Deadlock detection

2004-12-06 Thread Josiah Carlson
Duncan Grisby <[EMAIL PROTECTED]> wrote: > > Hi, > > Does anyone know of a deadlock detector for Python? I don't think it > would be too hard to hook into the threading module and instrument > mutexes so they can be tested for deadlocks. I've googled around but I > haven't found anything. I'm

Re: using cmd.exe as a telnet client

2004-12-06 Thread Donnal Walter
Grant Edwards wrote: You don't have to start from scratch. The telnet module has hooks built-into it1 so that you can have it call your routines to handle option negotiation. I did it once to impliment some extra Telnet protocol features, and it wasn't difficult. Ok, you've inspired me to give it

RE: Mean, median, and mode

2004-12-06 Thread Robert Brewer
Josiah Carlson wrote: > [EMAIL PROTECTED] (Sean McIlroy) wrote: > > > > >>> median = lambda x: (max(x)-min(x))/2 > > That is /not/ the median in the general case. > > median = lambda x: x.sort() or x[len(x)//2] That...is a really sneaky use of null return values. I like. :) Robert Brewer MIS

Re: Mean, median, and mode

2004-12-06 Thread Josiah Carlson
[EMAIL PROTECTED] (Sean McIlroy) wrote: > > >>> median = lambda x: (max(x)-min(x))/2 That is /not/ the median in the general case. median = lambda x: x.sort() or x[len(x)//2] - Josiah -- http://mail.python.org/mailman/listinfo/python-list

Re: help using sockets, and OOP?

2004-12-06 Thread Diez B. Roggisch
> Ok, so are there other types of sockets that aren't "blocking" ? You don' want other types of sockets (they are pretty good the way the are) but other ways of using them. The topics you might need to delve into are threading, the select module and twisted. Which at least in part Jp already sugg

Re: help using sockets, and OOP?

2004-12-06 Thread Grant Edwards
On 2004-12-06, Dfenestr8 <[EMAIL PROTECTED]> wrote: >>> Ok, so what if I remove the while loop from the Botling class, and >>> include it in the __main__ ? Might this work as a solution then? >> >> No. > > Ok, so are there other types of sockets that aren't "blocking" ? Yes, non-blocking ones.

Re: The python2.4 IDLE can't be lanuched.

2004-12-06 Thread Jean Brouwers
This is a known problem. More details at /Jean Brouwers In article <[EMAIL PROTECTED]>, AnkyHe <[EMAIL PROTECTED]> wrote: > I downloaded the python 2.4 final from the offical website and installe

Re: The python2.4 IDLE can't be lanuched.

2004-12-06 Thread Brian Beck
Abe Mathews wrote: I'm not running SP 2 on any machines, so I can't test it for you, but it may be that the personal firewall being activated on SP 2 is blocking IDLE from starting up. You might try turning that off and seeing if that helps. IIRC, part of SP 2 was port disabling. I do remember se

Re: Win32 Libs for 2.4

2004-12-06 Thread Robin Becker
Daniel Dittmar wrote: Robin Becker wrote: actually I want to build the PIL extension for 2.4 as pyd and include various libraries eg zlib and jpeg. To avoid the missing dlls issue we have done this in the past by incorporating the zlib/jpeg code using static libraries for both zlib and jpeg. It

  1   2   >