Re: the annoying, verbose self

2007-11-23 Thread Kay Schluehr
On 24 Nov., 07:29, Marc 'BlackJack' Rintsch <[EMAIL PROTECTED]> wrote: > On Fri, 23 Nov 2007 20:48:06 -0800, Kay Schluehr wrote: > > I like this pattern but less much I like the boilerplate. What about > > an explicit unpacking protocol and appropriate syntax? > > > def abs(self): > > x, y, z

Re: Catching a segfault in a Python library

2007-11-23 Thread Donn Ingle
> You may have to roll your own fork/exec to start the wxpython, instead > of using popen or the subprocess module.  I'm not terribly conversant > in those modules but they may start a shell which would isolate your > program from the wxpython exit code. Hrmm... Neither am I, that's why I asked her

Re: the annoying, verbose self

2007-11-23 Thread Marc 'BlackJack' Rintsch
On Fri, 23 Nov 2007 20:48:06 -0800, Kay Schluehr wrote: > I like this pattern but less much I like the boilerplate. What about > an explicit unpacking protocol and appropriate syntax? > > def abs(self): > x, y, z by self > return math.sqrt(x**2 + y**2 + z**2) > > expands to > > def ab

Re: Catching a segfault in a Python library

2007-11-23 Thread Paul Rubin
Donn Ingle <[EMAIL PROTECTED]> writes: > Okay, that's a good start. Thanks, I'll go for a python starts wxpython > thing with os.wait() to sniff the outcome. You may have to roll your own fork/exec to start the wxpython, instead of using popen or the subprocess module. I'm not terribly conversant

mod_python

2007-11-23 Thread Vernon Wenberg III
Why do I receive a "File not found" error on a perfect good and simple script but properly receive errors when I deliberately add errors in the script? The file is there, it just doesn't do anything. Any help would be appreciated. -- http://mail.python.org/mailman/listinfo/python-list

Re: How do I convert escaped HTML into a string?

2007-11-23 Thread Marc 'BlackJack' Rintsch
On Sat, 24 Nov 2007 05:42:06 +, Just Another Victim of the Ambient Morality wrote: > ...since HTML seems to convert any amount and type of whitespace into a > single space (a bizarre design choice if I've ever seen one). Not really. Just imagine how web pages would look like if whitespa

Re: Catching a segfault in a Python library

2007-11-23 Thread Donn Ingle
> Well I think you should actually debug it, or at least reproduce it > and send a bug report to the PIL folks, It was a while ago, and if memory serves I did that, but memory fails. > but anyway you can use > os.wait() to get the exit status and recognize the seg fault. Okay, that's a good start

Re: How do I convert escaped HTML into a string?

2007-11-23 Thread Sergio Correia
This may help: http://effbot.org/zone/re-sub.htm#strip-html You should take care that there are several issues about going from html to txt 1) What should wedo aboutthis? You need to strip all tags.. 2) ", &, <, and >... and I could keep going.. we need to convert all those 3) we need to remo

Re: How do I convert escaped HTML into a string?

2007-11-23 Thread Stefan Behnel
Just Another Victim of the Ambient Morality wrote: > I've done a google search on this but, amazingly, I'm the first guy to > ever need this! You cannot infer that from a Google search. > So, how do I convert HTML to plaintext? Something like this: > > This is a string. > > ...in

Re: eof

2007-11-23 Thread greg
Dennis Lee Bieber wrote: > Pascal I/O worked with a "one element preread", where what we'd > consider a read operation was performed by the open operation -- which > made console I/O a royal pain Yep. Later implementations reduced the pain somewhat by using a "lazy" scheme which deferred the

Re: Clean way to get one's network IP address?

2007-11-23 Thread Hendrik van Rooyen
"Steven D'Aprano" wrote: > On Sat, 24 Nov 2007 00:05:13 +, Steven D'Aprano wrote: > > > ... you're absolutely write ... > > Okay, I now officially have no more credibility left. Time for me to get > a Hotmail email address and open a MySpace page and spend all my time > writing "OMG LOL

How do I convert escaped HTML into a string?

2007-11-23 Thread Just Another Victim of the Ambient Morality
I've done a google search on this but, amazingly, I'm the first guy to ever need this! Everyone else seems to need the reverse of this. Actually, I did find some people who complained about this and rolled their own solution but I refuse to believe that Python doesn't have a built-in solu

Re: Catching a segfault in a Python library

2007-11-23 Thread Paul Rubin
Donn Ingle <[EMAIL PROTECTED]> writes: > > Run your app under a debugger and figure out what is making it crash. > Already done, the code within PIL is causing the crash. It gets ugly and out > of my remit. It's a freetype/Pil thing and I simply want to a way to catch > it when it happens. > Since

Re: eof

2007-11-23 Thread MonkeeSage
On Nov 23, 10:43 pm, "[EMAIL PROTECTED]" <[EMAIL PROTECTED]> wrote: > This is not the same as ISO C. f.tell could be equal to > File.size(f.path) and eof could be false. An extra read() is required. My bad. As you might have surmised, I'm not a genius when it comes to C. I thought that the eof f

Re: Catching a segfault in a Python library

2007-11-23 Thread Donn Ingle
> Run your app under a debugger and figure out what is making it crash. Already done, the code within PIL is causing the crash. It gets ugly and out of my remit. It's a freetype/Pil thing and I simply want to a way to catch it when it happens. Since a segfault ends the process, I am asking about "

Re: the annoying, verbose self

2007-11-23 Thread Kay Schluehr
On Nov 24, 12:54 am, Steven D'Aprano <[EMAIL PROTECTED] cybersource.com.au> wrote: > The correct solution to your example is to get rid of the attribute > lookups from the expression completely: > > def abs(self): > x, y, z = self.x, self.y, self.z > return math.sqrt(x**2 + y**2 + z**2) >

Re: eof

2007-11-23 Thread [EMAIL PROTECTED]
On Nov 24, 2:24 am, MonkeeSage <[EMAIL PROTECTED]> wrote: > > Actually, to be a bit more technical, IO#eof acts like standard C eof > for File objects, it only blocks / requires a previous read() on > character devices and pipes and such. For files, it's the same as > checking the absolute position

Re: Catching a segfault in a Python library

2007-11-23 Thread Paul Rubin
Donn Ingle <[EMAIL PROTECTED]> writes: > Do you think that's a good idea, or is there another way to handle stuff > like this? (perhaps a Python app launching another Python app?) Run your app under a debugger and figure out what is making it crash. -- http://mail.python.org/mailman/listinfo/pyt

Re: eof

2007-11-23 Thread MonkeeSage
On Nov 23, 10:00 pm, "[EMAIL PROTECTED]" <[EMAIL PROTECTED]> wrote: > Ruby doesn't have the good ol' eof. Good old eof tests a single flag > and requires a pre read(). Ruby's eof blocks and does buffering (and > this is a very strong technical statement). Actually, to be a bit more technical, IO

Catching a segfault in a Python library

2007-11-23 Thread Donn Ingle
Yo, An app of mine relies on PIL. When PIL hits a certain problem font (for unknown reasons as of now) it tends to segfault and no amount of try/except will keep my wxPython app alive. My first thought is to start the app from a bash script that will check the return value of my wxPython app and

Re: eof

2007-11-23 Thread [EMAIL PROTECTED]
On Nov 22, 1:17 pm, braver <[EMAIL PROTECTED]> wrote: > Ruby has iterators and generators too, but it also has my good ol' > f.eof(). I challenge the assumption here of some majectically Python- Ruby doesn't have the good ol' eof. Good old eof tests a single flag and requires a pre read(). Ruby'

Re: Clean way to get one's network IP address?

2007-11-23 Thread MonkeeSage
On Nov 21, 9:15 am, Gilles Ganault <[EMAIL PROTECTED]> wrote: > Hello > > I need to get the local computer's IP address, ie. what's displayed > when running "ifconfig" in Linux: > > # ifconfig > eth0 Link encap:Ethernet HWaddr 00:15:58:A1:D5:6F > inet addr:192.168.0.79 Bcast:192.16

Re: foldr function in Python

2007-11-23 Thread MonkeeSage
On Nov 23, 8:56 pm, MonkeeSage <[EMAIL PROTECTED]> wrote: > This doesn't matter for non-associative functions > like "+", but it does for associative functions like "-". Err...that's backwards...should have been: This doesn't matter for associative functions like "+", but it does for non-associa

Re: eof

2007-11-23 Thread MonkeeSage
On Nov 23, 6:56 pm, greg <[EMAIL PROTECTED]> wrote: > By not providing an eof() function, C -- and Python -- make > it clear that testing for eof is not a passive operation. > It's always obvious what's going on, and it's much harder to > make mistakes like the above. err...C has feof() in stdio

Re: md5 wrongness?

2007-11-23 Thread John Machin
On Nov 24, 1:34 pm, Ron Johnson <[EMAIL PROTECTED]> wrote: > Why do Python's md5 and GNU md5sum produce differing results? They don't differ. Try feeding them the same input: >>> import md5 >>> md5.new('snagglefrob').hexdigest() '9eb2459fcdd9f9b8a9fef7348bcac933' >>> md5.new('snagglefrob\n').hexd

Re: md5 wrongness?

2007-11-23 Thread Erik Max Francis
Ron Johnson wrote: > $ echo "snagglefrob" | md5sum > f842244d79af85b457811091319d85ff - > > $ python > Python 2.4.4 (#2, Aug 16 2007, 02:03:40) > [GCC 4.1.3 20070812 (prerelease) (Debian 4.1.2-15)] on linux2 > Type "help", "copyright", "credits" or "license" for more information. import md5

Re: foldr function in Python

2007-11-23 Thread MonkeeSage
On Nov 23, 7:05 pm, greg <[EMAIL PROTECTED]> wrote: > My feeling is that Python shouldn't provide a bunch of > different versions of the same function that differ only in > the degree of currying. If you want a particular curried > combination, it's easy enough to create it as needed using > lambd

how to get the native DC value in Tkinter/wxPython for drawing?

2007-11-23 Thread oyster
I am porting www.rmchart.com to python, now the code is almost finished, and I have supplied some examples.py which write to picturefiles directly, but the example to draw the chart on GUI stops me. that is the vb declaration nResult (LONG) = RMC_CreateChartOnDC( ByVal nParentDC (LONG), ByVal nCtr

md5 wrongness?

2007-11-23 Thread Ron Johnson
Why do Python's md5 and GNU md5sum produce differing results? $ md5sum --version md5sum (GNU coreutils) 5.97 $ echo snagglefrob | md5sum f842244d79af85b457811091319d85ff - $ echo 'snagglefrob' | md5sum f842244d79af85b457811091319d85ff - $ echo "snagglefrob" | md5sum f842244d79af85b457811091319

Re: Not forking?

2007-11-23 Thread greg
Gilles Ganault wrote: > It seems like the following doesn't actually fork, > > sys.stdout = open(os.devnull, 'w') > if os.fork(): > sys.exit(0) What makes you think it's not forking? Chances are it *is* forking, but something is going wrong later. Do you get any traceback? > try: >

Re: the annoying, verbose self

2007-11-23 Thread greg
BJörn Lindqvist wrote: > 6def abs(self): > 7return math.sqrt(self.x * self.x + self.y * self.y + > self.z * self.z) I would write that as def abs(self): x = self.x y = self.y z = self.z return math.sqrt(x * x + y * y + z * z) Not only is it ea

Re: the annoying, verbose self

2007-11-23 Thread George Sakkis
On Nov 23, 7:21 pm, "BJörn Lindqvist" <[EMAIL PROTECTED]> wrote: > On Nov 23, 2007 11:54 PM, Steven D'Aprano > > The correct solution to your example is to get rid of the attribute > > lookups from the expression completely: > > No it is not. The "solution" is nothing more than a silly band-aid >

Re: the annoying, verbose self

2007-11-23 Thread Patrick Mullen
Most of the time self doesn't bother me in the slightest. The one time it does bother me however, is when I am turning a function into a method. In this case, often I have many local variables which I actually want to be instance variables, so I have to add self to all of them. Of course, this i

python network access restriccion in ipod touch/iphone?

2007-11-23 Thread dvd
Hi i have a python script that uses urllib2 to download one file, it runs ok in any pc but when urlopen is called in the ipod it show the following error: The complete stack: >>> urllib2.urlopen("http://yahoo.com";) Traceback (most recent call last): File "", line 1, in File "/usr/lib/pyt

Re: foldr function in Python

2007-11-23 Thread greg
Marc 'BlackJack' Rintsch wrote: > The name is definitely not so good because there is a `foldr` in Haskell > that just works like `reduce()`. Because currying is ubiquitous in Haskell, you can use the same function in either a curried or non-curried fashion. But in Python you need different functi

Re: How to import xplt, pylab?

2007-11-23 Thread [EMAIL PROTECTED]
On Nov 23, 8:03 pm, Robert Kern <[EMAIL PROTECTED]> wrote: > > In any case, xplt has been deprecated for a long time. It probably doesn't > work. > I don't recommend using it unless if you want to take on the responsibility of > maintaining it. > > -- BTW, does she need help with importing a mod

Re: eof

2007-11-23 Thread greg
braver wrote: > Historically, is it possible to trace the eof-related design decision > in stdlib? You seem to be assuming that someone started out with a design that included an eof() of the kind you want, and then decided to remove it. But I doubt that such a method was ever considered in the f

Re: the annoying, verbose self

2007-11-23 Thread [EMAIL PROTECTED]
Hi, Python uses "self" (and textual notation when possible) because its designers consider that symbols reduce readability. Self won't go away. :-P The issue is related to the first and seventh lines in The Zen of Python, 1. "Beautiful is better than ugly" 7. "Readability counts." My opi

Re: the annoying, verbose self

2007-11-23 Thread Neil Cerutti
On 2007-11-23, BJörn Lindqvist <[EMAIL PROTECTED]> wrote: > The big deal is that "self." occupies important horizontal > screen real estate. That is, it is usually not self in itself > that is problematic, but the overflowing lines is. Take this > silly vector class for example: > > 1class Vect

Re: the annoying, verbose self

2007-11-23 Thread John Machin
On Nov 24, 10:54 am, Steven D'Aprano <[EMAIL PROTECTED] cybersource.com.au> wrote: [snip] > > The correct solution to your example is to get rid of the attribute > lookups from the expression completely: "correct" in what sense? > > def abs(self): > x, y, z = self.x, self.y, self.z > retu

Re: eof

2007-11-23 Thread Neil Cerutti
On 2007-11-23, braver <[EMAIL PROTECTED]> wrote: > Can we say that f.eof() in fact can check for EOF right after > we've read all characters from a file, but before a failed > attempt to read beyond? In Python's idiom, > > for line lin file: ># look at a line ># we can tell eof occurs righ

RE: Recursive loading trouble for immutables

2007-11-23 Thread rekkufa
On Sat Nov 24 00:19:20 CET 2007, Steven D'Aprano wrote: > You mean like pickle? (Pardon me for telling you something you may > already know, but then you may not already know it...) The serializer I am writing has very different goals, way beyond just the serializing bit, human readability bein

Re: the annoying, verbose self

2007-11-23 Thread BJörn Lindqvist
On Nov 23, 2007 11:54 PM, Steven D'Aprano <[EMAIL PROTECTED]> wrote: > On Fri, 23 Nov 2007 23:38:24 +, BJörn Lindqvist > wrote: > > > I like that a lot. This saves 12 characters for the original example and > > removes the need to wrap it. > > > > 7return math.sqrt(.x * .x + .y * .y

Re: Clean way to get one's network IP address?

2007-11-23 Thread Steven D'Aprano
On Sat, 24 Nov 2007 00:05:13 +, Steven D'Aprano wrote: > ... you're absolutely write ... Okay, I now officially have no more credibility left. Time for me to get a Hotmail email address and open a MySpace page and spend all my time writing "OMG LOL LOL LOL did u c teh thing on Ausrtalia Idl

Re: Clean way to get one's network IP address?

2007-11-23 Thread Steven D'Aprano
On Fri, 23 Nov 2007 15:58:06 -0800, Dennis Lee Bieber wrote: > On Fri, 23 Nov 2007 22:56:41 -, Steven D'Aprano > <[EMAIL PROTECTED]> declaimed the following in > comp.lang.python: > > >> I'm not surprised. Windows XP usually stores the hosts file here: >> >> C:\system32\drivers\etc\hosts >>

Re: eof

2007-11-23 Thread braver
On Nov 22, 8:04 pm, Neil Cerutti <[EMAIL PROTECTED]> wrote: > I think Python is well rid of such a seldomly useful source of > confusion. So all that code folks wrote in Algol-like languages, -- e.g. this works in Ada, -- while not End_of_File(f) loop -- end if; -- are confusing? Why not int

Re: the annoying, verbose self

2007-11-23 Thread Steven D'Aprano
On Fri, 23 Nov 2007 23:38:24 +, BJörn Lindqvist wrote: > I like that a lot. This saves 12 characters for the original example and > removes the need to wrap it. > > 7return math.sqrt(.x * .x + .y * .y + .z * .z) > > +1 Readability counts, even on small screens. -2 Readability co

Re: the annoying, verbose self

2007-11-23 Thread braver
On Nov 24, 2:38 am, "BJörn Lindqvist" <[EMAIL PROTECTED]> wrote: > The big deal is that "self." occupies important horizontal screen real > estate. That is, it is usually not self in itself that is problematic, Exactly. I understand and appreciate all the scoping qualification and explicit"ation

Re: the annoying, verbose self

2007-11-23 Thread BJörn Lindqvist
On Nov 22, 2007 2:08 PM, Colin J. Williams <[EMAIL PROTECTED]> wrote: > [EMAIL PROTECTED] wrote: > > Alexy: > >> Sometimes I > >> avoid OO just not to deal with its verbosity. In fact, I try to use > >> Ruby anywhere speed is not crucial especially for @ prefix is better- > >> looking than self. >

Re: Looking to learn python willing to clean up code

2007-11-23 Thread Jean-Paul Calderone
On Fri, 23 Nov 2007 01:36:10 GMT, Nathan McSween <[EMAIL PROTECTED]> wrote: >Hi I would like to learn python I have background in php, pawn, bash. I was >wondering if anyone would like to show me the ropes or even just throw me >some code that needs work and seeing what I come up with. Twisted pyth

Re: Recursive loading trouble for immutables

2007-11-23 Thread Steven D'Aprano
On Fri, 23 Nov 2007 16:43:28 -0600, rekkufa wrote: > I am currently building a system for serializing python objects to a > readable file-format, as well as creating python objects by parsing the > same format. You mean like pickle? (Pardon me for telling you something you may already know, but

Re: Clean way to get one's network IP address?

2007-11-23 Thread Steven D'Aprano
On Fri, 23 Nov 2007 08:52:58 -0800, [EMAIL PROTECTED] wrote: > On Nov 21, 5:34 pm, Steven D'Aprano <[EMAIL PROTECTED] > cybersource.com.au> wrote: >> On Wed, 21 Nov 2007 12:00:52 -0500, Joe Riopel wrote: >> > On Nov 21, 2007 10:15 AM, Gilles Ganault <[EMAIL PROTECTED]> wrote: >> >> I know about so

Re: Problems with if/elif statement syntax

2007-11-23 Thread Ricardo Aráoz
[EMAIL PROTECTED] wrote: > On Nov 22, 12:33 pm, "[EMAIL PROTECTED]" <[EMAIL PROTECTED]> wrote: >> On 22 Nov, 12:09, Neil Webster <[EMAIL PROTECTED]> wrote: >> >> >> >>> Hi all, >>> I'm sure I'm doing something wrong but after lots of searching and >>> reading I can't work it out and was wondering i

Recursive loading trouble for immutables

2007-11-23 Thread rekkufa
I am currently building a system for serializing python objects to a readable file-format, as well as creating python objects by parsing the same format. It is more or less complete except for a single issue I just cannot figure out by myself: How to load data that specifies immutables that recu

Re: the annoying, verbose self

2007-11-23 Thread Kay Schluehr
Colin J. Williams schrieb: > Kay Schluehr wrote: >> On Nov 22, 8:43 pm, Bruno Desthuilliers >> <[EMAIL PROTECTED]> wrote: >>> Colin J. Williams a écrit : >>> >>> >>> [EMAIL PROTECTED] wrote: > Alexy: >> Sometimes I >> avoid OO just not to deal with its verbosity. In fact, I try to

Re: foldr function in Python

2007-11-23 Thread Steven D'Aprano
On Fri, 23 Nov 2007 15:20:38 +0100, Peter Otten wrote: > reduce() is indeed in the functools -- added by Guido van Rossum > himself. I am extremely glad to be wrong, you've cheered me up no end :-D -- Steven. -- http://mail.python.org/mailman/listinfo/python-list

Re: png transparency with PIL

2007-11-23 Thread Robin Becker
Bjoern Schliessmann wrote: > Robin Becker wrote: > >> I'm trying to determine the transparency information for a png . >> guessing I need the alpha channel, but is there a way to get hold >> of it? > > For accessing the alpha channel, there is an RGBA mode for PNG > files: > > http://www

Re: How to import xplt, pylab?

2007-11-23 Thread Robert Kern
Caren Balea wrote: > On 23 Nov, 01:28, "[EMAIL PROTECTED]" <[EMAIL PROTECTED]> wrote: >> scipy is pretty powerful, but has awful documentation and it's code >> is somewhat disorganized/hacked. Maybe, you could try: >> >> import scipy >> import scipy.sandbox >> import scipy.sandbox.xplt > > Oka

Re: python class methods identity?

2007-11-23 Thread Bruno Desthuilliers
Chris Mellon a écrit : > On Nov 23, 2007 1:29 AM, Roc Zhou <[EMAIL PROTECTED]> wrote: (snip) >>Since both "var" and "func" are the variable of the class object, and > > "members", not variables. > "attributes", not members !-) -- http://mail.python.org/mailman/listinfo/python-list

Re: Extracting data from dump file

2007-11-23 Thread John Machin
On Nov 24, 5:46 am, TYR <[EMAIL PROTECTED]> wrote: > I have a large dump file that originated in a MySQL db; I need to get > it into an SQLite file. > > Various options are suggested around the web; none of them seem to > work (most failing to import the thing in the first place). So I > removed th

Re: Assertion for python scripts

2007-11-23 Thread Steven W. Orr
On Friday, Nov 2nd 2007 at 14:14 -, quoth matthias: =>Howdy ! => =>I started using the assert() stmt and found it quite useful :-) I =>have only one problem: I don't =>know how to turn them off again. => =>I know that "-O" turns off assertions in general. However, how do I =>pass thus param

Re: Python too complex ?!?!?!

2007-11-23 Thread Chris Mellon
On Nov 22, 2007 3:04 PM, Brian <[EMAIL PROTECTED]> wrote: > / Chime Mode > I have, in fact, sent this thread to my friend. > His limiting factors are > > - money-control people favor MS platforms > - C# and VS have minimal cost impact for academia > - sys admins have everything locked down (proba

Re: Function stopping a function

2007-11-23 Thread Sorin Schwimmer
In my situation, there is a device with keyboard that allows some user input. In the same time, the device is connected to a standard PC, and there may be some communication there. The lengthy_function() resides and executes in the device, and so is cancel(). Lengthy_function() is pretty linear:

Re: may be a bug in string.rstrip

2007-11-23 Thread Scott SA
On 11/23/07, Bruno Desthuilliers ([EMAIL PROTECTED]) wrote: >> The better option, IMO, is probably to use regex. > >You forgot at least the simplest solution: > >import os.path >os.path.splitext('132.ext')[0] Yes, I did miss that one... and while I was typing there was a nagging feeling I was m

Re: creating color gradients using PIL

2007-11-23 Thread Simon Hibbs
On 21 Nov, 06:30, Ramdas <[EMAIL PROTECTED]> wrote: > Any ideas how we can create a color gradient using Python Imaging > Library. Has any got some sample code that can give me some idea. I > need to create a horizontal and vertical color gradient for a college > project > > Thanks I use these fun

Re: python safe scripting

2007-11-23 Thread Simon Hibbs
> > 2007/11/21, Vladimir Rusinov <[EMAIL PROTECTED]>: > Yes, but apache, nginx and others does not uses logger. > I wanna write an application which would handle all my (Linux) logs: > rotating, compressing, analysing and so on (logrotate replacement), it would > require some nontrivial configura

Extracting data from dump file

2007-11-23 Thread TYR
I have a large dump file that originated in a MySQL db; I need to get it into an SQLite file. Various options are suggested around the web; none of them seem to work (most failing to import the thing in the first place). So I removed the assorted taggery from each end, leaving just a big text file

Refreshing GridBagSizer

2007-11-23 Thread Steve S
Hey guys, I'm stuck with using a GridBagSizer (wxPython) in a GUI Dialog and am having a frustrating time with refreshing it properly. Essentially, I've got to refresh the contents of the GridBagSizer on occasion with new values. The way I'm doing it works 4 times out of 5 but on the 5th, *all*

Re: Python too complex ?!?!?!

2007-11-23 Thread Patrick Mullen
On Nov 22, 2007 1:04 PM, Brian <[EMAIL PROTECTED]> wrote: > / Chime Mode > I have, in fact, sent this thread to my friend. > His limiting factors are > > - money-control people favor MS platforms > - C# and VS have minimal cost impact for academia > - sys admins have everything locked down (probab

Re: png transparency with PIL

2007-11-23 Thread Bjoern Schliessmann
Robin Becker wrote: > I'm trying to determine the transparency information for a png > image. With gif images I can determine the colour that is used for > transparent areas using im.info['transparency']. For the png > images of interest there is no such entry in the info dict. I > assume that's b

png transparency with PIL

2007-11-23 Thread Robin Becker
I'm trying to determine the transparency information for a png image. With gif images I can determine the colour that is used for transparent areas using im.info['transparency']. For the png images of interest there is no such entry in the info dict. I assume that's because of the way png does t

error handling

2007-11-23 Thread [EMAIL PROTECTED]
i want to capture run time errors so that the execution of program doesnt stop. i want an error handler function ( that will email me or something like that ) on error and not stop the execution of program. how do i do this? i can not use try except for this... thanks -- http://mail.python.org/ma

Re: How to import xplt, pylab?

2007-11-23 Thread Caren Balea
On 23 Nov, 01:28, "[EMAIL PROTECTED]" <[EMAIL PROTECTED]> wrote: > scipy is pretty powerful, but has awful documentation and it's code > is somewhat disorganized/hacked. Maybe, you could try: > > import scipy > import scipy.sandbox > import scipy.sandbox.xplt Okay, thanks. I've tried but witho

Re: Python too complex ?!?!?!

2007-11-23 Thread Toni Mueller
[EMAIL PROTECTED] wrote: > On Nov 17, 8:25 am, Donn Ingle <[EMAIL PROTECTED]> wrote: >> If you are online and the app runs, it can check the "freshness" of your >> modules (those called from the app and recursively) and offer to fetch the >> latest stable versions. >> > > Something similar to Java

Re: Python web frameworks

2007-11-23 Thread BartlebyScrivener
I'm just learning Django and feeling my way through all of this server terminology. Where does Django's memcached feature fit into all of this? When you all speak of start up costs and memory intensive loading for each requests, doesn't the caching feature eliminate most of that overhead? http://w

Re: python class methods identity?

2007-11-23 Thread Chris Mellon
On Nov 23, 2007 1:29 AM, Roc Zhou <[EMAIL PROTECTED]> wrote: > Hello, > > I'm now being confused by this segment of code: > >>> class Test: > ... var = 1 > ... def func(self): pass > ... > >>> x = Test() > >>> y = Test() > >>> x.var is y.var > True > >>> x.func is y.func > False > >>> id(x.

Re: may be a bug in string.rstrip

2007-11-23 Thread Bruno Desthuilliers
Scott SA a écrit : > On 11/23/07, kyo guan ([EMAIL PROTECTED]) wrote: > >> Please look at this code: >> > 'exe.torrent'.rstrip('.torrent') >> 'ex' <- it should be 'exe', why? >> >> but this is a right answer: >> > '120.exe'.rstrip('.exe') >> '120' <

Re: Clean way to get one's network IP address?

2007-11-23 Thread [EMAIL PROTECTED]
On Nov 21, 5:34 pm, Steven D'Aprano <[EMAIL PROTECTED] cybersource.com.au> wrote: > On Wed, 21 Nov 2007 12:00:52 -0500, Joe Riopel wrote: > > On Nov 21, 2007 10:15 AM, Gilles Ganault <[EMAIL PROTECTED]> wrote: > >> I know about socket.gethostbyname, but this relies on what's in > >> /etc/hosts, and

Handling Menubars in WXGlade

2007-11-23 Thread jatin patni
Hi, I recently started working on WXGlade... I found some amount of documentation online I am having problems integrating event handlers with MenubarsI want each menu item to open a new window with custom made controls...but I can't find it anywhere.Writing event handler is secondary

Re: Python web frameworks

2007-11-23 Thread joe jacob
On Nov 21, 10:27 pm, Steven Bethard <[EMAIL PROTECTED]> wrote: > Jeff wrote: > > On Nov 21, 6:25 am, Bruno Desthuilliers > [EMAIL PROTECTED]> wrote: > >> joe jacob a écrit : > >> (snip) > > >>> Thanks everyone for the response. From the posts I understand that > >>> Django and pylons are the best.

Re: Looking to learn python willing to clean up code

2007-11-23 Thread kyosohma
On Nov 22, 7:36 pm, "Nathan McSween" <[EMAIL PROTECTED]> wrote: > Hi I would like to learn python I have background in php, pawn, bash. I was > wondering if anyone would like to show me the ropes or even just throw me > some code that needs work and seeing what I come up with. Twisted python > seem

Re: Function stopping a function

2007-11-23 Thread [EMAIL PROTECTED]
Note, this only works in Unix systems: import os, signal def long_process(): while True: print "I'm messing with your terminal ! ", def short_process(long_process_id): raw_input('Press [Enter] to kill the bad process') os.kill(long_process_id, signal.SIGKILL) pr

Re: /usr/local/lib/python25.zip

2007-11-23 Thread kyosohma
On Nov 23, 12:05 am, ebzzry <[EMAIL PROTECTED]> wrote: > I'm trying to run an application and I got this: > > % meld > Traceback (most recent call last): > File "/usr/local/bin/meld", line 73, in > pygtk.require("2.0") > File "/usr/local/lib/python2.5/site-packages/pygtk.py", line 47, in >

Sockets not going away

2007-11-23 Thread Dave Kennedy
Hi, I'm getting to grips with sockets and http servers in Python. I have this bit of code which should be enough for a simple web demo import socket, os from BaseHTTPServer import HTTPServer from SimpleHTTPServer import SimpleHTTPRequestHandler def test(HandlerClass = SimpleHTTPReques

Re: may be a bug in string.rstrip

2007-11-23 Thread Sion Arrowsmith
Scott SA <[EMAIL PROTECTED]> wrote: >>>> string.replace('120.exe','.exe','') >'120' Don't use string.replace(), use the replace method of strings: >>> '120.exe'.replace('.exe', '') '120' >... but it has a side-effect of mid-string replacements: > >>>> string.replace('123.exe.more','.

Re: foldr function in Python

2007-11-23 Thread Peter Otten
Ant wrote: > On Nov 23, 10:54 am, Steven D'Aprano <[EMAIL PROTECTED] > cybersource.com.au> wrote: > ... >> Alas and alack, I believe that Guido has a distaste for all but the >> simplest functional idioms, and an irrational belief that anything using >> reduce() must be too complex to bear. reduce

Re: Finding out what other tasks are running

2007-11-23 Thread Tim Golden
Tim Golden wrote: > Jeremy C B Nicoll wrote: >> Is there a cross-platform of determining what other processes (or in Windows >> terms, other applications) are running? >> >> Is it possible in a cross-platform way to ask some other application to shut >> down, wait a while, and then test to see if i

Re: Finding out what other tasks are running

2007-11-23 Thread Tim Golden
Jeremy C B Nicoll wrote: > Is there a cross-platform of determining what other processes (or in Windows > terms, other applications) are running? > > Is it possible in a cross-platform way to ask some other application to shut > down, wait a while, and then test to see if it did shut? > > Failing

Re: Finding out what other tasks are running

2007-11-23 Thread Tim Golden
Jeremy C B Nicoll wrote: > Is there a cross-platform of determining what other processes (or in Windows > terms, other applications) are running? > > Is it possible in a cross-platform way to ask some other application to shut > down, wait a while, and then test to see if it did shut? > >

Finding out what other tasks are running

2007-11-23 Thread Jeremy C B Nicoll
Is there a cross-platform of determining what other processes (or in Windows terms, other applications) are running? Is it possible in a cross-platform way to ask some other application to shut down, wait a while, and then test to see if it did shut? Failing that are there separate Windows, Mac a

BaseHTTPServer issues

2007-11-23 Thread samwyse
I've just now submitted two issues to the issue tracker: 1491BaseHTTPServer incorrectly implements response code 100 RFC 2616 sec 8.2.3 states, "An origin server that sends a 100 (Continue) response MUST ultimately send a final status code, once the request body is received and processed, u

Re: foldr function in Python

2007-11-23 Thread Ant
On Nov 23, 10:54 am, Steven D'Aprano <[EMAIL PROTECTED] cybersource.com.au> wrote: ... > Alas and alack, I believe that Guido has a distaste for all but the > simplest functional idioms, and an irrational belief that anything using > reduce() must be too complex to bear. reduce() is going away, not

The Python Papers is looking for additional Associate Editors

2007-11-23 Thread Maurice LING
"The Python Papers" (http://pythonpapers.org), ISSN 1834-3147, is an online e-journal, covering articles on Python in the community, industry and academia. We were established in the second half of 2006 and launched our first issue in November 2006. Since then, we have released 3 more issues.

Re: Is there pointer * in Python?

2007-11-23 Thread Donn Ingle
> think inside Python... Assuming you *can* think while being slowly crushed and digested :D \d -- http://mail.python.org/mailman/listinfo/python-list

Re: Next float?

2007-11-23 Thread Hendrik van Rooyen
"Steven D'Aprano" wrote: > Damn, I don't remember writing that! It is caused by drinking too much Alzheimer's Light. : - ) - Hendrik -- http://mail.python.org/mailman/listinfo/python-list

Re: Is there pointer * in Python?

2007-11-23 Thread M�ta-MCI (MVP)
Hi! > like in C Why think to C? Why not Cobol? APL? Intercal? For think right in Python, forget C, forget others languages, think inside Python... Michel Claveau -- http://mail.python.org/mailman/listinfo/python-list

Re: Writing event handler for dropdown list in python

2007-11-23 Thread M�ta-MCI (MVP)
Hi! Please, specify which way you chose, for Python (client-side): wxpython, active-scripting, qt, pluie, other... @-salutations Michel Claveau -- http://mail.python.org/mailman/listinfo/python-list

Writing event handler for dropdown list in python

2007-11-23 Thread mc . pandey
Hi, I am new to python, Can someone help me with writing event handler for a dropdown list in python. i have one function to create dropdown list in a file def dropdown_options(self,title,options,name,value = None): ret = "\n"+ title.title() + " \n" if (options != []):

how to write event handler for dropdown list

2007-11-23 Thread mc . pandey
Hi, I am new to python, Can someone help me with writing event handler for a dropdown list in python. i have one function to create dropdown list in a file def dropdown_options(self,title,options,name,value = None): ret = "\n"+ title.title() + " \n" if (options != []):

Re: www.200836.com---labor daygift

2007-11-23 Thread Yeef
QQ:625101446 MSN:[EMAIL PROTECTED] I'm a chinese. On Nov 23, 2007 8:46 AM, <[EMAIL PROTECTED]> wrote: > if you want to know any information about 2008 beijing Olympic > games ,please contact me or visit : > my website--www.200836.com > MSN:[EMAIL PROTECTED] > e-mail:[EMAIL PROTECTED] > yahooID:[E

  1   2   >