Re: Use a Thread to reload a Module?

2006-12-25 Thread Hendrik van Rooyen
"Gregory Piñero" <[EMAIL PROTECTED]> wrote: To: "Hendrik van Rooyen" <[EMAIL PROTECTED]> On 12/24/06, Hendrik van Rooyen <[EMAIL PROTECTED]> wrote: > "Gregory Piñero" <[EMAIL PROTECTED]> wrote: ... > open( filename[,flag='c'[,protocol=None[,writeback=False[,binary=None) > > Open a persistent

Re: method names in __slots__ ??

2006-12-25 Thread Rob Williscroft
John Machin wrote in news:1167008799.074885.250770@ 73g2000cwn.googlegroups.com in comp.lang.python: > Given a = Adder(), > a.tally = 0 > gets AttributeError: 'Adder' object attribute 'tally' is read-only > a.notinslots = 1 > gets AttributeError: 'Adder' object attribute 'notinslots' is re

Re: regular expression

2006-12-25 Thread [EMAIL PROTECTED]
Rad [Visual C# MVP] wrote: > On Sun, 24 Dec 2006 16:36:31 +0100, Stef Mientki wrote: > > > Dustan wrote: > >> Kleine Aap wrote: > >>> Asper Faner wrote: > >>> > I seem to always have hard time understaing how this regular expression > works, especially how on earth do people bring it up

Re: Why does Python never add itself to the Windows path?

2006-12-25 Thread Ross Ridge
Ben Sizer wrote: > I've installed several different versions of Python across several > different versions of MS Windows, and not a single time was the Python > directory or the Scripts subdirectory added to the PATH environment > variable. Personally, I hate Windows applications that add themselv

Re: regular expression

2006-12-25 Thread Dustan
[EMAIL PROTECTED] wrote: > Rad [Visual C# MVP] wrote: > > On Sun, 24 Dec 2006 16:36:31 +0100, Stef Mientki wrote: > > > > > Dustan wrote: > > >> Kleine Aap wrote: > > >>> Asper Faner wrote: > > >>> > > I seem to always have hard time understaing how this regular expression > > works, esp

Re: How to stop program when threads is sleeping

2006-12-25 Thread John Henry
many_years_after wrote: > Hi, pythoners: > > There is a problem I couldn't dispose. I start a thread in the my > program. The thread will do something before executing time.sleep(). > When the user give a signal to the main thread (such as click the 'end' > button or close the window), the t

Re: One module per class, bad idea?

2006-12-25 Thread Kent Johnson
Carl Banks wrote: > Kent Johnson wrote: >> Carl Banks wrote: >>> Now, I think this is the best way to use modules, but you don't need to >>> use modules to do get higher-level organization; you could use packages >>> instead. It's a pain if you're working on two different classes in the >>> same s

Re: How to stop program when threads is sleeping

2006-12-25 Thread Carsten Haese
On Sun, 2006-12-24 at 22:55 -0800, many_years_after wrote: > Hi, pythoners: > > There is a problem I couldn't dispose. I start a thread in the my > program. The thread will do something before executing time.sleep(). > When the user give a signal to the main thread (such as click the 'end' >

Re: method names in __slots__ ??

2006-12-25 Thread John Machin
Rob Williscroft wrote: > John Machin wrote in news:1167008799.074885.250770@ > 73g2000cwn.googlegroups.com in comp.lang.python: > > > Given a = Adder(), > > a.tally = 0 > > gets AttributeError: 'Adder' object attribute 'tally' is read-only > > a.notinslots = 1 > > gets AttributeError: 'Adde

Re: method names in __slots__ ??

2006-12-25 Thread Rob Williscroft
John Machin wrote in news:[EMAIL PROTECTED] in comp.lang.python: > Rob Williscroft wrote: >> John Machin wrote in news:1167008799.074885.250770@ >> 73g2000cwn.googlegroups.com in comp.lang.python: >> >> > Given a = Adder(), >> > a.tally = 0 >> > gets AttributeError: 'Adder' object attribute '

Re: Elliptic Curve Library

2006-12-25 Thread vasudevram
Jaap Spies wrote: > Mike Tammerman wrote: > > > I need an elliptic curve library that can be used by python. I googled > > but couldn't find a one. I'll appreciate, if you could show me. > > > > You could look at http://sage.scipy.org/sage/ > http://sage.scipy.org/sage/features.html > > Jaap Sorr

ANNOUNCE: Mod_python 3.3.0b (Beta)

2006-12-25 Thread Gregory (Grisha) Trubetskoy
The Apache Software Foundation and The Apache HTTP Server Project are pleased to announce the 3.3.0b (Beta) release of mod_python. Version 3.3.0b of mod_python features several new functions and attributes providing better access to apache internals, as well as many bug fixes and various performa

Re: Unescaping URLs in Python

2006-12-25 Thread John Nagle
Lawrence D'Oliveiro wrote: > In message <[EMAIL PROTECTED]>, John Nagle > wrote: > > >>Here's a URL from a link on the home page of a major company. >> >>About Us >> >>What's the appropriate Python function to call to unescape a URL >>which might contain things like that? > > > Just use any HTM

Re: One module per class, bad idea?

2006-12-25 Thread Carl Banks
Kent Johnson wrote: > Carl Banks wrote: > > Kent Johnson wrote: > >> Carl Banks wrote: > >>> Now, I think this is the best way to use modules, but you don't need to > >>> use modules to do get higher-level organization; you could use packages > >>> instead. It's a pain if you're working on two di

Re: Unescaping URLs in Python

2006-12-25 Thread Jeffrey Froman
John Nagle wrote: > What's the appropriate Python function to call to unescape a URL which > might contain things like that? xml.sax.saxutils.unescape() > Will this interfere with the usual "%" > type escapes in URLs? Nope, and urllib.unquote() can be used to translate URL escapes manually.

Re: Why does Python never add itself to the Windows path?

2006-12-25 Thread Ben Sizer
[EMAIL PROTECTED] wrote: > I don't seem to have any problem running python programs regardless of > where they are. My platform is windows xp and I have run both 2.4 and > 2.5 more details about what version of windows you are running might be > helpfull I don't think the Windows version is rele

Re: Elliptic Curve Library

2006-12-25 Thread Piet van Oostrum
> "Mike Tammerman" <[EMAIL PROTECTED]> (MT) wrote: >MT> Hi, >MT> I need an elliptic curve library that can be used by python. I googled >MT> but couldn't find a one. I'll appreciate, if you could show me. OpenSSL contains elliptic curve stuff (donated by SUN). M2Crypto is a Python interface t

Re: ANNOUNCE: Mod_python 3.3.0b (Beta)

2006-12-25 Thread derekl00
How long does it usually take for these things to make there way into the Fedora (or other distro) repositories? Gregory (Grisha) Trubetskoy wrote: > The Apache Software Foundation and The Apache HTTP Server Project are > pleased to announce the 3.3.0b (Beta) release of mod_python. > > Version 3.3

Re: Why does Python never add itself to the Windows path?

2006-12-25 Thread Ben Sizer
Ross Ridge wrote: > Ben Sizer wrote: > > I've installed several different versions of Python across several > > different versions of MS Windows, and not a single time was the Python > > directory or the Scripts subdirectory added to the PATH environment > > variable. > > Personally, I hate Windows

Re: Website Capture

2006-12-25 Thread derekl00
Not sure what OS you are on, but a2ps is one way you could probably do this: http://www.infres.enst.fr/~demaille/a2ps/delegations.html That will get you as far as PostScript and I imagine it is pretty straightforward from there to get things into a gif. Jonathan Curran wrote: > On Monday 25 Decem

Re: regular expression

2006-12-25 Thread Steven D'Aprano
On Mon, 25 Dec 2006 06:17:00 -0800, [EMAIL PROTECTED] wrote: > Hi folks, fairly new to the list(Python is my first programming > language, so I'm fairly new to the world of programming too)but this is > a question I've been wondering about since I started learning about the > re module. Are regula

Re: Generating all permutations from a regexp

2006-12-25 Thread BJörn Lindqvist
On 12/22/06, Fredrik Lundh <[EMAIL PROTECTED]> wrote: > BJörn Lindqvist wrote: > > With regexps you can search for strings matching it. For example, > > given the regexp: "foobar\d\d\d". "foobar123" would match. I want to > > do the reverse, from a regexp generate all strings that could match > > i

Re: Generating all permutations from a regexp

2006-12-25 Thread BJörn Lindqvist
With some help from the sre_parse module (and the Python Cookbook), here is the completed module: # -*- coding: utf-8 -*- import itertools from sre_constants import * import sre_parse import string category_chars = { CATEGORY_DIGIT : string.digits, CATEGORY_SPACE : string.whitespace,

Re: Generating all permutations from a regexp

2006-12-25 Thread Paul McGuire
"Paul McGuire" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] On Dec 22, 8:30 am, "BJörn Lindqvist" <[EMAIL PROTECTED]> wrote: > With regexps you can search for strings matching it. For example, > given the regexp: "foobar\d\d\d". "foobar123" would match. I want to > do the reverse,

Re: Generating all permutations from a regexp

2006-12-25 Thread BJörn Lindqvist
On 23 Dec 2006 04:23:09 -0800, Chris Johnson <[EMAIL PROTECTED]> wrote: > > BJörn Lindqvist wrote: > > With regexps you can search for strings matching it. For example, > > given the regexp: "foobar\d\d\d". "foobar123" would match. I want to > > do the reverse, from a regexp generate all strings th

Re: some OT: how to solve this kind of problem in our program?

2006-12-25 Thread Paul McGuire
<[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > Using Psyco this version is much faster, you can test it on your PC > compared to the other one (the whole running time, Psyco compilation > too): > Psyco is unable to speed up generator functions, so you have to return > true lists. >

BeautifulSoup vs. loose & chars

2006-12-25 Thread John Nagle
I've been parsing existing HTML with BeautifulSoup, and occasionally hit content which has something like "Design & Advertising", that is, an "&" instead of an "&". Is there some way I can get BeautifulSoup to clean those up? There are various parsing options related to "&" handling, but none

Re: Why does Python never add itself to the Windows path?

2006-12-25 Thread WaterWalk
Ben Sizer wrote: > I've installed several different versions of Python across several > different versions of MS Windows, and not a single time was the Python > directory or the Scripts subdirectory added to the PATH environment > variable. Every time, I've had to go through and add this by hand,

Re: Why does Python never add itself to the Windows path?

2006-12-25 Thread Dustan
WaterWalk wrote: > Ben Sizer wrote: > > I've installed several different versions of Python across several > > different versions of MS Windows, and not a single time was the Python > > directory or the Scripts subdirectory added to the PATH environment > > variable. Every time, I've had to go thr

Re: textwrap.dedent replaces tabs?

2006-12-25 Thread Tom Plunket
Frederic Rentsch wrote: > It this works, good for you. I can't say I understand your objective. > (You dedent common leading tabs, except if preceded by common leading > spaces (?)). I dedent common leading whitespace, and tabs aren't equivalent to spaces. E.g. if some text is indented exclusi

Re: ANNOUNCE: Mod_python 3.3.0b (Beta)

2006-12-25 Thread Graham Dumpleton
derekl00 wrote: > Gregory (Grisha) Trubetskoy wrote: > > The Apache Software Foundation and The Apache HTTP Server Project are > > pleased to announce the 3.3.0b (Beta) release of mod_python. > > How long does it usually take for these things to make there way into > the Fedora (or other distro) r

[ANN] ftputil 2.2 released

2006-12-25 Thread Stefan Schwarzer
ftputil 2.2 is now available from http://ftputil.sschwarzer.net/download . Changes since version 2.1 - - Results of stat calls (also indirect calls, i. e. listdir, isdir/isfile/islink, exists, getmtime etc.) are now cached and reused. This results in remarkable speedup

Re: How to stop program when threads is sleeping

2006-12-25 Thread many_years_after
Carsten Haese wrote: > On Sun, 2006-12-24 at 22:55 -0800, many_years_after wrote: > > Hi, pythoners: > > > > There is a problem I couldn't dispose. I start a thread in the my > > program. The thread will do something before executing time.sleep(). > > When the user give a signal to the main

Can Python help?

2006-12-25 Thread Lad
On my website I allow users to upload files. I would like a user to see how much time is left before a file is uploaded. So, I would like to have a progress bar during a file uploading. Can Python help me with that?Or how can be a progress bar made? Thank you for ideas. La. -- http://mail.pytho

How to depress the output of an external module ?

2006-12-25 Thread [EMAIL PROTECTED]
Hi, I'm writing a program which imports an external module writing in C and calls a function provided by the module to do my job. But the method produces a lot of output to the stdout, and this consumes most of the running time. My question is, is there a way to depress the output produced by th