failed to install PIL in fedora core 6

2007-02-23 Thread Frank Potter
I use "python setup.py install" to install PIL in fedora with python 2.4, But I got these errors: running build_ext building '_imaging' extension creating build/temp.linux-i686-2.4 creating build/temp.linux-i686-2.4/libImaging gcc -pthread -fno-strict-aliasing -DNDEBUG -O2 -g -pipe -Wall -Wp,- D_FO

Re: Rational numbers

2007-02-23 Thread Martin Manns
On 23 Feb 2007 22:19:30 -0800 [EMAIL PROTECTED] wrote: > > Looks pretty much the same as mx.Number > > > > Does this warning come up from gmp? Do I have to compile it with > > different flags? > > Or do both wrappers use the same code? > > > > I would like to encourage the python community (i.e. t

Re: Rational numbers

2007-02-23 Thread casevh
> Looks pretty much the same as mx.Number > > Does this warning come up from gmp? Do I have to compile it with > different flags? > Or do both wrappers use the same code? > > I would like to encourage the python community (i.e. the guys > maintaining the python docs) to point out a recommended rati

Re: Parsing HTML

2007-02-23 Thread John Nagle
BeautifulSoup does parse HTML well, but there are a few issues: 1. It's rather slow; it can take seconds of CPU time to parse some larger web pages. 2. There's no error reporting. It tries to do the right thing, but when it doesn't, you have no idea what went wrong. BeautifulSoup

Re: Finding non ascii characters in a set of files

2007-02-23 Thread Scott David Daniels
[EMAIL PROTECTED] wrote: > I'm updating my program to Python 2.5, but I keep running into > encoding problems. I have no ecodings defined at the start of any of > my scripts. What I'd like to do is scan a directory and list all the > files in it that contain a non ascii character. How would I go ab

Re: Solved: Question about idiomatic use of _ and private stuff.

2007-02-23 Thread goodwolf
> If you say > > from foo import _fooa, _foob, > > then the import will fail because the _ is used only by the import to > decide that you shouldn't see _fooa or _foob. ??? Read Python manuals, please. -- http://mail.python.org/mailman/listinfo/python-list

Re: Solved: Question about idiomatic use of _ and private stuff.

2007-02-23 Thread Steven D'Aprano
On Fri, 23 Feb 2007 23:17:32 -0500, Steven W. Orr wrote: > On Friday, Feb 23rd 2007 at 11:12 -0500, quoth Steven W. Orr: > > =>I understand that two leading underscores in a class attribute make the > =>attribute private. But I often see things that are coded up with one > =>underscore. Unless

Re: Rational numbers

2007-02-23 Thread Martin Manns
On Fri, 23 Feb 2007 20:20:12 -0300 "Gabriel Genellina" <[EMAIL PROTECTED]> wrote: > En Fri, 23 Feb 2007 12:35:19 -0300, Martin Manns <[EMAIL PROTECTED]> > escribió: > > > I am starting to use rationals and since I found no batteries > > included, I tried out the mxNumber package. > > > > However,

Solved: Question about idiomatic use of _ and private stuff.

2007-02-23 Thread Steven W. Orr
On Friday, Feb 23rd 2007 at 11:12 -0500, quoth Steven W. Orr: =>I understand that two leading underscores in a class attribute make the =>attribute private. But I often see things that are coded up with one =>underscore. Unless I'm missing something, there's a idiom going on here. => =>Why do pe

Re: Possible to set cpython heap size?

2007-02-23 Thread Tony Nelson
In article <[EMAIL PROTECTED]>, "Andy Watson" <[EMAIL PROTECTED]> wrote: ... > If I could have a heap that is larger and does not need to be > dynamically extended, then the Python GC could work more efficiently. ... GC! If you're allocating lots of objects and holding on to them, GC will ru

Re: How to build Hierarchies of dict's? (Prototypes in Python?)

2007-02-23 Thread Gabriel Genellina
At Friday 23/2/2007 22:12, Charles D Hixson wrote: > This is going to take a bit of work (I've gone over the example 5 times, > and it's still not quite making > sense), but this looks like just what I was hoping to find. Just remember that: obj.name = value is the same as: setattr(obj, "name"

Re: Parsing HTML

2007-02-23 Thread sofeng
On Feb 8, 11:43 am, "metaperl" <[EMAIL PROTECTED]> wrote: > On Feb 8, 2:38 pm, "mtuller" <[EMAIL PROTECTED]> wrote: > > > I am trying to parse a webpage and extract information. > > BeautifulSoup is a great Python module for this purpose: > >http://www.crummy.com/software/BeautifulSoup/ > > Her

Re: Regex Speed

2007-02-23 Thread John Machin
On Feb 24, 11:51 am, greg <[EMAIL PROTECTED]> wrote: > [EMAIL PROTECTED] wrote: > > the author of this citation states that > > any regex can be expressed as a DFA machine. However ... > > > I appear to have found one example of a regex > > > which breaks this assumption. > > > "ab+c|abd" > > > A

Re: Regex Speed

2007-02-23 Thread John Machin
On Feb 24, 10:15 am, [EMAIL PROTECTED] wrote: > On Feb 21, 10:34 am, [EMAIL PROTECTED] wrote: > > > On Feb 20, 6:14 pm, Pop User <[EMAIL PROTECTED]> wrote: > > >http://swtch.com/~rsc/regexp/regexp1.html > > Going back a bit on a tangent, the author of this citation states that > any regex can be ex

Re: Regex Speed

2007-02-23 Thread greg
[EMAIL PROTECTED] wrote: > the author of this citation states that > any regex can be expressed as a DFA machine. However ... > I appear to have found one example of a regex > which breaks this assumption. > > "ab+c|abd" > > Am I correct? No. Any NFA can be converted to an equivalent DFA. This

Re: How to build Hierarchies of dict's? (Prototypes in Python?)

2007-02-23 Thread Charles D Hixson
Larry Bates wrote: > Charles D Hixson wrote: > >> I'm sure I've read before about how to construct prototypes in Python, >> but I haven't been able to track it down (or figure it out). >> >> What I basically want is a kind of class that has both class and >> instance level dict variables, such t

Re: How to build Hierarchies of dict's? (Prototypes in Python?)

2007-02-23 Thread Charles D Hixson
Gabriel Genellina wrote: >> En Fri, 23 Feb 2007 17:53:59 -0300, Charles D Hixson >> <[EMAIL PROTECTED]> escribió: >> >> >>> I'm sure I've read before about how to construct prototypes in Python, >>> but I haven't been able to track it down (or figure it out). >>> >>> What I basically want is a

Re: Rational numbers

2007-02-23 Thread aleaxit
On Feb 23, 3:44 pm, [EMAIL PROTECTED] wrote: ... > I can keep building gmpy for Windows. I actually use MINGW since > getting GMP compiled under MSVC is "challanging". I should be able to > build new binaries for Windows this weekend. And I would be happy to > point everyone to a real release.

Re: Shed Skin Optimizing Python-to-C++ Compiler 0.0.19

2007-02-23 Thread Michael
I randomly scribbled : > Mark Dufour wrote: > >> This >> latest release adds basic support for iterators and generators > > Oooh, I may try our miniaxon tutorial against shed skin in that case. > (ie http://kamaelia.sourceforge.net/MiniAxon/) I thought some people may be interested to hear that

Re: Question about idiomatic use of _ and private stuff.

2007-02-23 Thread goodwolf
On Feb 23, 5:12 pm, "Steven W. Orr" <[EMAIL PROTECTED]> wrote: > I understand that two leading underscores in a class attribute make the > attribute private. But I often see things that are coded up with one > underscore. Unless I'm missing something, there's a idiom going on here. > > Why do peopl

Re: Pep 3105: the end of print?

2007-02-23 Thread Aahz
In article <[EMAIL PROTECTED]>, Jay Tee <[EMAIL PROTECTED]> wrote: > >On the other hand, C++ is firmly established as a "serious" language >in our community while python is not. So the programmers tend to be >more forgiving. There is no perception that compiler developers are >*trying* to be diff

Re: Question about idiomatic use of _ and private stuff.

2007-02-23 Thread Gabriel Genellina
En Fri, 23 Feb 2007 13:12:20 -0300, Steven W. Orr <[EMAIL PROTECTED]> escribió: > I understand that two leading underscores in a class attribute make the > attribute private. But I often see things that are coded up with one > underscore. Unless I'm missing something, there's a idiom going on he

Re: Possible to set cpython heap size?

2007-02-23 Thread Andrew MacIntyre
Chris Mellon wrote: > On 22 Feb 2007 11:28:52 -0800, Andy Watson <[EMAIL PROTECTED]> wrote: >> On Feb 22, 10:53 am, a bunch of folks wrote: >> >>> Memory is basically free. >> This is true if you are simply scanning a file into memory. However, >> I'm storing the contents in some in-memory data st

Re: Having multiple instances of a single application start a single instance of another one

2007-02-23 Thread Larry Bates
buffinator wrote: > I have two applications that should work together, let's call them A and B. > > The first time A starts, it should open a B process and start > communicating with it. All other times an A instance starts it should > simply talk with the B that already is open. > > The problem

Re: How to build Hierarchies of dict's? (Prototypes in Python?)

2007-02-23 Thread Gabriel Genellina
En Fri, 23 Feb 2007 17:53:59 -0300, Charles D Hixson <[EMAIL PROTECTED]> escribió: > I'm sure I've read before about how to construct prototypes in Python, > but I haven't been able to track it down (or figure it out). > > What I basically want is a kind of class that has both class and > instan

Re: Rational numbers

2007-02-23 Thread casevh
On Feb 23, 3:27 pm, [EMAIL PROTECTED] wrote: > On Feb 23, 12:00 pm, [EMAIL PROTECTED] wrote: >... > > > > > + gmpy is looking pretty unmaintained (dead) to me (newest update of > > > > cvs 10 months ago). > > > I worked withAlex Martelli(gmpy's maintainer) to fix a bug found by > > mensanator.

Re: How to build Hierarchies of dict's? (Prototypes in Python?)

2007-02-23 Thread Larry Bates
Charles D Hixson wrote: > I'm sure I've read before about how to construct prototypes in Python, > but I haven't been able to track it down (or figure it out). > > What I basically want is a kind of class that has both class and > instance level dict variables, such that descendant classes > autom

Re: Having multiple instances of a single application start a single instance of another one

2007-02-23 Thread Jerry Hill
On 2/23/07, buffinator <[EMAIL PROTECTED]> wrote: > 2. How do I check if a process ID is bound to a running application. Under windows, this should work: >>> import win32process >>> running_pids = win32process.EnumProcesses() >>> running_pids (0, 4, 1048, 1496, 1656, 1836, 1896, 756, 988, 1712, 22

Re: Rational numbers

2007-02-23 Thread aleaxit
On Feb 23, 2:52 pm, [EMAIL PROTECTED] wrote: > > Am I hallucinating? Didn't I see at least some version > > of gmpy for Python 2.5 on SourceForge awhile back? > > I distinctly remember thinking that I don't have to > > direct people to your site, but SourceForge is not > > showing anything beyond v

Re: Rational numbers

2007-02-23 Thread aleaxit
On Feb 23, 12:00 pm, [EMAIL PROTECTED] wrote: ... > > > + gmpy is looking pretty unmaintained (dead) to me (newest update of > > > cvs 10 months ago). > > I worked withAlex Martelli(gmpy's maintainer) to fix a bug found by > mensanator. With Alex's permission, I released it as gmpy 1.04a. Alex >

Re: Rational numbers

2007-02-23 Thread Gabriel Genellina
En Fri, 23 Feb 2007 12:35:19 -0300, Martin Manns <[EMAIL PROTECTED]> escribió: > I am starting to use rationals and since I found no batteries included, > I tried out the mxNumber package. > > However, I get strange warnings on comparison operations > (which however seem to yield correct results):

Re: Regex Speed

2007-02-23 Thread garrickp
On Feb 21, 10:34 am, [EMAIL PROTECTED] wrote: > On Feb 20, 6:14 pm, Pop User <[EMAIL PROTECTED]> wrote: > >http://swtch.com/~rsc/regexp/regexp1.html Going back a bit on a tangent, the author of this citation states that any regex can be expressed as a DFA machine. However, while investigating thi

Re: Having multiple instances of a single application start a single instance of another one

2007-02-23 Thread Troy Melhase
> Three very simple questions then. > > 1. How do I find out a running applications process ID import os mypid = os.getpid() > 2. How do I check if a process ID is bound to a running application. this is os-specific. i'm sure there's a windows api provided for it. > 3. There won't be any issue

Re: Rational numbers

2007-02-23 Thread casevh
> Am I hallucinating? Didn't I see at least some version > of gmpy for Python 2.5 on SourceForge awhile back? > I distinctly remember thinking that I don't have to > direct people to your site, but SourceForge is not > showing anything beyond vesion 1.01 for Python 2.4. Alex released versions 1.0

Re: ANN: IbPy 0.7.0-9.00 - Interactive Brokers Python API

2007-02-23 Thread Troy Melhase
On 23 Feb 2007 14:36:24 -0800, vj <[EMAIL PROTECTED]> wrote: > Cool. Why is python 2.5 required, will it not work with python 2.4? Short answer: because java2python produces python 2.5 syntax. Long answer: I wrote java2python specifically to translate the IB reference code. That reference code

Re: Having multiple instances of a single application start a single instance of another one

2007-02-23 Thread buffinator
Troy Melhase wrote: >> The first time A starts, it should open a B process and start >> communicating with it. All other times an A instance starts it should >> simply talk with the B that already is open. > > B should write its process id to a location known by both > applications. When A starts

Re: Question about idiomatic use of _ and private stuff.

2007-02-23 Thread Chris Mellon
On 2/23/07, James Stroud <[EMAIL PROTECTED]> wrote: > Troy Melhase wrote: > >> Why do people sometimes use one leading underscore? > > > > > > Many folks like to use the single leading underscore to emphasize that > > the attribute isn't part of the normal way to use the class or > > instance. > >

Re: ANN: IbPy 0.7.0-9.00 - Interactive Brokers Python API

2007-02-23 Thread vj
Cool. Why is python 2.5 required, will it not work with python 2.4? VJ -- http://mail.python.org/mailman/listinfo/python-list

Re: Having multiple instances of a single application start a single instance of another one

2007-02-23 Thread Troy Melhase
> The first time A starts, it should open a B process and start > communicating with it. All other times an A instance starts it should > simply talk with the B that already is open. B should write its process id to a location known by both applications. When A starts, it should read that PID fro

Re: Question about idiomatic use of _ and private stuff.

2007-02-23 Thread James Stroud
Troy Melhase wrote: >> Why do people sometimes use one leading underscore? > > > Many folks like to use the single leading underscore to emphasize that > the attribute isn't part of the normal way to use the class or > instance. > > It's bad style in my opinion, but I'm probably in the minority.

Re: Rational numbers

2007-02-23 Thread [EMAIL PROTECTED]
On Feb 23, 2:00 pm, [EMAIL PROTECTED] wrote: > On Feb 23, 10:34 am, "[EMAIL PROTECTED]" <[EMAIL PROTECTED]> wrote: > > > > > > > On Feb 23, 10:39 am, Martin Manns <[EMAIL PROTECTED]> wrote: > > > > On Fri, 23 Feb 2007 09:52:06 -0600 > > > > Larry Bates <[EMAIL PROTECTED]> wrote: > > > > I quick sea

Having multiple instances of a single application start a single instance of another one

2007-02-23 Thread buffinator
I have two applications that should work together, let's call them A and B. The first time A starts, it should open a B process and start communicating with it. All other times an A instance starts it should simply talk with the B that already is open. The problem here is, if I start say 40 A a

Re: Found a product for running Python-based websites off CDROM -have anybody tried it?

2007-02-23 Thread Paul Boddie
David Wishnie wrote: > > We've looked at XAMPP, and it has the following disadvantages compared > to Stunnix: I've only read the Stunnix Web site, and I've only seen XAMPP in passing. However... > * it's not targeted for putting to CDs at all (it's "unzip and run apache and >stuff"type of

Re: timeout in urllib.open()

2007-02-23 Thread John J. Lee
Paul Rubin writes: > Stefan Palme <[EMAIL PROTECTED]> writes: > > is there a way to modify the time a call of > > > > urllib.open(...) > > > > waits for an answer from the other side? Have a tool which > > automatically checks a list of websites for certain content.

Re: timeout in urllib.open()

2007-02-23 Thread John J. Lee
Steve Holden <[EMAIL PROTECTED]> writes: [...] > This has recently been discussed on python-dev. It's likely that > certain libraries will acquire a timeout keyword argument in the next > release, but only if someone is concerned enough to develop the > appropriate patches - the principle appears t

Re: Question about idiomatic use of _ and private stuff.

2007-02-23 Thread Troy Melhase
> Why do people sometimes use one leading underscore? Many folks like to use the single leading underscore to emphasize that the attribute isn't part of the normal way to use the class or instance. It's bad style in my opinion, but I'm probably in the minority. -- http://mail.python.org/mailman/

Question about idiomatic use of _ and private stuff.

2007-02-23 Thread Steven W. Orr
I understand that two leading underscores in a class attribute make the attribute private. But I often see things that are coded up with one underscore. Unless I'm missing something, there's a idiom going on here. Why do people sometimes use one leading underscore? TIA -- Time flies like the

Re: BDFL in wikipedia

2007-02-23 Thread John J. Lee
Robin Becker <[EMAIL PROTECTED]> writes: > Carl Banks wrote: > .. > > Since when is Larry Wall benevolent? He should be called the SDFL. > > > . > > even the great leader has been referred to as the MDFL :) [...] By you?-) John -- http://mail.python.org/mailman/listinfo/python-list

Re: Looking for contract developer(s) - where can I find them?

2007-02-23 Thread John J. Lee
[EMAIL PROTECTED] writes: > On Feb 21, 9:51 pm, Scott SA <[EMAIL PROTECTED]> wrote: > > > > I've just sent a job listing to python.org and posted this message on > > comp.lang.python, > > Interesting, so Python-list@python.org and comp.lang.python are > _related_. I guess that means I'm the new g

How to build Hierarchies of dict's? (Prototypes in Python?)

2007-02-23 Thread Charles D Hixson
I'm sure I've read before about how to construct prototypes in Python, but I haven't been able to track it down (or figure it out). What I basically want is a kind of class that has both class and instance level dict variables, such that descendant classes automatically create their own class a

Re: Who has not attended these free tutorial courses ?

2007-02-23 Thread kilian heckrodt
[EMAIL PROTECTED] wrote: Please note that this is a math newsgroup and not a i-post-my-favoured-conspiracy-theory newsgroup > "President Bush ... you are under arrest" - 911 truth video by Dr > Morgan Reynolds, Former Chief Economist under Bush > > You can also save them by right clicking the >

Re: Rational numbers

2007-02-23 Thread Martin Manns
On 23 Feb 2007 12:00:10 -0800 [EMAIL PROTECTED] wrote: > > I worked with Alex Martelli (gmpy's maintainer) to fix a bug found by > mensanator. With Alex's permission, I released it as gmpy 1.04a. Alex > has not updated cvs with the fix. > > gmpy 1.04a compiles cleanly with the latest releases of

Re: Finding non ascii characters in a set of files

2007-02-23 Thread Tim Arnold
"Marc 'BlackJack' Rintsch" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > In <[EMAIL PROTECTED]>, Tim Arnold wrote: > >> Here's what I do (I need to know the line number). >> >> import os,sys,codecs >> def checkfile(filename): >> f = codecs.open(filename,encoding='ascii') >> >>

Re: Found a product for running Python-based websites off CDROM -have anybody tried it?

2007-02-23 Thread David Wishnie
Hello, Thank you for your input! We've looked at XAMPP, and it has the following disadvantages compared to Stunnix: * it's not targeted for putting to CDs at all (it's "unzip and run apache and stuff"type of thing). This means it probably can't autochoose port numbers for mysql and htt

Re: Finding non ascii characters in a set of files

2007-02-23 Thread Martin v. Löwis
Tim Arnold schrieb: > That looks much cleaner. I didn't know the 'num' from the enumerate would > persist so the except block could report it. It's indeed guaranteed that the for loop index variables will keep the value they had when the loop stopped (either through regular termination, break, or

Re: Rational numbers

2007-02-23 Thread casevh
On Feb 23, 10:34 am, "[EMAIL PROTECTED]" <[EMAIL PROTECTED]> wrote: > On Feb 23, 10:39 am, Martin Manns <[EMAIL PROTECTED]> wrote: > > > On Fri, 23 Feb 2007 09:52:06 -0600 > > > Larry Bates <[EMAIL PROTECTED]> wrote: > > > I quick search of Google turned up: > > > >http://books.google.com/books?id=

Re: With PIL... paste image on top of other with dropshadow

2007-02-23 Thread Matimus
two things, change the following line: [code] back = Image.new(image.mode, (totalWidth, totalHeight), background) [/code] To: [code] back = Image.new("RGBA", (totalWidth, totalHeight), background) [/code] and then do something like this: [code] import sys bg = Image.open(sys.argv[1]) i

Re: What is the best queue implemetation in Python?

2007-02-23 Thread sunheaver
On Feb 22, 12:40 pm, hg <[EMAIL PROTECTED]> wrote: > John Machin wrote: > > On Feb 23, 11:12 am, "John" <[EMAIL PROTECTED]> wrote: > >> I want to write a code for Breadth First Traveral for Graph, which needs > >> a queue to implement. > > >> I wonder that for such a powerful language as Python, wh

Who has not attended these free tutorial courses ?

2007-02-23 Thread stj911
"President Bush ... you are under arrest" - 911 truth video by Dr Morgan Reynolds, Former Chief Economist under Bush You can also save them by right clicking the links and saving them as flv files and download a free flv player. google is your best friend. "Bush Administration Insider Says U.S. G

Re: Finding non ascii characters in a set of files

2007-02-23 Thread Tim Arnold
"Marc 'BlackJack' Rintsch" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > In <[EMAIL PROTECTED]>, Tim Arnold wrote: > > Untested: > > import os, sys, codecs > > def checkfile(filename): >f = codecs.open(filename,encoding='ascii') > >try: >for num, line in enu

Re: Finding non ascii characters in a set of files

2007-02-23 Thread Marc 'BlackJack' Rintsch
In <[EMAIL PROTECTED]>, Tim Arnold wrote: > Here's what I do (I need to know the line number). > > import os,sys,codecs > def checkfile(filename): > f = codecs.open(filename,encoding='ascii') > > lines = open(filename).readlines() > print 'Total lines: %d' % len(lines) > for i in

Re: Rational numbers

2007-02-23 Thread Marc 'BlackJack' Rintsch
In <[EMAIL PROTECTED]>, Martin Manns wrote: > + gmpy is looking pretty unmaintained (dead) to me (newest update of > cvs 10 months ago). What CSV activities do you expect? This package seems to be pretty stable. As long as there is no bug or incompatible changes in the underlying library I woul

Re: Rational numbers

2007-02-23 Thread [EMAIL PROTECTED]
On Feb 23, 10:39 am, Martin Manns <[EMAIL PROTECTED]> wrote: > On Fri, 23 Feb 2007 09:52:06 -0600 > > Larry Bates <[EMAIL PROTECTED]> wrote: > > I quick search of Google turned up: > > >http://books.google.com/books?id=1Shx_VXS6ioC&pg=PA625&lpg=PA625&dq=p... > >http://calcrpnpy.sourceforge.net/clnu

Re: Rational numbers

2007-02-23 Thread bearophileHUGS
Martin Manns: > + gmpy is looking pretty unmaintained (dead) to me (newest update of > cvs 10 months ago). I have used it on Py2.5, so it seems to work anyway, and it's fast enough for my purposes. And probably soon some alex-shaped life will show up elsewhere. Bye, bearophile -- http://mail.py

Re: CSV(???)

2007-02-23 Thread Neil Cerutti
On 2007-02-23, David C Ullrich <[EMAIL PROTECTED]> wrote: > Is there a csvlib out there somewhere? > > And/or does anyone see any problems with > the code below? > > What csvline does is straightforward: fields > is a list of strings. csvline(fields) returns > the strings concatenated into one str

Re: Local class variables? (mod_python problem)

2007-02-23 Thread Diez B. Roggisch
> > Many thanks for your reply. The use case is per request, and I would be > grateful to learn more about thread-local storage. There are several ways. I'm not familiar with mod_python, but I guess you get a dict-like object for the request parameters. In python, this is usually writable (in con

Re: Rational numbers / alternatives to mxNumber

2007-02-23 Thread Martin Manns
On Fri, 23 Feb 2007 11:39:11 -0500 Martin Manns <[EMAIL PROTECTED]> wrote: > + boost indeed is a quite nice C++ library. However, I fear that I > would end up writing the python wrappers for operators (+ - * / min > max cmp etc.) myself. I would like to avoid this since these operators > should wo

Re: Finding non ascii characters in a set of files

2007-02-23 Thread Tim Arnold
"Peter Bengtsson" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > On Feb 23, 2:38 pm, [EMAIL PROTECTED] wrote: >> Hi, >> >> I'm updating my program to Python 2.5, but I keep running into >> encoding problems. I have no ecodings defined at the start of any of >> my scripts. What I'd l

Re: c_string missing from ctypes?

2007-02-23 Thread Simon Brunning
On 23 Feb 2007 09:03:21 -0800, Jacob Rael <[EMAIL PROTECTED]> wrote: > I was following along with this site: > > http://www.brunningonline.net/simon/blog/archives/000659.html You don't want to be messing around with that old rubbish. I should know - I wrote it. Instead, take a look at

Re: c_string missing from ctypes?

2007-02-23 Thread Chris Mellon
On 23 Feb 2007 09:03:21 -0800, Jacob Rael <[EMAIL PROTECTED]> wrote: > Hello, > > I was following along with this site: > > http://www.brunningonline.net/simon/blog/archives/000659.html > > and I got a error. It boils down to: > > > > In [9]: import ctypes > In [10]: dir(ctypes

c_string missing from ctypes?

2007-02-23 Thread Jacob Rael
Hello, I was following along with this site: http://www.brunningonline.net/simon/blog/archives/000659.html and I got a error. It boils down to: In [9]: import ctypes In [10]: dir(ctypes.c_string) ---

Re: Finding non ascii characters in a set of files

2007-02-23 Thread John Machin
On Feb 24, 2:44 am, Larry Bates <[EMAIL PROTECTED]> wrote: > Peter Bengtsson wrote: > > On Feb 23, 2:38 pm, [EMAIL PROTECTED] wrote: > >> Hi, > > >> I'm updating my program to Python 2.5, but I keep running into > >> encoding problems. I have no ecodings defined at the start of any of > >> my scrip

Re: Rational numbers

2007-02-23 Thread Martin Manns
On Fri, 23 Feb 2007 09:52:06 -0600 Larry Bates <[EMAIL PROTECTED]> wrote: > I quick search of Google turned up: > > http://books.google.com/books?id=1Shx_VXS6ioC&pg=PA625&lpg=PA625&dq=python+rational+number+library&source=web&ots=BA8_4EXdQ4&sig=aDEnYA99ssKe7PSweVNyi8cS2eg > http://calcrpnpy.source

Re: Local class variables? (mod_python problem)

2007-02-23 Thread Rory Campbell-Lange
On 23/02/07, Diez B. Roggisch ([EMAIL PROTECTED]) wrote: > > It is not desirable for the class variable to keep incrementing outside > > of invocations of '__main__', as is the case when it is loaded under > > mod_python under apache2 on linux. > > > > I'm still not clear on what you want to acco

Re: Rational numbers

2007-02-23 Thread Larry Bates
Martin Manns wrote: > Hi, > > I am starting to use rationals and since I found no batteries included, > I tried out the mxNumber package. > > However, I get strange warnings on comparison operations > (which however seem to yield correct results): > > --- > $ python > Python 2.4.3 (#1, Jan 15 20

Re: Apache Cgi (70007)The timeout specified has expired

2007-02-23 Thread abubakerkiter2003
[EMAIL PROTECTED] أرسلت: > Hello, > > When i run my python script, it works a moment and then stop with this > message in the log: > > (70007)The timeout specified has expired: ap_content_length_filter: > apr_bucket_read() failed refers to .. > > I think my script is too long therefore the ser

Re: Apache Cgi (70007)The timeout specified has expired

2007-02-23 Thread abubakerkiter2003
[EMAIL PROTECTED] أرسلت: > Hello, > > When i run my python script, it works a moment and then stop with this > message in the log: > > (70007)The timeout specified has expired: ap_content_length_filter: > apr_bucket_read() failed refers to .. > > I think my script is too long therefore the ser

Re: Finding non ascii characters in a set of files

2007-02-23 Thread John Machin
On Feb 24, 2:35 am, "John Machin" <[EMAIL PROTECTED]> wrote: > On Feb 24, 2:12 am, "Peter Bengtsson" <[EMAIL PROTECTED]> wrote: > > > On Feb 23, 2:38 pm, [EMAIL PROTECTED] wrote: > > > > Hi, > > > > I'm updating my program to Python 2.5, but I keep running into > > > encoding problems. I have no ec

Apache Cgi (70007)The timeout specified has expired

2007-02-23 Thread naima . mans
Hello, When i run my python script, it works a moment and then stop with this message in the log: (70007)The timeout specified has expired: ap_content_length_filter: apr_bucket_read() failed refers to .. I think my script is too long therefore the server stop it... how can i do to run all m

Re: Finding non ascii characters in a set of files

2007-02-23 Thread Larry Bates
Peter Bengtsson wrote: > On Feb 23, 2:38 pm, [EMAIL PROTECTED] wrote: >> Hi, >> >> I'm updating my program to Python 2.5, but I keep running into >> encoding problems. I have no ecodings defined at the start of any of >> my scripts. What I'd like to do is scan a directory and list all the >> files

Re: Creating a daemon process in Python

2007-02-23 Thread Eirikur Hallgrimsson
I didn't actually write this module. I believe I found it in a discussion in ASPN at Active State. Thanks for the input, and when I get a chance I will try these alternate approaches. This module has been working fine for me as is--so far. Eirikur -- http://mail.python.org/mailman/listinfo

Re: Convert to binary and convert back to strings

2007-02-23 Thread Eric Pederson
Harlin Seritt wrote: >Hi... > >I would like to take a string like 'supercalifragilisticexpialidocius' >and write it to a file in binary forms -- this way a user cannot read >the string in case they were try to open in something like ascii text >editor. I'd also like to be able to read the binary f

Rational numbers

2007-02-23 Thread Martin Manns
Hi, I am starting to use rationals and since I found no batteries included, I tried out the mxNumber package. However, I get strange warnings on comparison operations (which however seem to yield correct results): --- $ python Python 2.4.3 (#1, Jan 15 2007, 15:46:19) [GCC 4.1.1 (Gentoo 4.1.1-r3

Re: Finding non ascii characters in a set of files

2007-02-23 Thread John Machin
On Feb 24, 2:12 am, "Peter Bengtsson" <[EMAIL PROTECTED]> wrote: > On Feb 23, 2:38 pm, [EMAIL PROTECTED] wrote: > > > Hi, > > > I'm updating my program to Python 2.5, but I keep running into > > encoding problems. I have no ecodings defined at the start of any of > > my scripts. What I'd like to do

Re: CSV(???)

2007-02-23 Thread John Machin
On Feb 23, 10:11 pm, David C. Ullrich <[EMAIL PROTECTED]> wrote: > Is there a csvlib out there somewhere? I can make available the following which should be capable of running on 1.5.2 -- unless they've suffered bitrot :-) (a) a csv.py which does simple line-at-a-time hard-coded-delimiter-etc pac

Re: Module trouble [newbie]

2007-02-23 Thread Goldfish
On Feb 23, 6:44 am, Boris Ozegovic <[EMAIL PROTECTED]> wrote: > Can somebody explaint this to me: > > I have module a.py > A = 100 > import b > print "A printing" > print "B is %s" % b.B > > and module b.py > B = 2000 > import a > print "B printing" > print "A is %s" % a.A > > I thought that output

Re: Finding non ascii characters in a set of files

2007-02-23 Thread Peter Bengtsson
On Feb 23, 2:38 pm, [EMAIL PROTECTED] wrote: > Hi, > > I'm updating my program to Python 2.5, but I keep running into > encoding problems. I have no ecodings defined at the start of any of > my scripts. What I'd like to do is scan a directory and list all the > files in it that contain a non ascii

With PIL... paste image on top of other with dropshadow

2007-02-23 Thread Peter Bengtsson
I love the dropshadow effect I managed to make with this recipe: http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/474116 Here's what it can look like: http://www.peterbe.com/test/188-tequilacat.2.jpg It takes a background as a parameter but it's just a colour. What I want is to put the ima

Re: Creating a daemon process in Python

2007-02-23 Thread Jean-Paul Calderone
On Fri, 23 Feb 2007 08:30:07 -0600, Nick Craig-Wood <[EMAIL PROTECTED]> wrote: >Eirikur Hallgrimsson <[EMAIL PROTECTED]> wrote: > > [snip] > >> if (not os.fork()): >> # hang around till adopted by init >> ppid = os.getppid() >> while (ppid != 1): >>

Re: What is the best queue implemetation in Python?

2007-02-23 Thread Szabolcs Nagy
> For that purpose I have used the good deque that you can find in > collections in the standard library. It's very good for queues, and > it's a bit faster than regular lists for stacks too. you mean *much* faster (since a list is a reference array so pop(0) is O(n) operation) never use a list a

Finding non ascii characters in a set of files

2007-02-23 Thread bg_ie
Hi, I'm updating my program to Python 2.5, but I keep running into encoding problems. I have no ecodings defined at the start of any of my scripts. What I'd like to do is scan a directory and list all the files in it that contain a non ascii character. How would I go about doing this? Thanks, Ba

Re: Creating a daemon process in Python

2007-02-23 Thread Nick Craig-Wood
Eirikur Hallgrimsson <[EMAIL PROTECTED]> wrote: > def daemonize(): > if (not os.fork()): > # get our own session and fixup std[in,out,err] > os.setsid() > sys.stdin.close() > sys.stdout = NullDevice() > sys.stderr = NullDevice() That doesn't close

compile python with sqlite3

2007-02-23 Thread Nader Emami
L.S., I have to compile (install) locally Python 2.5, because I don't have 'root' permission. Besides I would use 'sqlite3' as a database for TurboGears/Django. I have installed 'sqlite3' somewhere on my Linux (/path/to/sqlite'). What do I have to do if I want to compile 'Python' with 'sqlite3

Re: Module trouble [newbie]

2007-02-23 Thread Boris Ozegovic
Diez B. Roggisch wrote: > I use it sometimes myself, to avoid otherwise circular imports. Circular imports are the reason why I have module issues. Last question: if I put modules in some package and then try to import one I get "AttributeError: 'module' object has no attribute 'a' Code is: a

Re: Local class variables? (mod_python problem)

2007-02-23 Thread Diez B. Roggisch
> It is not desirable for the class variable to keep incrementing outside > of invocations of '__main__', as is the case when it is loaded under > mod_python under apache2 on linux. > I'm still not clear on what you want to accomplish. In the end it boils down to who is supposed to share that inf

Re: jython import search path

2007-02-23 Thread Diez B. Roggisch
> Accepted strategy? It doesn't seem very portable. It assumes that > everyone puts their library > modules in the exact same place. Or do they just figure that changing > the sys.path.append > line is easy enough? Portability has nothing to do with it. If you arrange your project in a way that th

Re: Finding a tuple in a tuple

2007-02-23 Thread Duncan Booth
Philipp Pagel <[EMAIL PROTECTED]> wrote: > Another way to go instead of using sets, although probably less elegant: > True in [x in t1 for x in t2] > True True in [x in t1 for x in t3] > True True in [x in t1 for x in t4] > False True in [x in t1 for x in t5] > False Slightly

Re: Module trouble [newbie]

2007-02-23 Thread Diez B. Roggisch
Boris Ozegovic wrote: > Diez B. Roggisch wrote: > >> Are you sure the above is what you really used for your test? Because >> your output features a single 100, which the above lacks a >> print-statement for. > > Yeah, I cancelled the message, but synchronization allready happened. :) > > Prob

python float-point problem

2007-02-23 Thread unidevel
I just compiled python 2.4.2 using openembedded for my zaurus C750. I test some comparison for float-pointing number, for example: 3.1<3.0 True 3.2<3.0 True 3.3<3.0 False 8.4<4.0 True I use the cross compiler that compiled python to make a simple C program, got correct results. Anyone have some ide

Re: Module trouble [newbie]

2007-02-23 Thread Boris Ozegovic
Diez B. Roggisch wrote: > Are you sure the above is what you really used for your test? Because your > output features a single 100, which the above lacks a print-statement for. Yeah, I cancelled the message, but synchronization allready happened. :) Problem was in some other place. One more q

  1   2   >