Re: can't use "glog" to find the path with square bracket

2009-04-27 Thread MRAB
winterTTr wrote: I want to list the file with glob . The path( which is a directory ) is contain square bracket as "[ab] xxx" . However , i can't find how to do it rightly with glob . with the coding : {{{ import glob glob.glob('[ab]xxx' ) }}} and with the path "[ab]xxx" really exits. result

Importing a file into another module's namespace

2009-04-27 Thread Gary Oberbrunner
Hi; my first time posting here. I have a somewhat tricky problem I'd like some help with. I have a module, foo.bar, that defines a number of functions and variables as usual. Now after importing foo.bar, I'd like to load another file of code (say xyz.py), but *into* foo.bar's namespace. So if x

The whole story

2009-04-27 Thread Paul Hemans
Hi Andrew, The reason I am using mapped objects is that I need to abstract from the database implementation allowing the replication to target a number of different platforms. This will definitely slow things down. > process a whole pile in memory and then (perhaps every 10,000 - when your > mem

Re: Is there a maximum size to a Python program?

2009-04-27 Thread Paul Hemans
Hi, Please see my post titled "The whole story" "Martin P. Hellwig" wrote in message news:qokdnqz7zfefw2junz2dnuvz8jqdn...@bt.com... > Carbon Man wrote: >> I have a program that is generated from a generic process. It's job is to >> check to see whether records (replicated from another system)

python segfaulting, MemoryError (PyQt)

2009-04-27 Thread Denis L
Hello, I'm experiencing odd errors on both windows and linux with the following code: import sys from PyQt4.QtCore import * from PyQt4.QtGui import * class Options(QDialog): def __init__(self, values): QDialog.__init__(self) self.values = values fooEdit = QLineEdit

Re: Importing a file into another module's namespace

2009-04-27 Thread MRAB
Gary Oberbrunner wrote: Hi; my first time posting here. I have a somewhat tricky problem I'd like some help with. I have a module, foo.bar, that defines a number of functions and variables as usual. Now after importing foo.bar, I'd like to load another file of code (say xyz.py), but *into* foo

Re: Lisp mentality vs. Python mentality

2009-04-27 Thread Dan Sommers
On Mon, 27 Apr 2009 07:57:00 +0300, Ciprian Dorin, Craciun wrote: > On Mon, Apr 27, 2009 at 2:14 AM, Dan Sommers > wrote: >> Also from the Zen:  flat is better than nested.  One of the aspects of >> flatter call trees and object hierarchies is that I hit the bottom >> (language features or the s

Way to use proxies & login to site?

2009-04-27 Thread inVINCable
Hello, I have been using ClientForm to log in to sites & ClientCookie so I can automatically log into my site to do some penetration testing, although, I cannot figure out a solution to use proxies with this logging in automatically. Does anyone have any solutions? Thanks :) Vince -- http://mail

Re: Thread-killing, round 666 (was Re: Lisp mentality vs. Python mentality)

2009-04-27 Thread Vsevolod
On Apr 27, 8:18 pm, a...@pythoncraft.com (Aahz) wrote: > That's because there's no response to make; the original post was a joke, > and trying to have a serious discussion about it rarely excites people. In every joke there's a grain of truth. And usenet is precisely for that thing -- discussions

Re: Thread-killing, round 666 (was Re: Lisp mentality vs. Python mentality)

2009-04-27 Thread Vsevolod
On Apr 27, 11:31 pm, David Bolen wrote: > I'm curious - do you know what happens if threading is implemented as > a native OS thread and it's stuck in an I/O operation that is blocked? > How does the Lisp interpreter/runtime gain control again in order to > execute the specified function? I guess

inside-out range function

2009-04-27 Thread William Clifford
For some reason I thought I needed this code, but it turns out I don't, really. I need something weirder. Anyway, maybe someone else could use this. def enrag(start, stop=None, step=1): '''Yield a range of numbers from inside-out, evens on left.''' if stop is None: stop, start = s

Re: Importing a file into another module's namespace

2009-04-27 Thread Steven D'Aprano
On Mon, 27 Apr 2009 21:46:13 -0400, Gary Oberbrunner wrote: > I have a module, foo.bar, that defines a number of functions and > variables as usual. Now after importing foo.bar, I'd like to load > another file of code (say xyz.py), but *into* foo.bar's namespace. So > if xyz.py contains: > > de

Re: inside-out range function

2009-04-27 Thread Steven D'Aprano
On Mon, 27 Apr 2009 20:27:07 -0700, William Clifford wrote: > For some reason I thought I needed this code, but it turns out I don't, > really. > I need something weirder. Anyway, maybe someone else could use this. > > def enrag(start, stop=None, step=1): > '''Yield a range of numbers from in

Re: mailbox.mbox.add() sets access time as well as modification time

2009-04-27 Thread Steven D'Aprano
On Tue, 28 Apr 2009 11:19:51 +1200, Lawrence D'Oliveiro wrote: > In message , Aahz wrote: > >> In article , Lawrence D'Oliveiro >> wrote: >>> >>>It's only in the proprietary-software world that we need to worry about >>>backward compatibility with old, obsolete software that the vendors >>>cann

Re: Lisp mentality vs. Python mentality

2009-04-27 Thread namekuseijin
Dan Sommers wrote: On Mon, 27 Apr 2009 07:57:00 +0300, Ciprian Dorin, Craciun wrote: I agree with your opinion about keeping the abstraction layers shallow, but in my view high-order and helper functions do not comprise a new abstraction layer. For example in Lisp, using map, reduce (fold),

Re: Light (general) Inter-Process Mutex/Wait/Notify Synchronization?

2009-04-27 Thread Philip Semanchuk
On Apr 27, 2009, at 8:45 PM, Gunter Henriksen wrote: Try this: http://nikitathespider.com/python/shm/ I took a look at that (especially the posix_ipc at http://semanchuk.com/philip/posix_ipc/). Hej Gunter, The posix_ipc and sysv_ipc modules both do what you're asking for. Shm does too but

Re: Web based application development using python

2009-04-27 Thread Rahul
> > 2) I have my web based application written using mod_python > > a. It should be more based on framework type. > > b. It should have all the features present in mod_python. > > These two goals conflict.  You'll need to use your brain to discover > what is best for your application.  In gener

Re: Light (general) Inter-Process Mutex/Wait/Notify Synchronization?

2009-04-27 Thread Gunter Henriksen
> If you don't want to use a 3rd party module you could > use the multiprocessing module That is definitely good for when I have a tree of processes which are all Python applications. I use it for that. But I am looking for something where the Python application can interact conveniently with an

Re: inside-out range function

2009-04-27 Thread William Clifford
On Apr 27, 9:22 pm, Steven D'Aprano wrote: > On Mon, 27 Apr 2009 20:27:07 -0700, William Clifford wrote: > > For some reason I thought I needed this code, but it turns out I don't, > > really. > > I need something weirder. Anyway, maybe someone else could use this. > > > def enrag(start, stop=None

Re: Web based application development using python

2009-04-27 Thread Stephen Hansen
> i am getting more specific, is there any web development framework > better than mod python which is > easy to maintain. > I'd have a hard time categorizing mod_python as a "web development framework"; it seems to me to be primarily a Python accelerator for Apache, with lightweight tools which c

Re: suggestion on a complicated inter-process communication

2009-04-27 Thread Aaron Brady
On Apr 27, 10:59 pm, Way wrote: > Hello friends, > > I have a little messy situation on IPC. Please if you can, give me > some suggestion on how to implement. Thanks a lot! > > -> denotes create > > MainProcess -> Process1 -> Process3 (from os.system) >                    | >                     -

Re: Light (general) Inter-Process Mutex/Wait/Notify Synchronization?

2009-04-27 Thread Gunter Henriksen
> > > Try this: http://nikitathespider.com/python/shm/ > > > > I am hoping not to plug something underneath the Python > > VM; I would rather use a socket, or use signals. > > I'm not sure what you mean. It's just an extension module > that you'd import like any of the stdlib modules. I cannot im

Re: Light (general) Inter-Process Mutex/Wait/Notify Synchronization?

2009-04-27 Thread Aaron Brady
On Apr 28, 12:20 am, Gunter Henriksen wrote: > > If you don't want to use a 3rd party module you could > > use the multiprocessing module > > That is definitely good for when I have a tree of > processes which are all Python applications.  I use > it for that.  But I am looking for something where

Re: inside-out range function

2009-04-27 Thread Mensanator
On Apr 28, 12:19�am, William Clifford wrote: > On Apr 27, 9:22�pm, Steven D'Aprano > > > > > > wrote: > > On Mon, 27 Apr 2009 20:27:07 -0700, William Clifford wrote: > > > For some reason I thought I needed this code, but it turns out I don't, > > > really. > > > I need something weirder. Anyway,

Re: inside-out range function

2009-04-27 Thread Paul Rubin
William Clifford writes: > def enrag(start, stop=None, step=1): > '''Yield a range of numbers from inside-out, evens on left.''' >>> list(enrag(10)) [8, 6, 4, 2, 0, 1, 3, 5, 7, 9] ok, but: >>> list(enrag(10,20)) [18, 16, 14, 12, 10, 1, 3, 5, 7, 9, 11, 13, 15, 17, 19] is

Re: Light (general) Inter-Process Mutex/Wait/Notify Synchronization?

2009-04-27 Thread Paul Rubin
Gunter Henriksen writes: > Indeed, but I can "import signal" or "import socket" > wherever I go, without worrying about requiring (or > worse yet, having to bundle) a CPython plugin Oh I see what you mean, yes, it's a recurring problem. It would be nice if the mmap module included some ipc synch

Re: suggestion on a complicated inter-process communication

2009-04-27 Thread Jonathan Gardner
On Apr 27, 8:59 pm, Way wrote: > Hello friends, > > I have a little messy situation on IPC. Please if you can, give me > some suggestion on how to implement. Thanks a lot! > > -> denotes create > > MainProcess -> Process1 -> Process3 (from os.system) >                    | >                     ->

Re: mailbox.mbox.add() sets access time as well as modification time

2009-04-27 Thread Lawrence D'Oliveiro
In message , Steven D'Aprano wrote: > On Tue, 28 Apr 2009 11:19:51 +1200, Lawrence D'Oliveiro wrote: > >> Either there are enough people using it to care about it, in which case >> somebody in the community will fix it, it or there are not, in which >> case it's not worth bothering with. > > Th

Why bool( object )?

2009-04-27 Thread Aaron Brady
What is the rationale for considering all instances true of a user- defined type? Is it strictly a practical stipulation, or is there something conceptually true about objects? ''' object.__bool__(self) If a class defines neither __len__() nor __bool__(), all its instances are considered true. ''

Re: Thread-killing, round 666 (was Re: Lisp mentality vs. Python mentality)

2009-04-27 Thread Aahz
In article <9a827369-b36f-4a86-870a-e5a505e34...@q33g2000pra.googlegroups.com>, Vsevolod wrote: >On Apr 27, 8:18 pm, a...@pythoncraft.com (Aahz) wrote: >> >> If you want to talk about Python and problems you're running into, you >> should start a new thread. > >I'm not at that level of proficien

Re: Why bool( object )?

2009-04-27 Thread Stephen Hansen
On Mon, Apr 27, 2009 at 11:11 PM, Aaron Brady wrote: > What is the rationale for considering all instances true of a user- > defined type? Is it strictly a practical stipulation, or is there > something conceptually true about objects? > > ''' > object.__bool__(self) > If a class defines neither

Re: Why bool( object )?

2009-04-27 Thread Lie Ryan
Aaron Brady wrote: What is the rationale for considering all instances true of a user- defined type? User-defined objects (or type) can override .__len__() [usually container types] or .__nonzero__() to make bool() returns False. Is it strictly a practical stipulation, or is there somethi

Re: Why bool( object )?

2009-04-27 Thread Chris Rebert
On Mon, Apr 27, 2009 at 11:11 PM, Aaron Brady wrote: > What is the rationale for considering all instances true of a user- > defined type?  Is it strictly a practical stipulation, or is there > something conceptually true about objects? > > ''' > object.__bool__(self) > If a class defines neither

<    1   2