Re: MIMEText breaking the rules?

2007-08-02 Thread Tim Roberts
Dale Strickland-Clark <[EMAIL PROTECTED]> wrote: > >The email module's mimetext handling isn't what you might expect from >something that appears to behave like a dictionary. >... >Having apparently REPLACED my recipient, what I've ended up with is both of >them. This behavior is documented in Mes

Re: Tkinter or wxpython?

2007-08-02 Thread Glenn Hutchings
On Aug 3, 1:00 am, "wang frank" <[EMAIL PROTECTED]> wrote: > I want to build a GUI to execut python script. I found TKinter and > wxpython. Which one is easier for a newbie? and which one is better? Well, Tkinter comes with Python, so newbies can get up and running straight away without having to

Help: GIS

2007-08-02 Thread zxo102
Hi, I am new in GIS area and need your suggestions for where I can start from. I have a python based web application with a database. Now I would like to add a GIS map into my application. When a user clicks a certain area in the GIS map, it can grab the data from the database via my python ba

ANN: SonomaSunshine for Django v0.01

2007-08-02 Thread SamFeltus
Presented for your amusement, with source code for the first time!!! LOL The Redneck Riviera's Best Python Powered Folk Art Server... SonomaSunshine v0.01 for Django Django application for creating/editing Shiny/Happy Flash movies. http://samfeltus.com/django/hey_yall.html -- http://mail.pyth

Re: Error with Tkinter and tkMessageBox

2007-08-02 Thread John McMonagle
Fabio Z Tessitore wrote: > I've tried to use Twm and SURPRISE! it works!!! > > Can you say why? How can I fix the prob with Gnome? > > Thanks I don't know why it doesn't work correctly on the version of gnome which you are running (I run KDE). Perhaps the question needs to be posed to a gnome

Re: __call__ considered harmful or indispensable?

2007-08-02 Thread Skip Montanaro
> > In this case there was a bug. Depending on inputs, sometimes obj > > initialized to a class, sometimes an instance of that class. (I fixed > > that too while I was at it.) The problem was that the use of __call__ > > obscured the underlying bug by making the instance as well as the class > >

Re: __call__ considered harmful or indispensable?

2007-08-02 Thread Carl Banks
On Aug 2, 2:30 pm, [EMAIL PROTECTED] wrote: > I'm wondering, are there some general cases where __call__ methods of > a user-defined class are simply indispensable? Indispensable's a strong word, but one thing that entails calling syntax, and can't (reasonably) be done with closures is to override

Job Fair F/OSS project

2007-08-02 Thread [EMAIL PROTECTED]
Hello Pythonistas! I'm looking for some volunteers for a new open source project. At the Institute of Design (http://www.id.iit.edu ), our next project is a system for the management of our job fair (http://www.id.iit.edu/ recruitID/ ) The systems goal is to allow students and employers to enter

Re: Berkely Db. How to iterate over large number of keys "quickly"

2007-08-02 Thread lazy
On Aug 2, 1:42 pm, Ian Clark <[EMAIL PROTECTED]> wrote: > lazy wrote: > > I have a berkely db and Im using the bsddb module to access it. The Db > > is quite huge (anywhere from 2-30GB). I want to iterate over the keys > > serially. > > I tried using something basic like > > > for key in db.keys()

Re: PYTHON PROGRAMMING HELP PLSSS !!URGENT

2007-08-02 Thread Danyelle Gragsone
Hi, Please do not double post. Especially with more than one email address. If someone can help you. I am sure they will. Danyelle -- http://mail.python.org/mailman/listinfo/python-list

Re: __call__ considered harmful or indispensable?

2007-08-02 Thread Carl Banks
On Aug 2, 4:27 pm, Paul Rubin wrote: > [EMAIL PROTECTED] writes: > > In this particular case it was clearly unnecessary and just obfuscated the > > code. I'm wondering, are there some general cases where __call__ methods of > > a user-defined class are simply indispensab

Re: __call__ considered harmful or indispensable?

2007-08-02 Thread James Stroud
James Stroud wrote: > import functools > class enclosable(object): > def __init__(self, func): > self.func = func > def __call__(self, *args, **kwargs): > return functools.partial(self.func, *args, **kwargs) > > For example: > > @enclosable > def do_something_with(a, b): > [etc] O

Re: Efficient Rank Ordering of Nested Lists

2007-08-02 Thread beginner
On Aug 2, 8:20 pm, "[EMAIL PROTECTED]" <[EMAIL PROTECTED]> wrote: > A naive approach to rank ordering (handling ties as well) of nested > lists may be accomplished via: > >def rankLists(nestedList): > def rankList(singleList): > sortedList = list(singleList) > sortedLi

PYTHON PROGRAMMING HELP PLSSS !!URGENT

2007-08-02 Thread alibaaba
HI All, i am a 4th year business student and i took web design online course for fun however i did not see that last 2 chapters were python programming.This has no relevance to my major nor does it have any contribution to my degree. My fun turned out to be my nightmare since i literally can not gr

Efficient Rank Ordering of Nested Lists

2007-08-02 Thread [EMAIL PROTECTED]
A naive approach to rank ordering (handling ties as well) of nested lists may be accomplished via: def rankLists(nestedList): def rankList(singleList): sortedList = list(singleList) sortedList.sort() return map(sortedList.index, singleList) return map(r

Re: __call__ considered harmful or indispensable?

2007-08-02 Thread James Stroud
[EMAIL PROTECTED] wrote: > I don't personally use __call__ methods in my classes, but I have > encountered it every now and then here at work in code written by other > people. The other day I replaced __call__ with a more obvious method name, > so now instead of executing > > obj(foo, bar, b

Re: frequency analysis of a DB column

2007-08-02 Thread John Machin
On Aug 2, 12:21 pm, goldtech <[EMAIL PROTECTED]> wrote: > In Python 2.1 are there any tools to take a column from a DB and do a > frequency analysis - a breakdown of the values for this column? > > Possibly a histogram or a table saying out of 500 records I have one > hundred and two "301" ninety-e

Re: (no) fast boolean evaluation ?

2007-08-02 Thread Joshua J. Kugler
On Thursday 02 August 2007 15:19, Evan Klitzke wrote: >> I discovered that boolean evaluation in Python is done "fast" >> (as soon as the condition is ok, the rest of the expression is ignored). > > This is standard behavior in every language I've ever encountered. Then you've never programmed in

Tkinter or wxpython?

2007-08-02 Thread wang frank
Hi, I want to build a GUI to execut python script. I found TKinter and wxpython. Which one is easier for a newbie? and which one is better? Thanks Frank _ 豪華!大リーグ観戦ツアーや高級外車が当たるスペシャルキャンペーンをお見逃しな く http://clk.atdmt.com/GBL/go/msnj

Re: frequency analysis of a DB column

2007-08-02 Thread Gabriel Genellina
En Thu, 02 Aug 2007 09:28:46 -0300, Carsten Haese <[EMAIL PROTECTED]> escribió: > On Thu, 2007-08-02 at 00:38 -0300, Gabriel Genellina wrote: >> >> select column, count(column), min(column), max(column) >> from table >> group by column >> order by count(column) desc > > What's the point of incl

Re: python 3.0, pywin32 and scipy

2007-08-02 Thread sturlamolden
On Aug 2, 10:53 pm, vml <[EMAIL PROTECTED]> wrote: > I hope it will be possible to switch easily to python 3. But I need to > produce something as cheap as possible and I have no means ... Python 3k is not released yet. Why do you worry about compatibility in advance? Well, you are not the only

Re: i am new to python-Please somebody help

2007-08-02 Thread gregarican
On Aug 2, 11:03 am, Bruno Desthuilliers <[EMAIL PROTECTED]> wrote: > gregarican a écrit : > (snip) > > > This link answers my question > > -->http://www.google.com/search?hl=en&q=Python+list+rudeness. > > I seriously don't think that this newsgroup can be qualified as "rude" > (and I'm possibly on

Re: python 3.0, pywin32 and scipy

2007-08-02 Thread Jean-Paul Calderone
On Thu, 02 Aug 2007 23:07:12 +0200, "Diez B. Roggisch" <[EMAIL PROTECTED]> wrote: >Jean-Paul Calderone schrieb: >> On Thu, 02 Aug 2007 21:16:04 +0200, "Diez B. Roggisch" >> <[EMAIL PROTECTED]> wrote: >>> vml schrieb: Hello, I am trying to promote python in my job, my collegue o

Re: (no) fast boolean evaluation ?

2007-08-02 Thread John Machin
On Aug 3, 9:19 am, "Evan Klitzke" <[EMAIL PROTECTED]> wrote: > On 8/2/07, Stef Mientki <[EMAIL PROTECTED]> wrote: > > > hello, > > > I discovered that boolean evaluation in Python is done "fast" > > (as soon as the condition is ok, the rest of the expression is ignored). > > > Is this standard beha

Re: Best way to capture output from an exec'ed (or such) script?

2007-08-02 Thread Gabriel Genellina
En Thu, 02 Aug 2007 16:48:06 -0300, <[EMAIL PROTECTED]> escribió: > In any case. I've added some minor scripting support, so that you can > write dynamic pages in Python. To do this, I use execfile(), and pass > the script a dictionary with some basic variables. The script then > sets a "ret" vari

Re: (no) fast boolean evaluation ?

2007-08-02 Thread John Machin
On Aug 3, 8:55 am, Ian Clark <[EMAIL PROTECTED]> wrote: > Stef Mientki wrote: > > hello, > > > I discovered that boolean evaluation in Python is done "fast" > > (as soon as the condition is ok, the rest of the expression is ignored). > > > Is this standard behavior or is there a compiler switch to

Re: (no) fast boolean evaluation ?

2007-08-02 Thread Evan Klitzke
On 8/2/07, Stef Mientki <[EMAIL PROTECTED]> wrote: > hello, > > I discovered that boolean evaluation in Python is done "fast" > (as soon as the condition is ok, the rest of the expression is ignored). > > Is this standard behavior or is there a compiler switch to turn it on/off ? > This is standar

Re: __call__ considered harmful or indispensable?

2007-08-02 Thread Paul Boddie
Bruno Desthuilliers wrote: > > Most of what you can do with a callable instance can be done with > closures (and is usually done so in FPLs), but given Python's OO nature, > it's sometimes clearer and simpler to use callable instances than > closures. Indeed. I think __call__ has been neglected as

Re: __call__ considered harmful or indispensable?

2007-08-02 Thread infidel
I find it useful in certain situations. In particular, I have used it along with cx_Oracle to provide a python module that dynamically mirrors a package of stored procedures in the database. Basically I had class StoredProcedure(object) and each instance of this class represented a particular sto

Re: (no) fast boolean evaluation ?

2007-08-02 Thread Ian Clark
Stef Mientki wrote: > hello, > > I discovered that boolean evaluation in Python is done "fast" > (as soon as the condition is ok, the rest of the expression is ignored). > > Is this standard behavior or is there a compiler switch to turn it on/off ? > > thanks, > Stef Mientki It's called short

Re: (no) fast boolean evaluation ?

2007-08-02 Thread Gabriel Genellina
En Thu, 02 Aug 2007 18:47:49 -0300, Stef Mientki <[EMAIL PROTECTED]> escribió: > I discovered that boolean evaluation in Python is done "fast" > (as soon as the condition is ok, the rest of the expression is ignored). > > Is this standard behavior or is there a compiler switch to turn it > on/

Re: python 3.0, pywin32 and scipy

2007-08-02 Thread sturlamolden
On Aug 2, 10:53 pm, vml <[EMAIL PROTECTED]> wrote: > And I try to argue to give up vb 6 and use python. Either you have a valid argument for switching to Python or you do not. If you do not, there is not really any justification for the extra work (including teaching your staff Python). > C# is

Re: Bug in execfile?

2007-08-02 Thread Fernando Perez
Ian Clark wrote: > Fernando Perez wrote: >> Hi all, >> >> (snip) >> >> I'm really, really puzzled by this. From reading the execfile() docs, I had >> the hunch to change the call to: >> >> execfile(fname,{}) >> >> and now the problem disappears, so I can keep on working. >> >> But I'm st

Re: Pythonic way for missing dict keys

2007-08-02 Thread Alex Popescu
[EMAIL PROTECTED] (Alex Martelli) wrote in news:1i27mku.1sc8l3x1dda3crN% [EMAIL PROTECTED]: > Bruno Desthuilliers <[EMAIL PROTECTED]> > wrote: > >> Alex Popescu a écrit : > > [... snip ...] > > > The mere check of whether an object possesses some important special > method is best accomplished t

Experimentation and dealing with transient broken code (was: Python end of file marker similar to perl's __END__)

2007-08-02 Thread Ben Finney
Steven D'Aprano <[EMAIL PROTECTED]> writes: > It's not just "bad syntax" that makes the triple-quote or comment > trick useful. Okay. That was the original reason given for refusing suggestions like "return early from the function" etc. I answered in that context. > Because you're experimenting,

Bug in time, part 2

2007-08-02 Thread Joshua J. Kugler
Or could I entitle this, "A Wrinkle in time.py," with apologies to Madeleine L'Engle. Either I've found a bug (or rather room for improvement) in time.py, or I *really* need a time module that doesn't assume so much. After the suggestions to try setting the dst flag to zero, I did some more exper

(no) fast boolean evaluation ?

2007-08-02 Thread Stef Mientki
hello, I discovered that boolean evaluation in Python is done "fast" (as soon as the condition is ok, the rest of the expression is ignored). Is this standard behavior or is there a compiler switch to turn it on/off ? thanks, Stef Mientki -- http://mail.python.org/mailman/listinfo/python-list

Re: Representation of new-style instance

2007-08-02 Thread Bjoern Schliessmann
Raj B wrote: > Which C struct in the Python implementation is used to represent > the instances c1 and c2 of the new-style class? You don't try to send this raw over some stream connection, do you? Regards, Björn -- BOFH excuse #349: Stray Alpha Particles from memory packaging caused Hard

Re: Reading a two-column file into an array?

2007-08-02 Thread Gilles Ganault
On Tue, 31 Jul 2007 08:41:45 -0700, [EMAIL PROTECTED] (Alex Martelli) wrote: >That's what 2.5's with statement is all about...: Thanks everyone. Python power :-) from __future__ import with_statement import csv with open('import.csv', 'rb') as f: for item in list(csv.reader(f, delimiter=

Re: Determining if file is valid image file

2007-08-02 Thread Jarek Zgoda
Terry Reedy napisał(a): > Other than installing PIL, is there a "simple" way using Python only > to determine if a file is a valid image file? > [...] >> Be aware that broken images (i.e. partially downloaded) in many cases >> pass the imghdr.what() test. > > To put it another way, the on

Re: i am new to python-Please somebody help

2007-08-02 Thread Bruno Desthuilliers
gregarican a écrit : (snip) > This link answers my question --> > http://www.google.com/search?hl=en&q=Python+list+rudeness. I seriously don't think that this newsgroup can be qualified as "rude" (and I'm possibly one of the "rudest" persons here). Compared to most comp.* newsgroup, Python is c

Re: __call__ considered harmful or indispensable?

2007-08-02 Thread Terry Reedy
<[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] | I'm wondering, are there some general cases where __call__ methods of | a user-defined class are simply indispensable? One classical example (untested, based on memory of posted code): class memoize(): def __init__(self, func):

Re: python 3.0, pywin32 and scipy

2007-08-02 Thread Diez B. Roggisch
Jean-Paul Calderone schrieb: > On Thu, 02 Aug 2007 21:16:04 +0200, "Diez B. Roggisch" > <[EMAIL PROTECTED]> wrote: >> vml schrieb: >>> Hello, >>> >>> >>> I am trying to promote python in my job, my collegue only see matlab >>> and microsoft scripting language. >>> I understood that there willl be

Re: File access

2007-08-02 Thread JD
Thanks for the suggestion, I am thinking implement a database system for that. JD On Aug 2, 12:11 pm, Larry Bates <[EMAIL PROTECTED]> wrote: > JD wrote: > > Hi, > > > What I am trying to do is to run a subprocess on another machine using > > subprocess.Popen, this subprocess contuinue writing som

Re: __call__ considered harmful or indispensable?

2007-08-02 Thread Paul Rubin
Bruno Desthuilliers <[EMAIL PROTECTED]> writes: > from foo import foo > x = foo(3) > > Or did I miss the point ??? The foo module might define a bunch of additional functions that you still want to be able to access in qualified form. For example it would somewhat clean up the interface to the p

Re: Bug in execfile?

2007-08-02 Thread Ian Clark
Fernando Perez wrote: > Hi all, > > (snip) > > I'm really, really puzzled by this. From reading the execfile() docs, I had > the hunch to change the call to: > > execfile(fname,{}) > > and now the problem disappears, so I can keep on working. > > But I'm still very bothered by the fact th

Re: python 3.0, pywin32 and scipy

2007-08-02 Thread vml
On 2 août, 22:30, sturlamolden <[EMAIL PROTECTED]> wrote: > On Aug 2, 6:01 pm, vml <[EMAIL PROTECTED]> wrote: > > > - my script using pywin32 for the COM layer and scipy for the maths > > won't work under 3.0 > > Why not? > > > - will we have the equivalent of pywin32 and scipy in python ? > > Say

Re: __call__ considered harmful or indispensable?

2007-08-02 Thread Bruno Desthuilliers
Paul Rubin a écrit : > [EMAIL PROTECTED] writes: > >>In this particular case it was clearly unnecessary and just obfuscated the >>code. I'm wondering, are there some general cases where __call__ methods of >>a user-defined class are simply indispensable? > > > I don't know about "indispensable"

Re: __call__ considered harmful or indispensable?

2007-08-02 Thread Bruno Desthuilliers
[EMAIL PROTECTED] a écrit : > I don't personally use __call__ methods in my classes, but I have > encountered it every now and then here at work in code written by other > people. The other day I replaced __call__ with a more obvious method name, > so now instead of executing > > obj(foo, bar

Re: Berkely Db. How to iterate over large number of keys "quickly"

2007-08-02 Thread Ian Clark
lazy wrote: > I have a berkely db and Im using the bsddb module to access it. The Db > is quite huge (anywhere from 2-30GB). I want to iterate over the keys > serially. > I tried using something basic like > > for key in db.keys() > > but this takes lot of time. I guess Python is trying to get th

Re: Determining if file is valid image file

2007-08-02 Thread Terry Reedy
"Jarek Zgoda" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] André napisa³(a): Other than installing PIL, is there a "simple" way using Python only to determine if a file is a valid image file? [...] > Be aware that broken images (i.e. partially downloaded) in many cases >

Re: python 3.0, pywin32 and scipy

2007-08-02 Thread sturlamolden
On Aug 2, 6:01 pm, vml <[EMAIL PROTECTED]> wrote: > - my script using pywin32 for the COM layer and scipy for the maths > won't work under 3.0 Why not? > - will we have the equivalent of pywin32 and scipy in python ? Say what? I've always thought pywin32 and scipy were Python packages. -- ht

Re: Berkely Db. How to iterate over large number of keys "quickly"

2007-08-02 Thread Christoph Haas
On Thu, Aug 02, 2007 at 07:43:58PM -, lazy wrote: > I have a berkely db and Im using the bsddb module to access it. The Db > is quite huge (anywhere from 2-30GB). I want to iterate over the keys > serially. > I tried using something basic like > > for key in db.keys() > > but this takes lot o

Re: Catching SystemExit in C API code when embedding Python?

2007-08-02 Thread Stefan Bellon
On Thu, 02 Aug, Farshid Lashkari wrote: > You cannot use PyRun_SimpleString, since it will automatically print > and clear the error. You will need to use PyRun_String instead. Thanks, that helps a lot! -- Stefan Bellon -- http://mail.python.org/mailman/listinfo/python-list

Re: __call__ considered harmful or indispensable?

2007-08-02 Thread Paul Rubin
[EMAIL PROTECTED] writes: > In this particular case it was clearly unnecessary and just obfuscated the > code. I'm wondering, are there some general cases where __call__ methods of > a user-defined class are simply indispensable? I don't know about "indispensable" but __call__ is convenient somet

Re: i am new to python-Please somebody help

2007-08-02 Thread Terry Reedy
"gregarican" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] | On Aug 2, 12:58 pm, "Terry Reedy" <[EMAIL PROTECTED]> wrote: || > Sorry, I saw nothing rude in Steven's straightforward and indeed polite | > suggestion. Your post, however, | > | > tjr | | Maybe it's just me but th

Re: Case study: library class inheritance with property declarations

2007-08-02 Thread Bruno Desthuilliers
[EMAIL PROTECTED] a écrit : (snip) > Last post -- I swear. > > I failed to realize that it's all part of an extremely well defined > attribute resolution protocol, and handled via the descriptor > specification. Discussing descriptors was on the TODO list for the > type/class unification document,

Re: Email

2007-08-02 Thread Laurent Pointal
Rohan wrote: > I was wondering if there could be an arrangement where a file could be > attached and send as an email. > For ex > f = open(add.txt,w) > f.write('python') > f.close() > > Now I would like to send an email with add.txt as an attachment, is it > possible ? > some one give me a pointe

Re: Berkely Db. How to iterate over large number of keys "quickly"

2007-08-02 Thread marduk
On Thu, 2007-08-02 at 19:43 +, lazy wrote: > I have a berkely db and Im using the bsddb module to access it. The Db > is quite huge (anywhere from 2-30GB). I want to iterate over the keys > serially. > I tried using something basic like > > for key in db.keys() > > but this takes lot of time.

Re: python 3.0, pywin32 and scipy

2007-08-02 Thread Jean-Paul Calderone
On Thu, 02 Aug 2007 21:16:04 +0200, "Diez B. Roggisch" <[EMAIL PROTECTED]> wrote: >vml schrieb: >> Hello, >> >> >> I am trying to promote python in my job, my collegue only see matlab >> and microsoft scripting language. >> I understood that there willl be no backward compatibility between >> pyth

Re: Berkely Db. How to iterate over large number of keys "quickly"

2007-08-02 Thread lazy
Sorry, Just a small correction, > a way I can tell Python to not load allkeys, but try to access it as > the loop progresses(like in a linked list). I could find any accessor > methonds on bsddb to this with my initial search. I meant, "I couldn't find any accessor methonds on bsddb to do this(i.

Re: Error subclassing datetime.date and pickling

2007-08-02 Thread kyosohma
On Aug 2, 11:02 am, Mike Rooney <[EMAIL PROTECTED]> wrote: > Hi everyone, this is my first post to this list. I am trying to create a > subclass of datetime.date and pickle it, but I get errors on loading it > back. I have created a VERY simple demo of this: > > import datetime > > class MyDate(dat

Re: Determining if file is valid image file

2007-08-02 Thread André
On Aug 2, 4:25 pm, Jarek Zgoda <[EMAIL PROTECTED]> wrote: > André napisa³(a): > > Other than installing PIL, is there a "simple" way using Python only > to determine if a file is a valid image file? > I'd be happy if I could at least identify valid images files for gif, > jpeg a

Best way to capture output from an exec'ed (or such) script?

2007-08-02 Thread exscape
Hey everyone, I'm writing a tiny web server, mostly to learn - security and such is a non-issue, but learning how to make things secure is of course nice too. To be clear - I will most likely not even use it myself. In any case. I've added some minor scripting support, so that you can write dynami

Berkely Db. How to iterate over large number of keys "quickly"

2007-08-02 Thread lazy
I have a berkely db and Im using the bsddb module to access it. The Db is quite huge (anywhere from 2-30GB). I want to iterate over the keys serially. I tried using something basic like for key in db.keys() but this takes lot of time. I guess Python is trying to get the list of all keys first and

Re: i am new to python-Please somebody help

2007-08-02 Thread Neil Cerutti
On 2007-08-02, gregarican <[EMAIL PROTECTED]> wrote: > On Aug 2, 12:58 pm, "Terry Reedy" <[EMAIL PROTECTED]> wrote: >> "gregarican" <[EMAIL PROTECTED]> wrote in message >> >> news:[EMAIL PROTECTED] >> | friendly than Python's. Your points are well-taken in how to properly >> | post and how to do yo

Re: Catching SystemExit in C API code when embedding Python?

2007-08-02 Thread Farshid Lashkari
Stefan Bellon wrote: > Thanks for your hints ... > > The interesting part is "Call python code". In my example this is done > with PyRun_SimpleString which does not return if an exception is not > handled but raised "out of" the interpreter. So I am unsure of what you > mean with "Call python code

Re: Catching SystemExit in C API code when embedding Python?

2007-08-02 Thread Stefan Bellon
On Thu, 02 Aug, Farshid Lashkari wrote: > Also, here is some sample code that will catch system exit exceptions: > > //Call python code > ... > //Check for system exit exception > if(PyErr_Occurred()) { > if(PyErr_ExceptionMatches(PyExc_SystemExit)) { > //handle system exit >

Re: problems playing with dates from any month.

2007-08-02 Thread kyosohma
On Aug 2, 1:16 pm, "krishnakant Mane" <[EMAIL PROTECTED]> wrote: > On 02/08/07, Ian Clark <[EMAIL PROTECTED]> wrote: > > > > >http://docs.python.org/lib/node85.html > > I looked there even before. > but could not figure out what the code did. > I know in that variable called s there was a string in

Re: Determining if file is valid image file

2007-08-02 Thread Jarek Zgoda
André napisał(a): Other than installing PIL, is there a "simple" way using Python only to determine if a file is a valid image file? I'd be happy if I could at least identify valid images files for gif, jpeg and png. Pointers to existing modules or examples would be appr

Re: XML Processing

2007-08-02 Thread kyosohma
On Aug 2, 2:09 pm, Jay Loden <[EMAIL PROTECTED]> wrote: > [EMAIL PROTECTED] wrote: > > On Aug 2, 1:45 pm, Roman <[EMAIL PROTECTED]> wrote: > >> Is there a package that converts a string that contains special > >> characters in xml to to literal value. For instance, converts > >> stringhttp://myho

Re: __call__ considered harmful or indispensable?

2007-08-02 Thread Diez B. Roggisch
[EMAIL PROTECTED] schrieb: > I don't personally use __call__ methods in my classes, but I have > encountered it every now and then here at work in code written by other > people. The other day I replaced __call__ with a more obvious method name, > so now instead of executing > > obj(foo, bar,

Re: XML Processing

2007-08-02 Thread Diez B. Roggisch
Roman schrieb: > Is there a package that converts a string that contains special > characters in xml to to literal value. For instance, converts string > http://myhome/¶m to http://myhome/¶m. import xml.sax.saxutils print xml.sax.saxutils.escape("I'm a happy & friendly guy, and 1 < 3 - neve

Re: python 3.0, pywin32 and scipy

2007-08-02 Thread Diez B. Roggisch
vml schrieb: > Hello, > > > I am trying to promote python in my job, my collegue only see matlab > and microsoft scripting language. > I understood that there willl be no backward compatibility between > python 2.x and 3.0, does it means that: > > - my script using pywin32 for the COM layer and

Re: Memory Leak with Tkinter Canvas (Python 2.5 Win32)

2007-08-02 Thread Wojciech Muła
frikk wrote: > [...] > As you can see- I am doing nothing other than drawing a lot of > rectangles on the canvas. You aren't drawing, but **creating** rectangle objects, as a meth. name suggests. You find more info at tkinter.effbot.org. > [...] > > def clear_grid(): canv.delete(ALL)

Re: __call__ considered harmful or indispensable?

2007-08-02 Thread Chris Mellon
On 8/2/07, Neil Cerutti <[EMAIL PROTECTED]> wrote: > On 2007-08-02, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: > > I don't personally use __call__ methods in my classes, but I > > have encountered it every now and then here at work in code > > written by other people. The other day I replaced __

Re: Catching SystemExit in C API code when embedding Python?

2007-08-02 Thread Stefan Bellon
First of all, I'm sorry to followup my own posting, but I can add a few things ... On Thu, 02 Aug, Stefan Bellon wrote: > As in Python itself you can catch SystemExit, I think this should be > the way to go. But how do I catch this exception from within the C > API? I now installed an exception

Re: Catching SystemExit in C API code when embedding Python?

2007-08-02 Thread Farshid Lashkari
Stefan Bellon wrote: > Hi all! > > I am embedding Python into a GUI application in a way that the GUI is > scriptable using Python. > > Now I have come to a problem that when the user puts a "sys.exit(0)" > into his script to end the script, not only the script is terminated, > but also the GUI a

Re: XML Processing

2007-08-02 Thread Jay Loden
[EMAIL PROTECTED] wrote: > On Aug 2, 1:45 pm, Roman <[EMAIL PROTECTED]> wrote: >> Is there a package that converts a string that contains special >> characters in xml to to literal value. For instance, converts >> stringhttp://myhome/¶mtohttp://myhome/¶m. >> >> Thanks in advance > > I've seen ex

Re: i am new to python-Please somebody help

2007-08-02 Thread gregarican
On Aug 2, 12:58 pm, "Terry Reedy" <[EMAIL PROTECTED]> wrote: > "gregarican" <[EMAIL PROTECTED]> wrote in message > > news:[EMAIL PROTECTED] > | friendly than Python's. Your points are well-taken in how to properly > | post and how to do your own homework. Message correct. Delivery > | lacking... >

Re: __call__ considered harmful or indispensable?

2007-08-02 Thread Neil Cerutti
On 2007-08-02, Neil Cerutti <[EMAIL PROTECTED]> wrote: > On 2007-08-02, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: >> I don't personally use __call__ methods in my classes, but I >> have encountered it every now and then here at work in code >> written by other people. The other day I replaced _

Re: XML Processing

2007-08-02 Thread Jay Loden
Robert Dailey wrote: > Both strings in your example are exactly the same, unless I'm missing > something. > > On 8/2/07, Roman <[EMAIL PROTECTED]> wrote: >> Is there a package that converts a string that contains special >> characters in xml to to literal value. For instance, converts string >> h

Re: __call__ considered harmful or indispensable?

2007-08-02 Thread Neil Cerutti
On 2007-08-02, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: > I don't personally use __call__ methods in my classes, but I > have encountered it every now and then here at work in code > written by other people. The other day I replaced __call__ > with a more obvious method name, so now instead of

Re: XML Processing

2007-08-02 Thread kyosohma
On Aug 2, 1:45 pm, Roman <[EMAIL PROTECTED]> wrote: > Is there a package that converts a string that contains special > characters in xml to to literal value. For instance, converts > stringhttp://myhome/¶mtohttp://myhome/¶m. > > Thanks in advance I've seen examples using the HTMLgen module. But

Re: Determining if file is valid image file

2007-08-02 Thread brad
André wrote: > I should have added: I'm interesting in validating the file *content* > - not the filename :-) Some formats have identifying headers... I think jpeg is an example of this. Open it with a hex editor or just read the first few bytes and see for yourself. Brad -- http://mail.pytho

Re: XML Processing

2007-08-02 Thread Robert Dailey
Both strings in your example are exactly the same, unless I'm missing something. On 8/2/07, Roman <[EMAIL PROTECTED]> wrote: > > Is there a package that converts a string that contains special > characters in xml to to literal value. For instance, converts string > http://myhome/¶m to http://myho

XML Processing

2007-08-02 Thread Roman
Is there a package that converts a string that contains special characters in xml to to literal value. For instance, converts string http://myhome/¶m to http://myhome/¶m. Thanks in advance -- http://mail.python.org/mailman/listinfo/python-list

Re: problems playing with dates from any month.

2007-08-02 Thread Ian Clark
krishnakant Mane wrote: > On 02/08/07, Ian Clark <[EMAIL PROTECTED]> wrote: > >> http://docs.python.org/lib/node85.html >> > I looked there even before. > but could not figure out what the code did. > I know in that variable called s there was a string in a valid date format. > but when datetime.s

Bug in execfile?

2007-08-02 Thread Fernando Perez
Hi all, I'm finding the following behavior truly puzzling, but before I post a bug report on the site, I'd rather be corrected if I'm just missing somethin obvious. Consider the following trivial script: # Simple script that imports something from the stdlib from math import sin, pi wav = lambd

__call__ considered harmful or indispensable?

2007-08-02 Thread skip
I don't personally use __call__ methods in my classes, but I have encountered it every now and then here at work in code written by other people. The other day I replaced __call__ with a more obvious method name, so now instead of executing obj(foo, bar, baz) the code in question is ob

Re: python 3.0, pywin32 and scipy

2007-08-02 Thread Terry Reedy
"vml" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] | I am trying to promote python in my job, my collegue only see matlab | and microsoft scripting language. | I understood that there willl be no backward compatibility between | python 2.x and 3.0, does it means that: Most of the

Re: File access

2007-08-02 Thread Larry Bates
JD wrote: > Hi, > > What I am trying to do is to run a subprocess on another machine using > subprocess.Popen, this subprocess contuinue writing something into a > file when it is runing. > > After submit this subprocess, I tried to open the file and readlines() > in the loop (with a delay) in th

Re: problems playing with dates from any month.

2007-08-02 Thread krishnakant Mane
On 02/08/07, Ian Clark <[EMAIL PROTECTED]> wrote: > > http://docs.python.org/lib/node85.html > I looked there even before. but could not figure out what the code did. I know in that variable called s there was a string in a valid date format. but when datetime.strptime was used, I did not understa

Re: problems playing with dates from any month.

2007-08-02 Thread kyosohma
On Aug 2, 12:31 pm, "krishnakant Mane" <[EMAIL PROTECTED]> wrote: > hello, > I have a very strange problem and I can't find any solution for that. > I am working on an accounting package which I wish to develop in python. > the simple problem is that I want to knoe how I can know if the given > dat

Re: Email

2007-08-02 Thread kyosohma
On Aug 2, 12:33 pm, Rohan <[EMAIL PROTECTED]> wrote: > I was wondering if there could be an arrangement where a file could be > attached and send as an email. > For ex > f = open(add.txt,w) > f.write('python') > f.close() > > Now I would like to send an email with add.txt as an attachment, is it >

Re: Emacs + python

2007-08-02 Thread Greg Donald
On 8/1/07, hg <[EMAIL PROTECTED]> wrote: > Are there any cscope & ECB equivalent for Python ? ECB is not language specific. It works the same for browsing Python code as any other language. -- Greg Donald http://destiney.com/ -- http://mail.python.org/mailman/listinfo/python-list

Re: problems playing with dates from any month.

2007-08-02 Thread Ian Clark
krishnakant Mane wrote: > hello, > I have a very strange problem and I can't find any solution for that. > I am working on an accounting package which I wish to develop in python. > the simple problem is that I want to knoe how I can know if the given > date is the nth day of a month. > for example

Email

2007-08-02 Thread Rohan
I was wondering if there could be an arrangement where a file could be attached and send as an email. For ex f = open(add.txt,w) f.write('python') f.close() Now I would like to send an email with add.txt as an attachment, is it possible ? some one give me a pointer towards this. -- http://mail.p

problems playing with dates from any month.

2007-08-02 Thread krishnakant Mane
hello, I have a very strange problem and I can't find any solution for that. I am working on an accounting package which I wish to develop in python. the simple problem is that I want to knoe how I can know if the given date is the nth day of a month. for example if a customer is supposed to pay hi

Re: Wing IDE for Python v. 3.0 beta1 released

2007-08-02 Thread John K Masters
On 08:00 Thu 02 Aug , [EMAIL PROTECTED] wrote: > On Aug 1, 6:42 pm, John K Masters <[EMAIL PROTECTED]> wrote: > > To suggest that, because the autocompletion worked on one method of a > > module and not on another was because I had not configured the > > PYTHONPATH properly is at least insultin

  1   2   >