Terry Reedy wrote:
> Not to me. You are using the module as a singleton class. The
> alternative is to write a class, make the functions methods, and
> instantiate the class. If that instance must be a singleton, more work
> is required. If multiple instances make sense, you can go the class
> r
Hi,
I'd appreciate your hints on this problem. I'm writing a module in which several
functions can alter the value of a global variable (I know this sounds evil,
please forgive me...). What I'm trying to do is to eliminate the "global foo"
lines in those functions' bodies and to use a decorator fo
Gabriel Genellina wrote:
> En Mon, 08 Dec 2008 12:34:03 -0200, Cong Ma <[EMAIL PROTECTED]> escribió:
>
>> I'm writing a program that pickles an instance of a custom subclass of
>> datetime.tzinfo. I followed the guides given in the Library Reference
>> (vers
Hello,
I'm writing a program that pickles an instance of a custom subclass of
datetime.tzinfo. I followed the guides given in the Library Reference (version
2.5.2, chapter 5.1.6), which contain the note:
"Special requirement for pickling: A tzinfo subclass must have an __init__
method that can be
Lawrence D'Oliveiro wrote:
> for \
> Entry \
> in \
> sorted \
> (
> f for f in os.listdir(PatchesDir) if PatchDatePat.search(f) !=
> None
> ) \
> :
> Patch = (open,
> gzip.GzipFile)[Entry.endswith(".gz")](os.path.join(PatchesDir, Entry), "r
Nick Craig-Wood wrote:
> Here is how you do exactly that in python using ctypes
>
> from ctypes import CDLL, c_char_p, c_int, Structure, POINTER
> from ctypes.util import find_library
>
> class c_dir(Structure):
> """Opaque type for directory entries, corresponds to struct DIR"""
> c_dir_p =
alex23 wrote:
> On Nov 26, 3:26 pm, greg <[EMAIL PROTECTED]> wrote:
>> os.O_DIRECTORY must be fairly new -- it doesn't exist
>> in my 2.5 installation. But os.O_RDONLY seems to work
>> just as well for this purpose.
>
> Which OS are you using?
>
> Python 2.5.2 (r252:60911, Jul 31 2008, 17:28:52)
alex23 wrote:
> On Nov 26, 12:31 am, "D'Arcy J.M. Cain" <[EMAIL PROTECTED]> wrote:
>> Is this what you want?
>>
>> ofiles = [open(x) for x in os.listdir(os.getcwd())]
>
> 'open' returns a "file object", whereas the OP is after "file
> descriptors", which are returned by 'os.open'.
>
> --
> http:/
r0g wrote:
> Cong Ma wrote:
>> Dear all,
>>
>> Can you give me some hint on getting a directory file descriptor in Python?
>> Besides, what's good about os.fchdir() if I can't get a directory fd in the
>> first place?
>>
>> Thanks for
Dear all,
Can you give me some hint on getting a directory file descriptor in Python?
Besides, what's good about os.fchdir() if I can't get a directory fd in the
first place?
Thanks for your reply.
Regards,
Cong.
--
http://mail.python.org/mailman/listinfo/python-list
10 matches
Mail list logo