Re: closure = decorator?

2013-10-11 Thread Franck Ditter
nformation inside f.func_closure (or f.__closure__ in Python 3). > The part of the calling environment which is saved is y Shouldn't it be the (a,b) pair here ? But : >>> f.__closure__[0].cell_contents# access to what ? 55 Shouldn't cell_contents keep the current (a,b) pair, a part of the snapshot of the creation environment (private variables of the closure) ? Instead it seems to returns only a (which is the next production)... franck -- https://mail.python.org/mailman/listinfo/python-list

Re: Functional Programming and python

2013-09-30 Thread Franck Ditter
60). And don't answer with "good programmers don't use recursion", this is bullshit. 2. Lambda-expression body is limited to one expression. Why ? Why the hell those limitations ? In this aspect, Javascript has a cooler approach. franck -- https://mail.python.org/mailman/listinfo/python-list

Python toplevel in a Web page

2013-05-30 Thread Franck Ditter
then whose result is to be written in another text box. Simple, pythonistic. Thanks for the pointer, franck -- http://mail.python.org/mailman/listinfo/python-list

Re: ANN: Python training "text movies"

2013-01-21 Thread Franck Ditter
)) ; notation a+bi abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz I get this in foo.html (spaces missing) : > (define z (* 3+2i 1+i)) ; notation a+bi  abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz  franck -- http://mail.python.org/mailman/listinfo/python-list

Re: ANN: Python training "text movies"

2013-01-21 Thread Franck Ditter
We should be able to distinguish Arial type for usual text and fixed font for code. - Should have some colors. Wadda wadda yadda # blue annotation Cool and useful software, franck -- http://mail.python.org/mailman/listinfo/python-list

Re: ANN: Python training "text movies"

2013-01-20 Thread Franck Ditter
In article , Franck Ditter wrote: > In article , > Franck Ditter wrote: > > > In article , > > Mitya Sirenef wrote: > > > > > On 01/19/2013 04:32 AM, Franck Ditter wrote: > > > > In article , > > > > Mitya Sirenef wrote:

Re: ANN: Python training "text movies"

2013-01-20 Thread Franck Ditter
In article , Franck Ditter wrote: > In article , > Mitya Sirenef wrote: > > > On 01/19/2013 04:32 AM, Franck Ditter wrote: > > > In article , > > > Mitya Sirenef wrote: > > > > > >> On 01/14/2013 01:34 AM, Franck Ditter wrote:

Re: ANN: Python training "text movies"

2013-01-20 Thread Franck Ditter
In article , Mitya Sirenef wrote: > On 01/19/2013 04:32 AM, Franck Ditter wrote: > > In article , > > Mitya Sirenef wrote: > > > >> On 01/14/2013 01:34 AM, Franck Ditter wrote: > >>> In article , > >>>Jason Friedman wrote: > &

Re: ANN: Python training "text movies"

2013-01-19 Thread Franck Ditter
In article , Mitya Sirenef wrote: > On 01/14/2013 01:34 AM, Franck Ditter wrote: > > In article , > > Jason Friedman wrote: > > > >>> That is right; I would also add that it may be overwhelming for a newbie > >>> to be reading through a large &quo

Re: ANN: Python training "text movies"

2013-01-13 Thread Franck Ditter
nd the reference to the text displayed. Only "text"... How may we use the software which generates the Javascript ? Thanks, it's cool. franck -- http://mail.python.org/mailman/listinfo/python-list

Re: Problem with Unicode char in Python 3.3.0

2013-01-07 Thread Franck Ditter
In article , marduk wrote: > On Sun, Jan 6, 2013, at 11:43 AM, Franck Ditter wrote: > > Hi ! > > I work on MacOS-X Lion and IDLE/Python 3.3.0 > > I can't get the treble key (U1D11E) ! > > > > >>> "\U1D11E" > > SyntaxError: (

Problem with Unicode char in Python 3.3.0

2013-01-06 Thread Franck Ditter
Hi ! I work on MacOS-X Lion and IDLE/Python 3.3.0 I can't get the treble key (U1D11E) ! >>> "\U1D11E" SyntaxError: (unicode error) 'unicodeescape' codec can't decode bytes in position 0-6: end of string in escape sequence How can I display musi

getting the state of an object

2012-10-07 Thread Franck Ditter
order... Thanks a lot, franck -- http://mail.python.org/mailman/listinfo/python-list

question on log as an instance method

2012-10-07 Thread Franck Ditter
Question 2 : After importing math, why can't I consider log as an instance method, after all ? >>> (4).__log__() AttributeError: 'float' object has no attribute '__log__' Thanks for your answers. franck -- http://mail.python.org/mailman/listinfo/python-list

print or write on a text file ?

2012-09-28 Thread Franck Ditter
Hi ! Here is Python 3.3 Is it better in any way to use print(x,x,x,file='out') or out.write(x) ? Any reason to prefer any of them ? There should be a printlines, like readlines ? Thanks, franck -- http://mail.python.org/mailman/listinfo/python-list

Re: Reading a file in IDLE 3 on Mac-Lion

2012-09-22 Thread Franck Ditter
In article <505ccdc5$0$6919$e4fe5...@news2.news.xs4all.nl>, Hans Mulder wrote: > On 21/09/12 16:29:55, Franck Ditter wrote: > > I create a text file utf-8 encoded in Python 3 with IDLE (Mac Lion). > > It runs fine and creates the disk file, visible with > > TextWra

Reading a file in IDLE 3 on Mac-Lion

2012-09-21 Thread Franck Ditter
e tip, franck -- http://mail.python.org/mailman/listinfo/python-list

sum works in sequences (Python 3)

2012-09-19 Thread Franck Ditter
27;abc') would expand to 'a'+'b'+'c' And the error message is somewhat cryptic... franck -- http://mail.python.org/mailman/listinfo/python-list

Re: is implemented with id ?

2012-09-05 Thread Franck Ditter
Thanks to all, but : - I should have said that I work with Python 3. Does that matter ? - May I reformulate the queston : "a is b" and "id(a) == id(b)" both mean : "a et b share the same physical address". Is that True ? Thanks, franck In article , Benjamin K

is implemented with id ?

2012-09-04 Thread Franck Ditter
Hi ! a is b <==> id(a) == id(b) in builtin classes. Is that true ? Thanks, franck -- http://mail.python.org/mailman/listinfo/python-list

How to program test(expr) ?

2012-08-29 Thread Franck Ditter
ces at the toplevel : ? foo(5) x = 5 --> 6 I know I could put the expression e within a string, but is it possible to avoid the string, like a Lisp macro ? Thanks. franck -- http://mail.python.org/mailman/listinfo/python-list

when an iterable object is exhausted or not

2012-08-04 Thread Franck Ditter
x27;) $$$ for x in i : print(x,end=' ') 1 2 3 $$$ for x in i : print(x,end=' ')# i is exhausted $$$ IMHO, this should not happen in Py3k. What is the rationale of this (bad ?) design, which forces the programmer to memorize which one is exhaustable and which one is

Re: lambda in list comprehension acting funny

2012-07-11 Thread Franck Ditter
), they seem to know lambdas : #lang racket ;;; quick and dirty list comprehension syntax as a macro, for fun : (define-syntax-rule (list-of expr for x in L) (map (lambda (x) expr) L)) (list-of (sqr x) for x in (range 5)) --> (0 1 4 9 16) (define funcs (list-of (lambda (x) (expt x i)) f

How to launch idle -n on windows ?

2012-05-23 Thread Franck Ditter
I have some problems with Python 3.2 on Windows. I want to use the turtle package, works fine, but I can't close the turtle windows. On MacOS-X, I launch idle -n and it's fine. How can I do that on Windows ? Thanks, fd -- http://mail.python.org/mailman/listinfo/python-list

Installing pygame on MacOS-X Lion with Python 3.3

2012-05-01 Thread Franck Ditter
I can't get it working : "No pygame module"... Tried without success : pygame-1.9.2pre-py2.7-macosx10.7.mpkg.zip pygame-1.9.1release-python.org-32bit-py2.7-macosx10.3.dmg I am using Python 3 last version on MacOS-X Lion. Where is a step-by-step installation procedure ? Than

Re: Question on Python 3 shell restarting

2012-04-10 Thread Franck Ditter
s nothing except displaying a strange character inside a square), but that was refused "already in use"... franck P.S. There is no "configuration panel (Options -> Configure IDLE)", only a Preferences menu with a "Key" tab on MacOS-X. May I suggest to the P

Question on Python 3 shell restarting

2012-04-08 Thread Franck Ditter
How may I get a fresh Python shell with Idle 3.2 ? I have to run the same modules several times with all variables cleared. Thanks, franck -- http://mail.python.org/mailman/listinfo/python-list

Re: Buffering in Wing and IDLE 3

2012-03-08 Thread Franck Ditter
In article , Ned Deily wrote: > http://www.activestate.com/activetcl/downloads GREAT ! It seems to work. At least, I can now get the ~ char in France from within IDLE. A big step for manking :-) Thanks folks, franck -- http://mail.python.org/mailman/listinfo/python-list

Complexity question on Python 3 lists

2012-02-15 Thread Franck Ditter
== sdiv(n) def primes(n) : # n >= 2 """Returns the list of primes in [2,n]""" res = [] for k in range(2,n+1) : if isPrime(k) : res.append(k)# cost O(1) ? return res Thanks, franck -- http://mail.python.org/mailman/listinfo/python-list

Stopping a looping computation in IDLE 3.2.x

2012-02-11 Thread Franck Ditter
How do you stop a looping computation with IDLE 3.2.x on MacOS-X Lion ? It hangs with the colored wheel... Ctl-C does not work. Thanks, franck -- http://mail.python.org/mailman/listinfo/python-list

Buffering in Wing and IDLE 3

2012-02-01 Thread Franck Ditter
?? I would prefer to use IDLE but as we are in France, the Python team does not seem to be aware that the ~ and others are not available on MacOS-X here (probably the same in Europe)... franck -- http://mail.python.org/mailman/listinfo/python-list

Re: Can't get tilde character with IDLE 3.2.2 on French Mac Lion

2011-12-20 Thread Franck Ditter
Nope, "space" followed by "Shift-Option-N" gives a greek iota... I tried other combinations, unsuccessfully. IDLE 3 (French) seems to be unusable as we use many ~ in web applications :-( Should we hope a fix soon, or leave IDLE ? Thanks, franck In article , Ned Deily

Can't get tilde character with IDLE 3.2.2 on French Mac Lion

2011-12-19 Thread Franck Ditter
ual behavior is to merge lines of a paragraph. Thanks for help ! franck -- http://mail.python.org/mailman/listinfo/python-list

Re: PyPad 2.7.1 Update 4 (Python on iPad and iPhone)

2011-06-30 Thread Franck Ditter
Any Python 3 planned ? franck In article , AlienBaby wrote: > On Jun 23, 2:07 pm, Jon Dowdall > wrote: > > Hi All, > > > > I'm pleased to announce that PyPad (Python environment for iOS) 2.7.1 > > Update 4 is now available in the iTunes App Store. New

Python and Lisp : car and cdr

2011-06-17 Thread Franck Ditter
get a pointer to something inside L ? Is the above function length O(n) or probably O(n^2) ? Where are such implementation things (well) said ? Thanks, franck -- http://mail.python.org/mailman/listinfo/python-list

Python in CS1

2011-05-21 Thread Franck Ditter
Except at MIT, who knows some good CS1 references for teaching Python ? Thanks, franck -- http://mail.python.org/mailman/listinfo/python-list

Noob question on 2 vs 3 Python releases

2010-11-14 Thread Franck Ditter
your explanations... franck -- http://mail.python.org/mailman/listinfo/python-list

Re: [RELEASE] Python 2.7 release candidate 1 released

2010-06-06 Thread Franck Ditter
Just an advice as I see that "old" Python is maintained. When starting with Python (simple programs and GUIs) should I start with Python 3.x ? If it has a decent implementation on Mac/Linux/Windows of course... Thanks, franck -- http://mail.python.org/mailman/listinfo/python-list

Re: About the grammar

2010-04-19 Thread franck
>   File "", line 1 > SyntaxError: keyword can't be an expression Sure! So my surprise. But Martin did provide a very good explanation that this form in the grammar actually allows to avoid an ambiguity. Cheers, Franck -- http://mail.python.org/mailman/listinfo/python-list

Re: About the grammar

2010-04-19 Thread franck
Thank you for this very clear (and quick) explanation! :-) Cheers, Franck On 19 avr, 08:58, "Martin v. Loewis" wrote: > # The reason that keywords are test nodes instead of NAME is that using > # NAME results in an ambiguity. ast.c makes sure it's a NAME. > argument

About the grammar

2010-04-18 Thread franck
an an identifier. Moreover, in the Python language reference (see http://docs.python.org/reference/expressions.html#grammar-token-keyword_item) one can read: keyword_item ::= identifier "=" expression which is what I was expecting. Does any one knows why the grammar is so coded? A

Re: Pathological regular expression

2009-04-17 Thread franck
g a pathological regular expression, but rather a problem of the RE engine that is not optimized to use the faster approach when possible. This is well known problem very well explained on: http://swtch.com/~rsc/regexp/regexp1.html Cheers, Franck -- http://mail.python.org/mailman/listinfo/python-list

Re: Safe eval of insecure strings containing Python data structures?

2008-10-09 Thread franck
> I would like to parse arbitrary insecure text string containing nested > Python data structures in eval-compatible form:   Python 2.6 has ast.literal_eval to do exactly this. It handle lists, tuples, dict, numbers, strings, bool and None, with arbitrary nesting. Cheers, Franck -

Re: What AugStore and AugLoad AST nodes are?

2008-10-06 Thread franck
> They aren't used by the current implementation. OK, thanks! Franck -- http://mail.python.org/mailman/listinfo/python-list

What AugStore and AugLoad AST nodes are?

2008-10-06 Thread franck
Dear all, I'm experimenting with new ast module. I'd like to have pieces of code that can generate AugLoad and AugStore AST nodes. Indeed, I actually do not know what they correspond to. Thanks for any help! Franck -- http://mail.python.org/mailman/listinfo/python-list

Import text file

2008-06-05 Thread Franck Y
Hello, I have a text file where there is xxx=value yyy=value zzz=value etc... I would like use the from myfile import Since it has not the extension py how can i read it ? I know the way to do it with the open file but i think this one is easier... Thansk Franck -- http://mail.python.org

Better performance

2008-06-01 Thread Franck Y
Hello Folks, I am facing a problem where i need to parse around 200 files, i have a bit of knowledge in PHP/Perl/Python (the magic P :-P) Which one would you suggest me since i have to generate a web interface ? And each one has his area of 'work' Thanks for your help ! -- http://mail.python

Better performance

2008-06-01 Thread Franck Y
Hello Folks, I am facing a problem where i need to parse around 200 files, i have a bit of knowledge in PHP/Perl/Python (the magic P :-P) Which one would you suggest me since i have to generate a web interface ? And each one has his area of 'work' Thanks for your help ! -- http://mail.python

Proper way of handling "plug-in" methods

2007-01-08 Thread Franck PEREZ
since it is the same logic for me. Thanks very much in advance for your advice. Franck -- http://mail.python.org/mailman/listinfo/python-list

Re: how to traverse network devices in our system?

2006-05-18 Thread Franck Pommereau
rg.freedesktop.Hal.Manager') for udi in hal_manager.FindDeviceByCapability("net") : obj = system_bus.get_object("org.freedesktop.Hal", udi) dev = dbus.Interface(obj, 'org.freedesktop.Hal.Device') print dev.GetProperty("net.interface"),

[Off topic] Re: Backing Up VMWare

2006-04-11 Thread Franck Pommereau
t/reference/linux/loopback_linux.html Franck -- http://mail.python.org/mailman/listinfo/python-list

Re: Python / glade fundamentals

2006-03-20 Thread Franck Pommereau
> maybe you will find it easyer to use GladeGen to generate the > skeleton of your application rather then coding it yourself. Take a > look here: http://www.linuxjournal.com/article/7421 You may also use my PyGG module: http://freshmeat.net/projects/pygg Cheers, Franck

Re: The problem of anonymity with decorators

2006-02-08 Thread Franck Pommereau
Alex, Michele and Skip, Many thanks for your help, I should find my way by putting all these information together. Best regards, Franck -- http://mail.python.org/mailman/listinfo/python-list

The problem of anonymity with decorators

2006-02-07 Thread Franck Pommereau
essfully, to rename functions with: import new def rename (fun, name) : return new.function(fun.func_code, {}, name) So, my questions: - can I change a function name so that it affects the traceback when an exception is raised in the function? - is there some special trick to r

Re: Automatic class attribute

2006-02-03 Thread Franck PEREZ
On 2/3/06, Kirk McDonald <[EMAIL PROTECTED]> wrote: > Franck PEREZ wrote: > > Hello all, > > > > Considering the following code : > > > > class C(object): > >...: observers = [] > >...: > >...: @classmethod > >

Automatic class attribute

2006-02-03 Thread Franck PEREZ
y mean : "for each child class, automatically bind a new list attribute called observers" ? Are metaclasses a way ? Is it possible to avoid them ? Thanks a lot, Franck -- http://mail.python.org/mailman/listinfo/python-list

[ANN] XML Serializer module

2006-01-12 Thread Franck PEREZ
which are dumped, and the constructor values. In simple cases, the module finds out the constructor attributes by itself. You may download the module here, and see documentation and examples : http://eleves.ec-lille.fr/~perezf/python/ Any comment welcomed ! Franck -- http://mail.python.org/ma

Re: books: Dive into Python vs Beginning Python

2005-11-25 Thread Franck PEREZ
On 11/25/05, Sebastien Douche <[EMAIL PROTECTED]> wrote: > On 11/25/05, Franz Mueller <[EMAIL PROTECTED]> wrote: > > Hi, > > Hi Franz! :) > > > which of the following books would you recommend: > > "Dive into Python" or "Beginning Python: From Novice to Professional"? > > Both are very good books b

Re: Importing a class without knowing the module

2005-11-18 Thread Franck PEREZ
On 11/18/05, Mike Meyer <[EMAIL PROTECTED]> wrote: > [EMAIL PROTECTED] (Alex Martelli) writes: > > Mike Meyer <[EMAIL PROTECTED]> wrote: > >... > >> >> >> How about adding Foo.__file__ to the serialized data? > >... > >> >> depends on somewhere on it. You can use the module name if you have

Re: Importing a class without knowing the module

2005-11-17 Thread Franck PEREZ
I thought about it, but it would make the XML file depend on the machine... no more portability... On 11/18/05, Mike Meyer <[EMAIL PROTECTED]> wrote: > Franck PEREZ <[EMAIL PROTECTED]> writes: > > ### My test application > > class Foo(object): &

Importing a class without knowing the module

2005-11-17 Thread Franck PEREZ
in the "loads" method, but it was heavy and unsuccessful. Thanks a lot for your help ! Franck -- http://mail.python.org/mailman/listinfo/python-list

Re: Setting sizes of widgets (PyGTK)

2005-03-11 Thread Franck Pommereau
ck_start(hbox, False, False, 2) self.box.pack_start(self.output, False, False, 2) self.window.show_all() def main(self): gtk.main() a = Greeter() a.main() Cheers, Franck -- http://mail.python.org/mailman/listinfo/python-list

[PyGTK] Resizing a HandleBox

2005-02-21 Thread Franck Pommereau
Hi all, I'm using PyGTK-2.0.0, when I detach a HandleBox, the resizing of the newly created window is broken: it can be resized but it's content (the HandleBox and its child) is not affected at all and is not resized. Does any one have a solytion to this problem? Thanks in advan

[PyGTK] forbid focus of TreeView columns

2005-02-21 Thread Franck Pommereau
et but I could not find it anywhere (and neither could win.forall). I'm using PyGTK-2.0.0 and cannot use another version. Thanks in advance for any idea! Franck -- http://mail.python.org/mailman/listinfo/python-list