Re: 3.0rc3: 'os.extsep' gone ... ?

2008-11-25 Thread Lawrence D'Oliveiro
Terry Reedy wrote: The doc for os.path begins This module implements some useful functions on pathnames. os.path contains functions that work differently on different systems. It is in fact a variable that is initialized to point to posixpath, ntpath etc as appropriate for the current system

Re: How to get a directory file descriptor?

2008-11-25 Thread Cong Ma
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 your reply. Regards, Cong. for each in os.listdir(os.getcwd()):

Re: How to get a directory file descriptor?

2008-11-25 Thread r0g
Cong Ma wrote: 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 your reply. Regards, Cong. for each in

Re: Instance attributes vs method arguments

2008-11-25 Thread Marc 'BlackJack' Rintsch
On Tue, 25 Nov 2008 07:27:41 +, John O'Hagan wrote: Is it better to do this: class Class_a(): def __init__(self, args): self.a = args.a self.b = args.b self.c = args.c self.d = args.d def method_ab(self):

Re: Instance attributes vs method arguments

2008-11-25 Thread bieffe62
On 25 Nov, 08:27, John O'Hagan [EMAIL PROTECTED] wrote: Is it better to do this: class Class_a():         def __init__(self, args):                 self.a = args.a                         self.b = args.b                 self.c = args.c                 self.d = args.d         def

Re: How to get a directory file descriptor?

2008-11-25 Thread r0g
r0g wrote: Cong Ma wrote: 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 your reply. Regards, Cong. for each in

Re: Quick question about None and comparisons

2008-11-25 Thread Giampaolo Rodola'
Ok thanks. I'll avoid to do that. --- Giampaolo http://code.google.com/p/pyftpdlib/ -- http://mail.python.org/mailman/listinfo/python-list

Re: Instance attributes vs method arguments

2008-11-25 Thread M.-A. Lemburg
On 2008-11-25 08:27, John O'Hagan wrote: Is it better to do this: class Class_a(): def __init__(self, args): self.a = args.a self.b = args.b self.c = args.c self.d = args.d def method_ab(self):

Re: Python Django Latex Permissions Problem

2008-11-25 Thread Nick Craig-Wood
I-T [EMAIL PROTECTED] wrote: I have a python/django webapp running with apache2. It executes system commands for getting a pdf generated by pdflatex from a .tex file and a couple of image files which it also generates. The permssions from ls-l for all the created files is:- -rw-r--r--

Re: recommended __future__ imports for 2.5?

2008-11-25 Thread Nick Craig-Wood
Dennis Lee Bieber [EMAIL PROTECTED] wrote: On Mon, 24 Nov 2008 13:36:32 -0700, Joe Strout [EMAIL PROTECTED] declaimed the following in comp.lang.python: older versions of Python with from __future__ import division. Once I stumbled across that, I was able to find the relevant PEP

Python/C API: using from a shared library

2008-11-25 Thread Robie Basak
Hi, If I use dlopen() to open a shared library that I've written, and that shared library tries to use the Python/C API, then it fails. I've reduced the problem to the test case below. The error is: ImportError: /usr/lib/python2.5/lib-dynload/time.so: undefined symbol: PyExc_ValueError It

Getting in to metaprogramming

2008-11-25 Thread Rafe
Hi, In the name of self-education can anyone share some pointers, links, modules, etc that I might use to begin learning how to do some metaprogramming. That is, using code to write code (right?) Cheers, - Rafe -- http://mail.python.org/mailman/listinfo/python-list

Re: Getting in to metaprogramming

2008-11-25 Thread Michele Simionato
On Nov 25, 11:08 am, Rafe [EMAIL PROTECTED] wrote: Hi, In the name of self-education can anyone share some pointers, links, modules, etc that I might use to begin learning how to do some metaprogramming. That is, using code to write code (right?) Cheers, - Rafe The word metaprogramming

Re: Instance attributes vs method arguments

2008-11-25 Thread Rafe
snip It is always good practice to provide default values for instance variables in the class definition, both to enhance readability and to allow adding documentation regarding the variables, e.g. class Class_a:    # Foo bar    a = None    # Foo baz    b = None snip Those are not

Re: Instance attributes vs method arguments

2008-11-25 Thread John O'Hagan
On Tue, 25 Nov 2008, Marc 'BlackJack' Rintsch wrote: On Tue, 25 Nov 2008 07:27:41 +, John O'Hagan wrote: Is it better to do this: class Class_a(): def __init__(self, args): self.a = args.a self.b = args.b self.c = args.c

Re: Instance attributes vs method arguments

2008-11-25 Thread Marc 'BlackJack' Rintsch
On Tue, 25 Nov 2008 10:48:01 +, John O'Hagan wrote: On Tue, 25 Nov 2008, Marc 'BlackJack' Rintsch wrote: On Tue, 25 Nov 2008 07:27:41 +, John O'Hagan wrote: Is it better to do this: class Class_a(): def __init__(self, args): self.a = args.a self.b =

Re: Instance attributes vs method arguments

2008-11-25 Thread Rafe
On Nov 25, 5:48 pm, John O'Hagan [EMAIL PROTECTED] wrote: On Tue, 25 Nov 2008, Marc 'BlackJack' Rintsch wrote: On Tue, 25 Nov 2008 07:27:41 +, John O'Hagan wrote: Is it better to do this: class Class_a():       def __init__(self, args):               self.a = args.a          

Re: Getting in to metaprogramming

2008-11-25 Thread Rafe
On Nov 25, 5:41 pm, Aaron Brady [EMAIL PROTECTED] wrote: On Nov 25, 4:08 am, Rafe [EMAIL PROTECTED] wrote: Hi, In the name of self-education can anyone share some pointers, links, modules, etc that I might use to begin learning how to do some metaprogramming. That is, using code to

Re: Getting in to metaprogramming

2008-11-25 Thread Michele Simionato
On Nov 25, 12:12 pm, Rafe [EMAIL PROTECTED] wrote: is it really as simple as gathering strings of code? Yes. Sort of like generating HTML or XML directly? Is there any other framework or pattern set that is worth looking in to? Yes, the compiler module and the ast module in the standard

Re: Multiple equates

2008-11-25 Thread Iain King
On Nov 17, 7:41 pm, Tim Chase [EMAIL PROTECTED] wrote: It doesn't matter as none of this is valid Python. In Python you have to write array[x1] = False array[x2] = False Uh...not so much... a = [1,2,3,4,5] x1, x2 = 1, 3 a[x1] = a[x2] = False a [1, False, 3, False, 5]

Re: Getting in to metaprogramming

2008-11-25 Thread Aaron Brady
On Nov 25, 4:08 am, Rafe [EMAIL PROTECTED] wrote: Hi, In the name of self-education can anyone share some pointers, links, modules, etc that I might use to begin learning how to do some metaprogramming. That is, using code to write code (right?) Cheers, - Rafe Python programs can

Re: Multiple equates

2008-11-25 Thread Iain King
On Nov 25, 11:29 am, Iain King [EMAIL PROTECTED] wrote: On Nov 17, 7:41 pm, Tim Chase [EMAIL PROTECTED] wrote: It doesn't matter as none of this is valid Python. In Python you have to write array[x1] = False array[x2] = False Uh...not so much... a = [1,2,3,4,5] x1,

Re: How to get a directory file descriptor?

2008-11-25 Thread alex23
On Nov 25, 5:05 pm, Cong Ma [EMAIL PROTECTED] wrote: 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? Try: os.open('dirname', os.O_RDONLY) Check os for a list of the valid flag

Re: How to get a directory file descriptor?

2008-11-25 Thread alex23
On Nov 25, 9:53 pm, alex23 [EMAIL PROTECTED] wrote: On Nov 25, 5:05 pm, Cong Ma [EMAIL PROTECTED] wrote: 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? Try:

Re: Can't find Python Library packages in Ubuntu (Debian)

2008-11-25 Thread Jerzy Jalocha N
Scott David Daniels wrote: So, the first question is: How do I install the complete Python test framework under Ubuntu (Debian)? You could use BZR or SVN to get a copy of the full Lib/test tree. Given your long-disconnected running, I'd consider getting a full source set for

Re: Accessing Modification Time of an Outlook Mail in Python

2008-11-25 Thread Iain King
On Nov 25, 5:11 am, [EMAIL PROTECTED] [EMAIL PROTECTED] wrote: Hi all, I am writing a small application which reads the contents of an Outlook Mail using python. I am able to read the contents, subject along with senders and receivers of a mail using MAPI objects. But may I know how

Re: Accessing Modification Time of an Outlook Mail in Python

2008-11-25 Thread skip
Venu ... may I know how can I get access to the modification time or Venu the receiving time of an outlook mail in Python... I have no idea off the top of my head, but you might want to browse the SpamBayes Outlook plugin source code for various ways to manipulate Outlook messages.

datetime objects and __new__()

2008-11-25 Thread peter
Hi -- import datetime class ts(datetime.datetime): ... foo = 'bar' ... def __new__(cls, s): ... c = super(ts, cls) ... return c.fromtimestamp(s) ... t = ts(0) Traceback (most recent call last): File stdin, line 1, in module File stdin, line 5, in __new__ TypeError:

Re: initialized list: strange behavior

2008-11-25 Thread Arnaud Delobelle
Jason Scheirer [EMAIL PROTECTED] writes: On Nov 24, 10:34 pm, [EMAIL PROTECTED] wrote: Hi Python experts! Please explain this behavior: nn=3*[[]] nn [[], [], []] mm=[[],[],[]] mm [[], [], []] Up till now, 'mm' and 'nn' look the same, right? Nope! mm[1].append(17) mm [[],

Re: initialized list: strange behavior

2008-11-25 Thread Benjamin Kaplan
On Tue, Nov 25, 2008 at 9:23 AM, Arnaud Delobelle [EMAIL PROTECTED]wrote: Jason Scheirer [EMAIL PROTECTED] writes: On Nov 24, 10:34 pm, [EMAIL PROTECTED] wrote: Hi Python experts! Please explain this behavior: nn=3*[[]] nn [[], [], []] mm=[[],[],[]] mm [[], [], []]

Re: How to get a directory file descriptor?

2008-11-25 Thread D'Arcy J.M. Cain
On Tue, 25 Nov 2008 16:02:56 +0800 Cong Ma [EMAIL PROTECTED] wrote: Can you give me some hint on getting a directory file descriptor in Python? for each in os.listdir(os.getcwd()): print each Your code fetches a bunch of strings representing file names in the working directory, which is

Re: initialized list: strange behavior

2008-11-25 Thread Steve Holden
Arnaud Delobelle wrote: Jason Scheirer [EMAIL PROTECTED] writes: On Nov 24, 10:34 pm, [EMAIL PROTECTED] wrote: Hi Python experts! Please explain this behavior: nn=3*[[]] nn [[], [], []] mm=[[],[],[]] mm [[], [], []] Up till now, 'mm' and 'nn' look the same, right? Nope!

Re: datetime objects and __new__()

2008-11-25 Thread Peter Otten
peter wrote: import datetime class ts(datetime.datetime): ... foo = 'bar' ... def __new__(cls, s): ... c = super(ts, cls) ... return c.fromtimestamp(s) ... t = ts(0) Traceback (most recent call last): File stdin, line 1, in module File stdin, line 5, in

SWIG vs. ctypes (Was: ANN: PyEnchant 1.5.0)

2008-11-25 Thread Roy Smith
In article [EMAIL PROTECTED], Ryan Kelly [EMAIL PROTECTED] wrote: * Migrated from SWIG to ctypes for the C binding: Ryan, I'm looking at a doing a Python wrapper for a C++ library. We've already done a Perl wrapper for this library using SWIG (I wasn't personally involved in that effort).

Re: datetime objects and __new__()

2008-11-25 Thread peter
On Nov 25, 3:46 pm, Peter Otten [EMAIL PROTECTED] wrote: peter wrote: import datetime class ts(datetime.datetime): ...     foo = 'bar' ...     def __new__(cls, s): ...         c = super(ts, cls) ...         return c.fromtimestamp(s) ... t = ts(0) Traceback (most recent call

any body know how to use winlike

2008-11-25 Thread Anuradha Jena
Hi, Any body know how to use winlike.If yes.Can s/he give a simple example of onEvent onClose functionally. Actually i am facing problem where. I have one page there if u click on a text Winlike window will open.After opening i want to print text value,it is not printing.i am calling

Re: SWIG vs. ctypes (Was: ANN: PyEnchant 1.5.0)

2008-11-25 Thread skip
Roy I'm debating whether I should do the Python version with SWIG or Roy ctypes. Unless your C++ library exports a C api I don't think you can use ctypes to make it available within Python. -- Skip Montanaro - [EMAIL PROTECTED] - http://smontanaro.dyndns.org/ --

Re: initialized list: strange behavior

2008-11-25 Thread alexander . genkin
The issue is exhausted in Python Library Reference, Chapter 3.6, so I should apologize for initial posting. All comments were helpful, though Arnaud and Steve are right that pass-by-anything is off the point. Thanks All! -- http://mail.python.org/mailman/listinfo/python-list

Re: SWIG vs. ctypes (Was: ANN: PyEnchant 1.5.0)

2008-11-25 Thread Diez B. Roggisch
Roy Smith wrote: In article [EMAIL PROTECTED], Ryan Kelly [EMAIL PROTECTED] wrote: * Migrated from SWIG to ctypes for the C binding: Ryan, I'm looking at a doing a Python wrapper for a C++ library. We've already done a Perl wrapper for this library using SWIG (I wasn't personally

Re: datetime objects and __new__()

2008-11-25 Thread Peter Otten
peter wrote: On Nov 25, 3:46 pm, Peter Otten [EMAIL PROTECTED] wrote: peter wrote: import datetime class ts(datetime.datetime): ...     foo = 'bar' ...     def __new__(cls, s): ...         c = super(ts, cls) ...         return c.fromtimestamp(s) ... t = ts(0) Traceback (most

end of print = lower productivity ?

2008-11-25 Thread cptnwillard
I want my productivity back. In Python 2.x, I could easily write things like -- print f / print add / print done -- to a lot of different places in my code, which allowed me to find bugs that I could not track otherwise. When I found out that f was not at fault, I could write -- print g -- to

Re: end of print = lower productivity ?

2008-11-25 Thread skip
Now the print statement disappeared, and I have to write print(f) instead. These parentheses not only take time to write, they also make me think twice about using print for debugging purposes. Pressing SHIFT then ( thenmakes the whole process quite a hassle.

Re: end of print = lower productivity ?

2008-11-25 Thread Diez B. Roggisch
[EMAIL PROTECTED] wrote: I want my productivity back. In Python 2.x, I could easily write things like -- print f / print add / print done -- to a lot of different places in my code, which allowed me to find bugs that I could not track otherwise. When I found out that f was not at fault, I

Re: datetime objects and __new__()

2008-11-25 Thread peter
On Nov 25, 4:39 pm, Peter Otten [EMAIL PROTECTED] wrote: peter wrote: On Nov 25, 3:46 pm, Peter Otten [EMAIL PROTECTED] wrote: peter wrote: import datetime class ts(datetime.datetime): ...     foo = 'bar' ...     def __new__(cls, s): ...         c = super(ts, cls) ...        

Re: initialized list: strange behavior

2008-11-25 Thread Arnaud Delobelle
Steve Holden [EMAIL PROTECTED] writes: Arnaud Delobelle wrote: Jason Scheirer [EMAIL PROTECTED] writes: Python is pass-by-reference, not pass-by-value. It's certainly not pass-by-reference, nor is it pass-by-value IMHO. Since no lists are being passed as arguments in these examples it's

Re: end of print = lower productivity ?

2008-11-25 Thread peter
On Nov 25, 4:44 pm, [EMAIL PROTECTED] wrote: I want my productivity back. In Python 2.x, I could easily write things like -- print f / print add / print done -- to a lot of different places in my code, which allowed me to find bugs that I could not track otherwise. When I found out that f

Re: end of print = lower productivity ?

2008-11-25 Thread cptnwillard
On Nov 25, 4:53 pm, Diez B. Roggisch [EMAIL PROTECTED] wrote: I used to use print a lot. Once I found import pdb; pdb.set_trace() I massively lost interest in it. And gained *much* more debugging power/productivity. In some cases, this is not discriminatory enough : there are simply too

Re: How to get a directory file descriptor?

2008-11-25 Thread Baptiste Carvello
Cong Ma a écrit : 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

Re: datetime objects and __new__()

2008-11-25 Thread Peter Otten
peter wrote: from datetime import * class TS(datetime): ...     def __new__(cls, ts): ...             return datetime.fromtimestamp(ts) ... TS(0) datetime.datetime(1970, 1, 1, 1, 0) works super() would be the most likely culprit. Yes, that works, except the returned object is

Re: end of print = lower productivity ?

2008-11-25 Thread cptnwillard
On Nov 25, 5:05 pm, peter [EMAIL PROTECTED] wrote: BUT you now can do p = print p(f) Voila, 4 keystrokes saved :-) All right. Let's talk about that. When I write print, it is both effortless and instantaneous : my hands do not move, a wave goes through my fingers, it all happens in a

Re: end of print = lower productivity ?

2008-11-25 Thread Johannes Bauer
[EMAIL PROTECTED] schrieb: I know it sounds ridiculous Not only that - it also sounds as if there's spring break in Trollland. Regards, Johannes -- Meine Gegenklage gegen dich lautet dann auf bewusste Verlogenheit, verlästerung von Gott, Bibel und mir und bewusster Blasphemie. --

Re: SWIG vs. ctypes (Was: ANN: PyEnchant 1.5.0)

2008-11-25 Thread cptnwillard
On Nov 25, 4:34 pm, Diez B. Roggisch [EMAIL PROTECTED] wrote: You can't use ctypes for C++, only for C-style APIs. Diez With some work, you can convert your C++ objects to PyObject* and then return the latter in a function with C bindings. --

Reg Expression - Get position of

2008-11-25 Thread M_H
Hey, I need the position of the last char Let's say I have a string mystr = mimetype=text/htmlcontent![CDATA[ I need the posistion of the (second sign) - so I can cut away the first part. The problem is that it can be like but also like or But it is def the quotes and the closing

confused about classes and tkinter object design

2008-11-25 Thread marc wyburn
Hi, I've created my first Tkinter GUI class which consists of some buttons that trigger functions. I have also created a tkFileDialog.askdirectory control to local a root folder for log files. I have several file paths that depend on the value of tkFileDialog.askdirectory should I create an

Re: end of print = lower productivity ?

2008-11-25 Thread Tim Chase
p = print p(f) Voila, 4 keystrokes saved :-) When I write print, it is both effortless and instantaneous : my hands do not move, a wave goes through my fingers, it all happens in a tenth of a second. Contrast this with what one has to go through to catch the SHIFT key, and then the ( : move

Re: Instance attributes vs method arguments

2008-11-25 Thread Bruno Desthuilliers
M.-A. Lemburg a écrit : (snip) It is always good practice to provide default values for instance variables in the class definition, both to enhance readability and to allow adding documentation regarding the variables, e.g. Your opinion. As far as I'm concerned, using class variables this way

Re: datetime objects and __new__()

2008-11-25 Thread peter
On Nov 25, 5:16 pm, Peter Otten [EMAIL PROTECTED] wrote: peter wrote: from datetime import * class TS(datetime): ...     def __new__(cls, ts): ...             return datetime.fromtimestamp(ts) ... TS(0) datetime.datetime(1970, 1, 1, 1, 0) works super() would be the most likely

Re: SWIG vs. ctypes (Was: ANN: PyEnchant 1.5.0)

2008-11-25 Thread Olivier Grisel
2008/11/25 [EMAIL PROTECTED]: On Nov 25, 4:34 pm, Diez B. Roggisch [EMAIL PROTECTED] wrote: You can't use ctypes for C++, only for C-style APIs. Diez With some work, you can convert your C++ objects to PyObject* and then return the latter in a function with C bindings. http://cython.org

encoding

2008-11-25 Thread luca72
hello i'm writing an irc client, i use for encoding the utf-8 but i never see all the typed sign in the correct way, anyone know the standard encodind for the irc channels? Regards Luca -- http://mail.python.org/mailman/listinfo/python-list

Enumerating k-segmentations of a sequence

2008-11-25 Thread bullockbefriending bard
I'm not sure if my terminology is precise enough, but what I want to do is: Given an ordered sequence of n items, enumerate all its possible k- segmentations. This is *not* the same as enumerating the k set partitions of the n items because I am only interested in those set partitions which

Re: encoding

2008-11-25 Thread Benjamin Kaplan
On Tue, Nov 25, 2008 at 11:53 AM, luca72 [EMAIL PROTECTED] wrote: hello i'm writing an irc client, i use for encoding the utf-8 but i never see all the typed sign in the correct way, anyone know the standard encodind for the irc channels? Regards Luca --

Re: Enumerating k-segmentations of a sequence

2008-11-25 Thread marek . rocki
bullockbefriending bard napisał(a): I'm not sure if my terminology is precise enough, but what I want to do is: Given an ordered sequence of n items, enumerate all its possible k- segmentations. This is *not* the same as enumerating the k set partitions of the n items because I am only

Re: end of print = lower productivity ?

2008-11-25 Thread George Sakkis
On Nov 25, 10:52 am, [EMAIL PROTECTED] wrote:     Now the print statement disappeared, and I have to write print(f)     instead. These parentheses not only take time to write, they also make     me think twice about using print for debugging purposes. Pressing     SHIFT then ( then

Re: end of print = lower productivity ?

2008-11-25 Thread Diez B. Roggisch
[EMAIL PROTECTED] wrote: On Nov 25, 4:53 pm, Diez B. Roggisch [EMAIL PROTECTED] wrote: I used to use print a lot. Once I found import pdb; pdb.set_trace() I massively lost interest in it. And gained *much* more debugging power/productivity. In some cases, this is not discriminatory

Re: encoding

2008-11-25 Thread Dotan Cohen
2008/11/25 Benjamin Kaplan [EMAIL PROTECTED]: On Tue, Nov 25, 2008 at 11:53 AM, luca72 [EMAIL PROTECTED] wrote: hello i'm writing an irc client, i use for encoding the utf-8 but i never see all the typed sign in the correct way, anyone know the standard encodind for the irc channels?

Re: Using dictionary to hold regex patterns?

2008-11-25 Thread Thomas Mlynarczyk
John Machin schrieb: No, complicated is more related to unused features. In the case of using an aeroplane to transport 3 passengers 10 km along the autobahn, you aren't using the radar, wheel-retractability, wings, pressurised cabin, etc. In your original notion of using a dict in your lexer,

Re: Enumerating k-segmentations of a sequence

2008-11-25 Thread Mark Dickinson
On Nov 25, 4:56 pm, bullockbefriending bard [EMAIL PROTECTED] wrote: I'm not sure if my terminology is precise enough, but what I want to do is: [snip problem description] Structural Recursion not being my strong point, any ideas on how to go about this would be much appreciated! If you have

Re: Enumerating k-segmentations of a sequence

2008-11-25 Thread Mark Dickinson
On Nov 25, 5:34 pm, Mark Dickinson [EMAIL PROTECTED] wrote: If you have Python 2.6 available, itertools.combination might be That should be itertools.combinations, of course. The idea is that to give a partition of e.g., a 5-element list into 3 nonempty pieces, all you have to do is say where

Re: Enumerating k-segmentations of a sequence

2008-11-25 Thread bearophileHUGS
My version: from itertools import combinations as xcombinations from itertools import izip, islice def xpairwise(iterable): # docs and doctests removed return izip(iterable, islice(iterable, 1, None)) def segmentations(seq, k): for comb in xcombinations(range(1, len(seq)), k-1):

Re: end of print = lower productivity ?

2008-11-25 Thread Arnaud Delobelle
Tim Chase [EMAIL PROTECTED] writes: p = print p(f) Voila, 4 keystrokes saved :-) When I write print, it is both effortless and instantaneous : my hands do not move, a wave goes through my fingers, it all happens in a tenth of a second. Contrast this with what one has to go through to

Re: Getting in to metaprogramming

2008-11-25 Thread Stef Mientki
Rafe wrote: On Nov 25, 5:41 pm, Aaron Brady [EMAIL PROTECTED] wrote: On Nov 25, 4:08 am, Rafe [EMAIL PROTECTED] wrote: Hi, In the name of self-education can anyone share some pointers, links, modules, etc that I might use to begin learning how to do some metaprogramming. That

Re: SWIG vs. ctypes (Was: ANN: PyEnchant 1.5.0)

2008-11-25 Thread Matthieu Brucher
Boost.Python is difficult to understand, far more than SWIG. It may be faster, but I don't think it is worth it ATM. Binding C++ classes with SWIG is really simple. Matthieu 2008/11/25 Olivier Grisel [EMAIL PROTECTED]: 2008/11/25 [EMAIL PROTECTED]: On Nov 25, 4:34 pm, Diez B. Roggisch [EMAIL

Re: Enumerating k-segmentations of a sequence

2008-11-25 Thread Arnaud Delobelle
bullockbefriending bard [EMAIL PROTECTED] writes: I'm not sure if my terminology is precise enough, but what I want to do is: Given an ordered sequence of n items, enumerate all its possible k- segmentations. This is *not* the same as enumerating the k set partitions of the n items

Re: Enumerating k-segmentations of a sequence

2008-11-25 Thread Gerard flanagan
bullockbefriending bard wrote: I'm not sure if my terminology is precise enough, but what I want to do is: Given an ordered sequence of n items, enumerate all its possible k- segmentations. This is *not* the same as enumerating the k set partitions of the n items because I am only interested

Re: Reg Expression - Get position of

2008-11-25 Thread Chris Rebert
On Tue, Nov 25, 2008 at 8:36 AM, M_H [EMAIL PROTECTED] wrote: Hey, I need the position of the last char Let's say I have a string mystr = mimetype=text/htmlcontent![CDATA[ I need the posistion of the (second sign) - so I can cut away the first part. The problem is that it can be

pyExcelerator: setting zoom of a worksheet

2008-11-25 Thread Frank
Hi everybody, I use pyExcelerator and am quite happy with it, except: I cannot find a option for setting the zoom of a particular worksheet. I am using pyExcelerator 0.6.3a which is the latest as far as i know. I already contacted the developer of pyExcelerator, he says there is a

Re: Module Structure/Import Design Problem

2008-11-25 Thread Bruno Desthuilliers
Rafe a écrit : On Nov 20, 2:06 pm, Arnaud Delobelle [EMAIL PROTECTED] wrote: (snip) Or (better IMHO) you can make types register themselves with the factory function (in which case it would have some state so it would make more sense to make it a factory object). Can you elaborate on what

Re: SWIG vs. ctypes (Was: ANN: PyEnchant 1.5.0)

2008-11-25 Thread Diez B. Roggisch
[EMAIL PROTECTED] schrieb: On Nov 25, 4:34 pm, Diez B. Roggisch [EMAIL PROTECTED] wrote: You can't use ctypes for C++, only for C-style APIs. Diez With some work, you can convert your C++ objects to PyObject* and then return the latter in a function with C bindings. Or you use SWIG or SIP

Re: end of print = lower productivity ?

2008-11-25 Thread Diez B. Roggisch
[EMAIL PROTECTED] schrieb: On Nov 25, 5:05 pm, peter [EMAIL PROTECTED] wrote: BUT you now can do p = print p(f) Voila, 4 keystrokes saved :-) All right. Let's talk about that. When I write print, it is both effortless and instantaneous : my hands do not move, a wave goes through my

Anyone heard of a good Voice Stress Analysis program

2008-11-25 Thread Daniel Folkes
Anyone heard of a good voice stress analysis program that was either: a) Written in python b) can be used by python? It would be a great help to me. Thanks, Dan Folkes http://danfolkes.com -- http://mail.python.org/mailman/listinfo/python-list

Re: confused about classes and tkinter object design

2008-11-25 Thread r
On Nov 25, 10:38 am, marc wyburn [EMAIL PROTECTED] wrote: Hi, I've created my first Tkinter GUI class which consists of some buttons that trigger functions.  I have also created a tkFileDialog.askdirectory control to local a root folder for log files. I have several file paths that depend

Re: zope vs openACS

2008-11-25 Thread Bruno Desthuilliers
Stefan Scholl a écrit : [EMAIL PROTECTED] [EMAIL PROTECTED] wrote: On Nov 19, 1:50 am, gavino [EMAIL PROTECTED] wrote: what is nicer about each? Yes. And No. Or maybe ? -- http://mail.python.org/mailman/listinfo/python-list

Re: confused about classes and tkinter object design

2008-11-25 Thread r
On Nov 25, 10:38 am, marc wyburn [EMAIL PROTECTED] wrote: Hi, I've created my first Tkinter GUI class which consists of some buttons that trigger functions.  I have also created a tkFileDialog.askdirectory control to local a root folder for log files. I have several file paths that depend

Re: How to get the class instance of a passed method ?

2008-11-25 Thread Bruno Desthuilliers
Arnaud Delobelle a écrit : (snip) .im_self will become example.method.__self__ and in python 3. But I can't see the equivalen of .im_class? At worst, you'll still have example.method.__self__.__class__ !-) -- http://mail.python.org/mailman/listinfo/python-list

Re: Reg Expression - Get position of

2008-11-25 Thread r
On Nov 25, 10:36 am, M_H [EMAIL PROTECTED] wrote: Hey, I need the position of the last char Let's say I have a string mystr =  mimetype=text/htmlcontent![CDATA[ I need the posistion of the (second sign) - so I can cut away the first part. The problem is that it can be like but also

Re: Module Structure/Import Design Problem

2008-11-25 Thread Arnaud Delobelle
Bruno Desthuilliers [EMAIL PROTECTED] writes: Rafe a écrit : On Nov 20, 2:06 pm, Arnaud Delobelle [EMAIL PROTECTED] wrote: (snip) Or (better IMHO) you can make types register themselves with the factory function (in which case it would have some state so it would make more sense to make it

Re: Problem with writing fast UDP server

2008-11-25 Thread Krzysztof Retel
On Nov 21, 6:55 pm, Greg Copeland [EMAIL PROTECTED] wrote: On Nov 21, 11:05 am, Krzysztof Retel [EMAIL PROTECTED] wrote: On Nov 21, 4:48 pm, Peter Pearson [EMAIL PROTECTED] wrote: On Fri, 21 Nov 2008 08:14:19 -0800 (PST), Krzysztof Retel wrote: I am not sure what do you mean by

Re: Getting in to metaprogramming

2008-11-25 Thread Aaron Brady
On Nov 25, 5:20 am, Michele Simionato [EMAIL PROTECTED] wrote: On Nov 25, 12:12 pm, Rafe [EMAIL PROTECTED] wrote: is it really as simple as gathering strings of code? Yes. Yes. Sort of like generating HTML or XML directly? Is there any other framework or pattern set that is worth

converting a string data to a float value for access database

2008-11-25 Thread [EMAIL PROTECTED]
Hi, I am trying to copy a sql database to a access database using python. I can copy all the fields, but the date. I can store a float value in access data object, ie http://en.wikibooks.org/wiki/JET_Database/Data_types#Dates_and_times So access uses a float for a date, and mysql databse uses

Re: confused about classes and tkinter object design

2008-11-25 Thread r
On Nov 25, 2:31 pm, r [EMAIL PROTECTED] wrote: On Nov 25, 10:38 am, marc wyburn [EMAIL PROTECTED] wrote: Hi, I've created my first Tkinter GUI class which consists of some buttons that trigger functions.  I have also created a tkFileDialog.askdirectory control to local a root folder

Re: SWIG vs. ctypes (Was: ANN: PyEnchant 1.5.0)

2008-11-25 Thread rfk
 I'd be interested to hear about your experiences with both and why you switched. Enchant has a pretty simple C API so the binding process was straightforward with both SWIG and ctypes. The only real trick was in passing python functions as callbacks to the C API, for which I found ctypes a

Re: Security implications of using open() on untrusted strings.

2008-11-25 Thread Jorgen Grahn
On Tue, 25 Nov 2008 20:40:57 +1300, Lawrence D'Oliveiro [EMAIL PROTECTED] wrote: Jorgen Grahn wrote: Seems to me you simply want to know beforehand that the reading will work. But you can never check that! You can stat(2) the file, or open-and-close it -- and then a microsecond later,

Re: end of print = lower productivity ?

2008-11-25 Thread Paul Rubin
[EMAIL PROTECTED] writes: BUT you now can do p = print p(f) All right. Let's talk about that. When I write print, it is both effortless and instantaneous : my hands do not move, a wave goes through my fingers, it all happens in a tenth of a second. Contrast this with what one has

Re: converting a string data to a float value for access database

2008-11-25 Thread M.-A. Lemburg
On 2008-11-25 22:37, [EMAIL PROTECTED] wrote: Hi, I am trying to copy a sql database to a access database using python. I can copy all the fields, but the date. I can store a float value in access data object, ie http://en.wikibooks.org/wiki/JET_Database/Data_types#Dates_and_times So

Re: What are the syntax for , ||

2008-11-25 Thread Andrew Koenig
Peter Otten [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] How do I do in Python? if condition1 and condition2: # doThis elif condition3 or condition4: # || doThat See the pattern? if condition1 and condition2: doThis elif condition3 or condition4: doThat --

Re: Getting in to metaprogramming

2008-11-25 Thread Arnaud Delobelle
Aaron Brady [EMAIL PROTECTED] writes: I don't know a clean, reliable way to structure a metaprogram though. Mine always turn out messy. I don't think Python is designed for large scale metaprogramming. Lisp is the only naturally suited language that I know. -- Arnaud --

Re: Security implications of using open() on untrusted strings.

2008-11-25 Thread Jorgen Grahn
On Tue, 25 Nov 2008 02:26:32 -0500, r0g [EMAIL PROTECTED] wrote: Jorgen Grahn wrote: ... Or am I missing something? No Jorgen, that's exactly what I needed to know i.e. that sending unfiltered text to open() is not negligent or likely to allow any badness to occur. As far as what I was

Re: pyExcelerator: setting zoom of a worksheet

2008-11-25 Thread John Machin
On Nov 26, 6:40 am, Frank [EMAIL PROTECTED] wrote: Hi everybody, I use pyExcelerator and am quite happy with it, except: I cannot find a option for setting the zoom of a particular worksheet. I am using pyExcelerator 0.6.3a which is the latest as far as i know. That is the latest released

Re: Reg Expression - Get position of

2008-11-25 Thread Jorgen Grahn
On Tue, 25 Nov 2008 12:41:53 -0800 (PST), r [EMAIL PROTECTED] wrote: On Nov 25, 10:36 am, M_H [EMAIL PROTECTED] wrote: Hey, I need the position of the last char Let's say I have a string mystr =  mimetype=text/htmlcontent![CDATA[ I need the posistion of the (second sign) - so I can cut

Re: Security implications of using open() on untrusted strings.

2008-11-25 Thread News123
Jorgen Grahn wrote: Compare with a language (does Perl allow this?) where if the string is rm -rf /|, open will run rm -rf / and start reading its output. *That* interface would have been Good example. (for perl): The problem doesn't exist in python open(rm -rf / |) would try to open a

  1   2   >