Re: Why does my compiler say invalid syntax then highlight...?

2008-03-11 Thread Chris
On Mar 11, 5:44 am, Nathan Pinno <[EMAIL PROTECTED]> wrote: > Why does my compiler say invalid syntax and then highlight the > quotation marks in the following code: > > # This program is to find primes. > primes = [] > import math > import gmpy > while 1: >     run = int(raw_input("Do you want to

Re: image matching algorithms

2008-03-11 Thread Daniel Fetchinson
> The second thing I'll try (after trying > your suggestion) is based on this paper which I found in the meantime: > http://salesin.cs.washington.edu/abstracts.html#MultiresQuery > In case anyone is interested, it describes a multiresolution querying > algorithm and best of all, it has pseudo code

Re: tcp client socket bind problem

2008-03-11 Thread Tim Roberts
[EMAIL PROTECTED] wrote: > >On Mar 10, 9:40 am, Marc Christiansen <[EMAIL PROTECTED]> wrote: >> [EMAIL PROTECTED] wrote: >> > I have a linux box with multiple ip addresses. I want to make my >> > python client connect from one of the ip addresses. Here is my code, >> > no matter what valid informat

Re: What c.l.py's opinions about Soft Exception?

2008-03-11 Thread Diez B. Roggisch
Chris schrieb: > If all you wanted was some grouping of exceptions why not something > like... > > soft_exception_list = [IndexError, TypeError] > hard_exception_list = [ZeroDivision] > > try: > do_something() > except Exception, e: > if e.__class__ in soft_exception_list: > handl

Re: Distributed App - C++ with Python for Portability?

2008-03-11 Thread Bob Martin
in 337600 20080310 222850 [EMAIL PROTECTED] wrote: >On Mar 10, 2:21 pm, Bob Martin <[EMAIL PROTECTED]> wrote: > >> >> Java is more portable than most other languages, especially if your app >> needs a gui. > >The promise of Java portability was one of the biggest scams ever >perpetrated on the sof

Re: Python Sockets Help

2008-03-11 Thread bockman
On 10 Mar, 23:58, Mark M Manning <[EMAIL PROTECTED]> wrote: > I need your expertise with a sockets question. > > Let me preface this by saying I don't have much experience with > sockets in general so this question may be simple. > > I am playing with the mini dns server from a script I found > on

Re: execute python script question

2008-03-11 Thread Gabriel Rossetti
Sam wrote: > Hello, > > I may misunderstand your problem, but it may be related to the > execution environment, especially the PYTHONPATH variable. Have a look > at the following log: > > [EMAIL PROTECTED]:/$ pwd > / > [EMAIL PROTECTED]:/$ cat -n /tmp/test_import.py > 1 class A(object): >

Re: wxPython/wxWidgets ok for production use ? (was Re: Quality assurance in Python projects containing C modules)

2008-03-11 Thread NoelByron
Hi Malcom On Mar 10, 4:27 pm, "Malcolm Greene" <[EMAIL PROTECTED]> wrote: > I'm new to Python and getting ready to build a small client based > application intended to run on Windows and Linux. I was planning on > using wxPython until I saw your comment above. We use wxPython and Python internall

Re: execute python script question

2008-03-11 Thread Gabriel Rossetti
Michael Wieher wrote: > stupid question: you have myPackage somewhere on sys.path? > > I mean, module1.py only knows it lives in a directory, it doesn't know > anything about anything above it. > > > > 2008/3/10, Gabriel Rossetti <[EMAIL PROTECTED] > >: > > Hello, >

Re: parsing directory for certain filetypes

2008-03-11 Thread Gerard Flanagan
On Mar 11, 6:21 am, royG <[EMAIL PROTECTED]> wrote: > On Mar 10, 8:03 pm, Tim Chase wrote: > > > In Python2.5 (or 2.4 if you implement the any() function, ripped > > from the docs[1]), this could be rewritten to be a little more > > flexible...something like this (untested): > > that was quite a g

Re: Distributed App - C++ with Python for Portability?

2008-03-11 Thread dave_mikesell
On Mar 11, 3:03 am, Bob Martin <[EMAIL PROTECTED]> wrote: > in 337600 20080310 222850 [EMAIL PROTECTED] wrote: > > >On Mar 10, 2:21 pm, Bob Martin <[EMAIL PROTECTED]> wrote: > > >> Java is more portable than most other languages, especially if your app > >> needs a gui. > > >The promise of Java po

Re: for-else

2008-03-11 Thread NickC
On Mar 4, 11:27 pm, [EMAIL PROTECTED] wrote: > > The meaning is explicit. While "else" seems to mean little there. > So I may like something similar for Python 3.x (or the removal of the > "else"). Consider a loop with the following form: while 1: if : <0-to-many times code block> else:

Re: Why does my compiler say invalid syntax then highlight...?

2008-03-11 Thread Duncan Booth
Mensanator <[EMAIL PROTECTED]> wrote: > On Mar 10, 10:44‹¨«pm, Nathan Pinno <[EMAIL PROTECTED]> wrote: >> Why does my compiler say invalid syntax and then highlight the >> quotation marks in the following code: >> >> # This program is to find primes. > > Needs work. Be fair. The OP hadn't manage

Re: What c.l.py's opinions about Soft Exception?

2008-03-11 Thread Lie
On Mar 11, 2:18 am, "Diez B. Roggisch" <[EMAIL PROTECTED]> wrote: > > The problem with callbacks is that it works only for a small amount of > > callbacks, it'd be too messy to have twenty different callbacks. > > And the ultimate problem with callbacks is that we can't determine > > from the outsi

rmdir problem

2008-03-11 Thread royG
hi i am checking if a directory exists and if it does i want to delete it and its contents.then i want to create the directory before creating files in it. def myfolderops(): testdir='..\mytestdir' #if dir exist remove it if isdir(testdir): rmdir(testdir) #again create dire

Re: execute python script question

2008-03-11 Thread Piet van Oostrum
> Gabriel Rossetti <[EMAIL PROTECTED]> (GR) wrote: >GR> not a stupid question, I think that may be it. I tried setting PYTHONPATH >GR> like Sam suggested and it worked, but I was unable to do it programmically. >GR> I tried putting it in the __init__.py file like a web post suggested but it >G

Re: rmdir problem

2008-03-11 Thread Paul Hankin
On Mar 11, 10:35 am, royG <[EMAIL PROTECTED]> wrote: > i am checking if a directory exists and if it does i want to delete it > and its contents.then i want to create the directory before creating > files in it. Have a look at shutil.rmtree -- Paul Hankin -- http://mail.python.org/mailman/listin

Re: rmdir problem

2008-03-11 Thread Tim Golden
royG wrote: > hi > i am checking if a directory exists and if it does i want to delete it > and its contents.then i want to create the directory before creating > files in it. > > def myfolderops(): > testdir='..\mytestdir' > #if dir exist remove it > if isdir(testdir): > rmdir

Re: wxPython/wxWidgets ok for production use ? (was Re: Quality assurance in Python projects containing C modules)

2008-03-11 Thread Stef Mientki
Gilles Ganault wrote: > On Mon, 10 Mar 2008 11:27:06 -0400, "Malcolm Greene" > <[EMAIL PROTECTED]> wrote: >> Any suggestions on an alternative Python client-side GUI library (pyQT >> ?) or tips on where I can find out more about wxPython/wxWidget >> problems? > > One thing that bothers me is that

Re: wxPython/wxWidgets ok for production use ? (was Re: Quality assurance in Python projects containing C modules)

2008-03-11 Thread Gilles Ganault
On Mon, 10 Mar 2008 22:17:16 -0700 (PDT), Frank Millman <[EMAIL PROTECTED]> wrote: >I do not know if this helps, but here is an extract from a recent post >to the wxPython mailing list from Robin Dunn, the main developer of >wxPython - I'll take a look. Thanks for the info. -- http://mail.python.

Python PDF + Pictures

2008-03-11 Thread [EMAIL PROTECTED]
Hi, dear Python Masters! I wanna ask about the Python and PDF creating. I have many photos, and I wanna make some "presentation" from these photos, a "thumbnail" like document with one image per one page. If I wanna make one document now I do this: I execute a python script that create a html s

Re: rmdir problem

2008-03-11 Thread royG
On Mar 11, 3:37 pm, Paul > Have a look at shutil.rmtree > thanks Paul RG -- http://mail.python.org/mailman/listinfo/python-list

how to increase the system speed....to improve the proceesssor speed.....

2008-03-11 Thread online money
how to increase the system speedto improve the proceesssor speed. http://intelspentium.googlepages.com -- http://mail.python.org/mailman/listinfo/python-list

The stange behaviour of Tkinter.Canvas

2008-03-11 Thread James Yu
I tried to update the rectangle on a canvas to get the visual effect of progressbar. It works all right if I delete the existing objects (rectangle and text) and create a new one. However, if I invoke canvas.itemconfig() to update the existing objects' options, gui just went nuts. I am more than ha

MySQL DB-Api

2008-03-11 Thread Robert Rawlins
Good morning list. I'm in the process of learning my way around the DB-API module for MySQL and wanted to come and get some advice on how you all manage your database connections and cursors. Within my applications I'll have many classes which access the database, I'm wondering to what leve

Check For SELF Variable Existance

2008-03-11 Thread Robert Rawlins
Hello Guys, I want to be able to check if a class has a certain property in its 'self' scope, what's the best way to do this? I've seen a few examples of people using a try: block to test if the variable exists but to be honest, this seems a little bit verbose, do we not have a better method of

Re: Python PDF + Pictures

2008-03-11 Thread Bruno Desthuilliers
[EMAIL PROTECTED] a écrit : > Hi, dear Python Masters! > > I wanna ask about the Python and PDF creating. > > I have many photos, and I wanna make some "presentation" from these > photos, a "thumbnail" like document with one image per one page. > > If I wanna make one document now I do this: >

Re: Python PDF + Pictures

2008-03-11 Thread Stefan Behnel
[EMAIL PROTECTED] wrote: > I have many photos, and I wanna make some "presentation" from these > photos, a "thumbnail" like document with one image per one page. > > If I wanna make one document now I do this: > I execute a python script that create a html site with resized pictures, > and split t

Re: Python PDF + Pictures

2008-03-11 Thread [EMAIL PROTECTED]
Hi! Bruno Desthuilliers wrote: > [EMAIL PROTECTED] a écrit : >> Hi, dear Python Masters! >> >> I wanna ask about the Python and PDF creating. > Dont know if this will match your needs, but you may want to have a look > at pisa: > http://www.htmltopdf.org/ > With HTML I have only one problem. Th

Re: TextWrapper keepking line breaks?

2008-03-11 Thread js
Hi Arnaud, Great. Thanks for your help! On Tue, Mar 11, 2008 at 10:27 AM, Arnaud Delobelle <[EMAIL PROTECTED]> wrote: > > On Mar 10, 11:31 pm, js <[EMAIL PROTECTED]> wrote: > > Hi list, > > > > Can I make TextWrapper keep line breaks in the text? > > > > For example, > > > > >>> s = "spam\

RE: Obtaining the PyObject * of a class

2008-03-11 Thread Cooper, Andrew
Are there any Python C API experts/SWIG experts out there that can help me with this issue please. Andy -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Cooper, Andrew Sent: 10 March 2008 15:55 To: python-list@python.org Subject: Obtaining the PyObject * o

Re: Python Sockets Help

2008-03-11 Thread Mark M Manning
That's embarrassingly simple! Thank you very much!! On Mar 11, 4:03 am, [EMAIL PROTECTED] wrote: > On 10 Mar, 23:58, Mark M Manning <[EMAIL PROTECTED]> wrote: > > > > > I need your expertise with a sockets question. > > > Let me preface this by saying I don't have much experience with > > socke

Re: Check For SELF Variable Existance

2008-03-11 Thread Simon Brunning
On Tue, Mar 11, 2008 at 11:00 AM, Robert Rawlins <[EMAIL PROTECTED]> wrote: > I want to be able to check if a class has a certain property in its 'self' > scope, what's the best way to do this? >>> class Spam(object): ... def egg(self): ... if hasattr(self, 'chips'): print 'got chips!

Re: parsing directory for certain filetypes

2008-03-11 Thread jay graves
On Mar 11, 12:21 am, royG <[EMAIL PROTECTED]> wrote: > On Mar 10, 8:03 pm, Tim Chase wrote: > in the version using glob() > > >path = os.path.normpath(os.path.join(folder, '*.txt')) > >lst = glob.glob(path) > > is it possible to check for more than one file extension? here i will > have to create

SQLObject 0.10.0

2008-03-11 Thread Oleg Broytmann
Hello! I'm pleased to announce version 0.10.0, the first stable release of 0.10 branch of SQLObject. What is SQLObject = SQLObject is an object-relational mapper. Your database tables are described as classes, and rows are instances of those classes. SQLObject is meant to be e

RE: Check For SELF Variable Existance

2008-03-11 Thread Robert Rawlins
Thank you Simon, I was hoping there would be something as simple as that :-) Rob -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Simon Brunning Sent: 11 March 2008 13:21 To: python-list@python.org Subject: Re: Check For SELF Variable Existance On Tue, M

Re: parsing directory for certain filetypes

2008-03-11 Thread Tim Chase
royG wrote: > On Mar 10, 8:03 pm, Tim Chase wrote: > >> In Python2.5 (or 2.4 if you implement the any() function, ripped >> from the docs[1]), this could be rewritten to be a little more >> flexible...something like this (untested): >> > > that was quite a good lesson for a beginner like me.. >

RE: SQLObject 0.10.0

2008-03-11 Thread Robert Rawlins
Excellent stuff Oleg, I've been looking for an ORM framework for a while and hadn't settled on one, I'll give this a look through later today. Thanks, Robert -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Oleg Broytmann Sent: 11 March 2008 13:40 To: Pyt

difference b/t dictionary{} and anydbm - they seem the same

2008-03-11 Thread davidj411
anydbm and dictionary{} seem like they both have a single key and key value. Can't you put more information into a DBM file or link tables? I just don't see the benefit except for the persistent storage. d= dbm.open('c:\\temp\\mydb.dat','n') It has the following interface (key and data are string

Re: difference b/t dictionary{} and anydbm - they seem the same

2008-03-11 Thread Carsten Haese
On Tue, 2008-03-11 at 06:49 -0700, davidj411 wrote: > anydbm and dictionary{} seem like they both have a single key and key > value. > Can't you put more information into a DBM file or link tables? I just > don't see the benefit except for the persistent storage. Persistent storage /is/ the benefi

Re: difference b/t dictionary{} and anydbm - they seem the same

2008-03-11 Thread Robert Bossy
davidj411 wrote: > anydbm and dictionary{} seem like they both have a single key and key > value. > Can't you put more information into a DBM file or link tables? I just > don't see the benefit except for the persistent storage. Except for the persistent storage, that insignificant feature... ;) We

Re: How to factor using Python?

2008-03-11 Thread Mark Dickinson
On Mar 10, 7:32 pm, Nathan Pinno <[EMAIL PROTECTED]> wrote: > Thanks on the factoring bit, but I did mean factorial, not factoring. > How do I code that correctly, so that I can figure the following > equation out: cos(Pi * (z-1)! / z). Is z an integer in this expression? (Note: it's not an equat

how to theme/skin pyGtk apps

2008-03-11 Thread binaryj
hi again dear group. what i am interested in is giving my pygtk app some distinct look, a lil childish look coz the app is for children. so, i downloaded a couple of themes from http://art.gnome.org/themes/gtk2/ and for the past 1 hr i have been trying to theme my app but with no results. could

Re: How to factor using Python?

2008-03-11 Thread Joe Riopel
On Mon, Mar 10, 2008 at 1:08 AM, Nathan Pinno <[EMAIL PROTECTED]> wrote: > How do I factor a number? I mean how do I translate x! into proper > Python code, so that it will always do the correct math? This should work to do x! (factorial of x). reduce(lambda x,y: x*y, range(1, x+1)) -- http://m

Re: How to factor using Python?

2008-03-11 Thread Joe Riopel
On Tue, Mar 11, 2008 at 10:38 AM, Joe Riopel <[EMAIL PROTECTED]> wrote: > On Mon, Mar 10, 2008 at 1:08 AM, Nathan Pinno <[EMAIL PROTECTED]> wrote: > > How do I factor a number? I mean how do I translate x! into proper > > Python code, so that it will always do the correct math? > > This should

Re: How to factor using Python?

2008-03-11 Thread Mark Dickinson
On Mar 10, 7:32 pm, Nathan Pinno <[EMAIL PROTECTED]> wrote: > Thanks on the factoring bit, but I did mean factorial, not factoring. > How do I code that correctly, so that I can figure the following > equation out: cos(Pi * (z-1)! / z). Python returns a invalid syntax > error and highlight the !. S

Re: difference b/t dictionary{} and anydbm - they seem the same

2008-03-11 Thread davidj411
> Persistent storage /is/ the benefit. If you want to store relational > data, you should use a relational database. Thanks, that makes sense. Are there any local relational databases available to python that don't require a server backend? -- http://mail.python.org/mailman/listinfo/python-list

ZSI and attachments

2008-03-11 Thread Laszlo Nagy
Hi All, I wonder if the newest ZSI has support for attachments? Last time I checked (about a year ago) this feature was missing. I desperately need it. Alternatively, is there any other SOAP lib for python that can handle attachments? Thanks, Laszlo -- http://mail.python.org/mailman/l

Re: How to factor using Python?

2008-03-11 Thread Neal Becker
Nathan Pinno wrote: > How do I factor a number? I mean how do I translate x! into proper > Python code, so that it will always do the correct math? > > Thanks in advance, > Nathan P. import os os.system('factor 25') -- http://mail.python.org/mailman/listinfo/python-list

Re: difference b/t dictionary{} and anydbm - they seem the same

2008-03-11 Thread Joe Riopel
On Tue, Mar 11, 2008 at 10:58 AM, davidj411 <[EMAIL PROTECTED]> wrote: > Thanks, that makes sense. Are there any local relational databases > available to python that don't require a server backend? sqlite http://www.sqlite.org/ -- http://mail.python.org/mailman/listinfo/python-list

mulithreaded server

2008-03-11 Thread asit
import socket import sys import thread p=1 PORT=11000 BUFSIZE=1024 def getData(cSocket): global stdoutlock,cSocketlock while True: cSocketlock.acquire() data=cSocket.recv(BUFSIZE) if data=='q': data='client exited' cSocket.close()

Re: wxPython/wxWidgets ok for production use ?

2008-03-11 Thread Sion Arrowsmith
Stefan Behnel <[EMAIL PROTECTED]> wrote: >Just to make this sound a bit less like FUD: my last experience with wxPython >dates back a couple of years (2004/5?), but back then, we used BoaConstructor >in a project, which crashed a bit too often to do real work with it - and with >crashing I mean cr

urllib proxy support confusion

2008-03-11 Thread Grant Edwards
Reading through the doc at http://docs.python.org/lib/module-urllib.html, there are several paragraphs (including code examples) showing how you specify what proxies to use when calling urlopen(): Alternatively, the optional proxies argument may be used to explicitly specify proxies. [...]

Re: Python PDF + Pictures

2008-03-11 Thread jeffself
On Mar 11, 5:00 am, "[EMAIL PROTECTED]" <[EMAIL PROTECTED]> wrote: > Hi, dear Python Masters! > > I wanna ask about the Python and PDF creating. > > I have many photos, and I wanna make some "presentation" from these > photos, a "thumbnail" like document with one image per one page. > > If I wanna

Re: How to factor using Python?

2008-03-11 Thread Mike Hansen
If one wants to do serious math using Python, the best bet is to use Sage ( http://www.sagemath.org ). Here are some examples: sage: def f(x, bits=53): : R = RealField(bits); z = R(x) : return cos(R(pi) * factorial(z-1) / z) sage: f(100.00,bits=1000) 0.

Re: __iter__ yield

2008-03-11 Thread Lie
On Mar 10, 3:58 am, duccio <[EMAIL PROTECTED]> wrote: > Hello! > Someone knows if it's possible to make this __iter__ function with just > one 'yield' intead of two? > Is there some simpler way to make this __iter__ iter through all nodes? > Thanks! > > class Node: > def __init__(self, data=N

Re: urllib proxy support confusion

2008-03-11 Thread Mark Dickinson
On Mar 11, 11:35 am, Grant Edwards <[EMAIL PROTECTED]> wrote: > That seems a bit baffling.  If it urlopen doesn't support > specifying proxies, why are there examples showing how to do > it? If it does support specifying proxies, what is the pragraph > quoted above supposed to mean? Looks like a d

Re: wxPython/wxWidgets ok for production use ?

2008-03-11 Thread Stefan Behnel
Sion Arrowsmith wrote: > And before you blame wx* for crashes: what platform was this on? > Because my experience was that wx on GTK was significantly more prone > to glitches than on Windows (through to wxglade being unusably crashy) > -- if the underlying toolkit has problems, that's going to be

Re: mulithreaded server

2008-03-11 Thread Jean-Paul Calderone
On Tue, 11 Mar 2008 08:24:54 -0700 (PDT), asit <[EMAIL PROTECTED]> wrote: >import socket >import sys >import thread > >p=1 >PORT=11000 >BUFSIZE=1024 > >def getData(cSocket): >global stdoutlock,cSocketlock >while True: >cSocketlock.acquire() >data=cSocket.recv(BUFSIZE) >

Python Contract/Job Opportunity

2008-03-11 Thread Trevor Hennion
InfoCentrality are a small company who provided a custom Web/Database application for a customer in the Insurance industry. Our customer now wants a number of improvements to this application. To provide these improvements in a timely manner we need an additional programmer. 3 months contract

Re: wxPython/wxWidgets ok for production use ?

2008-03-11 Thread Chris Mellon
On Tue, Mar 11, 2008 at 11:01 AM, Stefan Behnel <[EMAIL PROTECTED]> wrote: > Sion Arrowsmith wrote: > > And before you blame wx* for crashes: what platform was this on? > > Because my experience was that wx on GTK was significantly more prone > > to glitches than on Windows (through to wxglade b

Re: urllib proxy support confusion

2008-03-11 Thread Grant Edwards
On 2008-03-11, Mark Dickinson <[EMAIL PROTECTED]> wrote: >> That seems a bit baffling.  If it urlopen doesn't support >> specifying proxies, why are there examples showing how to do >> it? If it does support specifying proxies, what is the >> pragraph quoted above supposed to mean? > > Looks like

Re: Regarding coding style

2008-03-11 Thread Lie
On Mar 10, 4:16 am, [EMAIL PROTECTED] wrote: > On Mar 9, 4:25 am, Lie <[EMAIL PROTECTED]> wrote: > > > On Mar 9, 3:27 am, [EMAIL PROTECTED] wrote: > > > > To Lie: > > > > > Personally I preferred a code that has chosen good names but have > > > > little or no comments compared to codes that makes b

Re: How to factor using Python?

2008-03-11 Thread Lie
On Mar 10, 12:08 pm, Nathan Pinno <[EMAIL PROTECTED]> wrote: > How do I factor a number? I mean how do I translate x! into proper > Python code, so that it will always do the correct math? > > Thanks in advance, > Nathan P. Factorial algorithm is a very simple and common algorithm, and it's one of

Exctract GIF comment from image

2008-03-11 Thread wingi
Hi, simple question: The PIL does not support reading the optional description in GIF Images. http://www.pythonware.com/library/pil/handbook/format-gif.htm After some reasearch I could not find a python solution for this, any suggestions? Thanx, Wingi. -- http://mail.python.org/mailman/listinf

Re: What c.l.py's opinions about Soft Exception?

2008-03-11 Thread Diez B. Roggisch
> If you passed an object that has several methods to call (using tuple > or list) and you want to handle several softexceptions and ignore some > others, you must still pass an empty methods to the one you want to > ignore, cluttering the caller's code by significant degree: > > def somefunc

Re: How to factor using Python?

2008-03-11 Thread Lie
On Mar 11, 11:47 pm, Lie <[EMAIL PROTECTED]> wrote: > On Mar 10, 12:08 pm, Nathan Pinno <[EMAIL PROTECTED]> wrote: > > > How do I factor a number? I mean how do I translate x! into proper > > Python code, so that it will always do the correct math? > > > Thanks in advance, > > Nathan P. > > Factori

Re: How to factor using Python?

2008-03-11 Thread Shane Geiger
def fact(x): if x == 1: return 1 # don't forget this else: return x * fact(x - 1) print fact(5) > Factorial algorithm is a very simple and common algorithm, and it's > one of the most basic of all recursive algorithm > def fact(x): > return x * fact(x - 1) > > That recursive functio

Re: Obtaining the PyObject * of a class

2008-03-11 Thread Terry Reedy
"Cooper, Andrew" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] | Are there any Python C API experts/SWIG experts out there that can help | me with this issue please. | I',m currently using SWIG to generate a python interface to a C DLL. Some people have switched to using ctypes for

How to make a Tkinter widget always visible?

2008-03-11 Thread Miki
Hello, I have a simple Tkinter window with [GO] and [Quit] buttons at the bottom. When I resize the window to be shorter, the first thing to disappear are the buttons, however I want these button to be visible at all times. Is there a way to make sure that these buttons are always visible? Than

Re: Check For SELF Variable Existance

2008-03-11 Thread Terry Reedy
"Robert Rawlins" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] | Thank you Simon, | | I was hoping there would be something as simple as that :-) | >>> class Spam(object): | ... def egg(self): | ... if hasattr(self, 'chips'): print 'got chips!' I strongly suggest that y

Re: Exctract GIF comment from image

2008-03-11 Thread Miki
Hello Wingi, > simple question: The PIL does not support reading the optional > description in GIF Images. > > http://www.pythonware.com/library/pil/handbook/format-gif.htm > > After some reasearch I could not find a python solution for this, any > suggestions? Use ImageMagick (www.imagemagick.org

Re: Exctract GIF comment from image

2008-03-11 Thread Guilherme Polo
2008/3/11, [EMAIL PROTECTED] <[EMAIL PROTECTED]>: > Hi, > > simple question: The PIL does not support reading the optional > description in GIF Images. > > http://www.pythonware.com/library/pil/handbook/format-gif.htm > > After some reasearch I could not find a python solution for this, any >

XML-SAX parser problem

2008-03-11 Thread hitesh thakkar
Hello, Can any one help for error in following code. actually i want to map parent element with child element, but i am unable to do so. here is the code which i am trying for please do reply if iam not on right track. import xml.sax.handler class BookHandler(xml.sax.handler.ContentHandler):

Re: What c.l.py's opinions about Soft Exception?

2008-03-11 Thread Steven D'Aprano
On Tue, 11 Mar 2008 03:14:54 -0700, Lie wrote: >> Regarding the number of callbacks: you can as well pass an object that >> has several methods to call. > > If you passed an object that has several methods to call (using tuple or > list) and you want to handle several softexceptions and ignore so

Re: How to make a Tkinter widget always visible?

2008-03-11 Thread Kevin Walzer
Miki wrote: > Hello, > > I have a simple Tkinter window with [GO] and [Quit] buttons at the > bottom. > > When I resize the window to be shorter, the first thing to disappear > are the buttons, however I want these button to be visible at all > times. > > Is there a way to make sure that these b

Re: Time Zone application after strptime?

2008-03-11 Thread Jim Carroll
M.-A. Lemburg egenix.com> writes: > > On 2008-03-07 22:24, Jim Carroll wrote: > > It's taken me a couple of hours to give up on strptime > > with %Z for recognizing > > time zones... but that still leaves me in the wrong zone: > > > > How can I use the "PST" (or any other time zone name) > >

Re: What c.l.py's opinions about Soft Exception?

2008-03-11 Thread Steven D'Aprano
On Mon, 10 Mar 2008 12:14:40 -0700, [EMAIL PROTECTED] wrote: > Common Lisp has two ways of raising: functions "error" and "signal". > Python's "raise" is like CL's "error": you end up in the debugger if the > exception is not handled. Exceptions that are raised by CL's "signal" > don't have to be

help regarding xml parser modules

2008-03-11 Thread Vinay Aiya
Hello, Can any one help for error in following code. actually i want to map the element name with its data between start and end tag , but i am unable to do so. here is the code which i am trying for please do reply if i am not on right track. import xml.sax.handler class BookHandler(xml.sax.ha

Re: Obtaining the PyObject * of a class

2008-03-11 Thread Chris Mellon
On Tue, Mar 11, 2008 at 12:13 PM, Terry Reedy <[EMAIL PROTECTED]> wrote: > > "Cooper, Andrew" <[EMAIL PROTECTED]> wrote in message > news:[EMAIL PROTECTED] > > | Are there any Python C API experts/SWIG experts out there that can help > | me with this issue please. > > | I',m currently using SWIG

Re: Obtaining the PyObject * of a class

2008-03-11 Thread Michael Wieher
2 things: 1st. there is a python mailing list for people interested in C++ extension type stuff 2nd. SWIG is useless and overly complicated, its much easier to just generate your own C++ code by hand, less confusion, and much more clarity. I find no value in using anything else. People complain ab

Re: How to make a Tkinter widget always visible?

2008-03-11 Thread Miki
Hello Kevin, > > Is there a way to make sure that these buttons are always visible? > > There are various ways to do this: you can set the window to be > non-resizable, or set a minimum size to it, so that it can't be resized > below that level. However, if you allow arbitrary resizing of the > wi

Re: How to make a Tkinter widget always visible?

2008-03-11 Thread Kevin Walzer
Miki wrote: > Hello Kevin, > >>> Is there a way to make sure that these buttons are always visible? >> There are various ways to do this: you can set the window to be >> non-resizable, or set a minimum size to it, so that it can't be resized >> below that level. However, if you allow arbitrary res

Re: Why does my compiler say invalid syntax then highlight...?

2008-03-11 Thread Mensanator
On Mar 11, 3:36 am, Duncan Booth <[EMAIL PROTECTED]> wrote: > Mensanator <[EMAIL PROTECTED]> wrote: > > On Mar 10, 10:44‹¨«pm, Nathan Pinno <[EMAIL PROTECTED]> wrote: > >> Why does my compiler say invalid syntax and then highlight the > >> quotation marks in the following code: > > >> # This progra

Re: mulithreaded server

2008-03-11 Thread asit
On Mar 11, 9:10 pm, Jean-Paul Calderone <[EMAIL PROTECTED]> wrote: > On Tue, 11 Mar 2008 08:24:54 -0700 (PDT), asit <[EMAIL PROTECTED]> wrote: > >import socket > >import sys > >import thread > > >p=1 > >PORT=11000 > >BUFSIZE=1024 > > >def getData(cSocket): > >global stdoutlock,cSocketlock > >

Re: What c.l.py's opinions about Soft Exception?

2008-03-11 Thread Lie
(If there is anything weird that I say, please ignore it since I'm writing this half-sleeping) On Mar 12, 12:00 am, "Diez B. Roggisch" <[EMAIL PROTECTED]> wrote: (snip) > I totally fail to see where > > raise Equal(a, b) > > is less cluttered or not than > > callback(a, b) > > Actually, the latte

Re: mulithreaded server

2008-03-11 Thread Aahz
In article <[EMAIL PROTECTED]>, asit <[EMAIL PROTECTED]> wrote: >On Mar 11, 9:10 pm, Jean-Paul Calderone <[EMAIL PROTECTED]> wrote: >> On Tue, 11 Mar 2008 08:24:54 -0700 (PDT), asit <[EMAIL PROTECTED]> wrote: >>> >>>In the above program, why there is an unhandeled exception ??? >> >> Just a guess.

Re: Regarding coding style

2008-03-11 Thread castironpi
On Mar 11, 11:31 am, Lie <[EMAIL PROTECTED]> wrote: > On Mar 10, 4:16 am, [EMAIL PROTECTED] wrote: > > > > > > > On Mar 9, 4:25 am, Lie <[EMAIL PROTECTED]> wrote: > > > > On Mar 9, 3:27 am, [EMAIL PROTECTED] wrote: > > > > > To Lie: > > > > > > Personally I preferred a code that has chosen good nam

Re: mulithreaded server

2008-03-11 Thread castironpi
> > >In the above program, why there is an unhandeled exception ??? > > > Just a guess. You should really include the traceback when you ask a > > question like this. > > It's not a traceback error. It's an unhandeled exception. Have a look at this: http://groups.google.com/group/comp.lang.python

Re: How to factor using Python?

2008-03-11 Thread Mensanator
On Mar 11, 10:57 am, Mike Hansen <[EMAIL PROTECTED]> wrote: > If one wants to do serious math using Python, the best bet is to use > Sage (http://www.sagemath.org).  Here are some examples: > > sage: def f(x, bits=53): > :     R = RealField(bits); z = R(x) > :     return cos(R(pi) * factori

Re: urllib proxy support confusion

2008-03-11 Thread Mark Dickinson
On Mar 11, 12:26 pm, Grant Edwards <[EMAIL PROTECTED]> wrote: > Before I submit a bug, I'll give it a try to find out if it > does support explicit specification of proxys or not. Sounds good. If it does, then I think the whole paragraph (from "The urlopeen() function does not support explicit pr

[ANN] Python 2.3.7 and 2.4.5 (final)

2008-03-11 Thread Martin v. Löwis
On behalf of the Python development team and the Python community, I'm happy to announce the release of Python 2.4.5 and 2.3.7 (final). Both releases include only security fixes. Python 2.5 is the latest version of Python, we're making this release for people who are still running Python 2.3 or 2.

Re: Problem with zipfile and newlines

2008-03-11 Thread neilcrighton
Sorry my initial post was muddled. Let me try again. I've got a zipped archive that I can extract files from with my standard archive unzipping program, 7-zip. I'd like to extract the files in python via the zipfile module. However, when I extract the file from the archive with ZipFile.read(), it

RE: Obtaining the PyObject * of a class

2008-03-11 Thread Bronner, Gregory
I'd strongly disagree. SWIG is very useful for wrapping large scale projects in a non-interfering manner. If you have to generate bindings for 1000+ classes, it is by far the easiest way to do things. It isn't clear what you are doing that requires the PyObject*, or which one you'd like. In g

Re: any library for SOAP 1.1 or SOAP 1.2?

2008-03-11 Thread Paul Watson
On Fri, 2008-01-25 at 16:52 +0530, Amogh Hooshdar wrote: > Hi, > > I wish to know which python library is popular for SOAP related > programming, especially for sending SOAP requests and parsing SOAP > responses. > > I can't find any such library in the Python standard library but I > could find

SOAP access to SharePoint

2008-03-11 Thread Paul Watson
Has anyone successfully accessed a Microsoft SharePoint WSS using Python? No, not IronPython. I need for this to be able to run on all machines the customer might choose. Which libs are you using? ZSI, SOAPpy, soaplib, ??? http://wiki.python.org/moin/WebServices -- http://mail.python.org/mai

Re: Problem with zipfile and newlines

2008-03-11 Thread neilcrighton
I think I've worked it out after reading the 'Binary mode for files' section of http://zephyrfalcon.org/labs/python_pitfalls.html zipfile extracts as file as a binary series of characters, and I'm writing out this binary file as a text file with open('foo','w'). Normally Python converts a '\n' in

Re: python interactive - threaded console (run -i)

2008-03-11 Thread castironpi
>         self._doneevents= {} is extraneous. > id, fun, ar, kw= self.get() done, fun, ar, kw= self.get() suffices. > def _draintilclose( conn, understandfun= None ): >         if None is not understandfun: >             understandfun( _curmsg ) yield _curmsg is an interesti

Re: difference b/t dictionary{} and anydbm - they seem the same

2008-03-11 Thread castironpi
> >  Thanks, that makes sense. Are there any local relational databases > >  available to python that don't require a server backend? > > sqlite > http://www.sqlite.org/ Are there any that aren't persistent? -- http://mail.python.org/mailman/listinfo/python-list

How to import a module that must override a standard one

2008-03-11 Thread ilochab
I'm writing a python package that will contain a logging service for twisted in python style. I'm using some modules I downloaded from a twisted trunk, that are not released with twisted but have the same names. One of them is log.py that is usually imported from twisted modules like: from twis

  1   2   >