Re: closure = decorator?

2013-10-11 Thread Franck Ditter
In article 5257c3dd$0$29984$c3e8da3$54964...@news.astraweb.com, Steven D'Aprano steve+comp.lang.pyt...@pearwood.info wrote: On Fri, 11 Oct 2013 10:14:29 +0300, Jussi Piitulainen wrote: Roy Smith writes: In article m2a9ihxf3a@cochabamba.vanoostrum.org, Piet van Oostrum wrote:

Re: Functional Programming and python

2013-09-30 Thread Franck Ditter
In article ba94102b-18b6-4850-ac85-032b0fe2f...@googlegroups.com, rusi rustompm...@gmail.com wrote: Combining your two questions -- Recently: What minimum should a person know before saying I know Python And earlier this On Sunday, August 4, 2013 10:00:35 PM UTC+5:30, Aseem Bansal wrote:

Python toplevel in a Web page

2013-05-30 Thread Franck Ditter
Hello, I wonder if I can find some source code example of a Python 3 toplevel box in a Web page. Something simple, no mySQL, no Django hammer, etc. Just the basics of the technology to get the content of a small text editor in which the user writes some Python script, to be analyzed (eval'ed) then

Re: ANN: Python training text movies

2013-01-21 Thread Franck Ditter
Ok I can make my way with jstmovie. Some remarks and questions : - Use encoding='utf-8' inside open of method __init__ of class Tutorial in jstmovie.py. Otherwise foreign languages are stuck. - To use the software outside Python, we need to have proper indentation as real spaces. We should

Re: ANN: Python training text movies

2013-01-21 Thread Franck Ditter
In article mailman.731.1358757093.2939.python-l...@python.org, Mitya Sirenef msire...@lightbird.net wrote: - To use the software outside Python, we need to have proper indentation as real spaces. We should be able to distinguish Arial type for usual text and fixed font for code.

Re: ANN: Python training text movies

2013-01-20 Thread Franck Ditter
In article mailman.696.1358622153.2939.python-l...@python.org, Mitya Sirenef msire...@lightbird.net wrote: On 01/19/2013 04:32 AM, Franck Ditter wrote: In article mailman.488.1358146579.2939.python-l...@python.org, Mitya Sirenef msire...@lightbird.net wrote: On 01/14/2013 01:34 AM

Re: ANN: Python training text movies

2013-01-20 Thread Franck Ditter
In article nobody-b6cd7f.18373820012...@news.free.fr, Franck Ditter nob...@nowhere.org wrote: In article mailman.696.1358622153.2939.python-l...@python.org, Mitya Sirenef msire...@lightbird.net wrote: On 01/19/2013 04:32 AM, Franck Ditter wrote: In article mailman.488.1358146579.2939

Re: ANN: Python training text movies

2013-01-20 Thread Franck Ditter
In article nobody-a71b2d.18413120012...@news.free.fr, Franck Ditter nob...@nowhere.org wrote: In article nobody-b6cd7f.18373820012...@news.free.fr, Franck Ditter nob...@nowhere.org wrote: In article mailman.696.1358622153.2939.python-l...@python.org, Mitya Sirenef msire

Re: ANN: Python training text movies

2013-01-19 Thread Franck Ditter
In article mailman.488.1358146579.2939.python-l...@python.org, Mitya Sirenef msire...@lightbird.net wrote: On 01/14/2013 01:34 AM, Franck Ditter wrote: In article mailman.469.1358088303.2939.python-l...@python.org, Jason Friedman ja...@powerpull.net wrote: That is right; I would also

Re: ANN: Python training text movies

2013-01-13 Thread Franck Ditter
In article mailman.469.1358088303.2939.python-l...@python.org, Jason Friedman ja...@powerpull.net wrote: That is right; I would also add that it may be overwhelming for a newbie to be reading through a large wall of text -- here you have blank space after the current paragraph so the

Re: Problem with Unicode char in Python 3.3.0

2013-01-07 Thread Franck Ditter
In article mailman.175.1357492817.2939.python-l...@python.org, marduk mar...@python.net 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: (unicode error

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 musical keys ? Thanks, franck --

question on log as an instance method

2012-10-07 Thread Franck Ditter
Hi ! Here is Python 3.2.3, MacOSX-Lion Question : I may consider + as an hidden instance method , as 1+2 is equivalent to (1).__add__(2) ? I also consider __abs__ as an instance method : (-2).__abs__() 2 Question 1 : could the parser cope with the mandatory space in 1 .__add__(2) ? Question 2

getting the state of an object

2012-10-07 Thread Franck Ditter
Hi ! Another question. When writing a class, I have often to destructure the state of an object as in : def foo(self) : (a,b,c,d) = (self.a,self.b,self.c,self.d) ... big code with a,b,c,d ... So I use the following method : def state(self) : return (self.a,self.b,self.c,self.d) so

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 han...@xs4all.nl 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 TextWrangler or another

Reading a file in IDLE 3 on Mac-Lion

2012-09-21 Thread Franck Ditter
Hello, 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 TextWrangler or another. But I can't open it with IDLE (its name is greyed). IDLE is supposed to read utf-8 files, no ? This works on Windows-7. Thanks for the tip,

sum works in sequences (Python 3)

2012-09-19 Thread Franck Ditter
Hello, I wonder why sum does not work on the string sequence in Python 3 : sum((8,5,9,3)) 25 sum([5,8,3,9,2]) 27 sum('rtarze') TypeError: unsupported operand type(s) for +: 'int' and 'str' I naively thought that sum('abc') would expand to 'a'+'b'+'c' And the error message is somewhat

is implemented with id ?

2012-09-05 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

Re: is implemented with id ?

2012-09-05 Thread Franck Ditter
...@python.org, Benjamin Kaplan benjamin.kap...@case.edu wrote: On Tue, Sep 4, 2012 at 11:30 PM, Franck Ditter fra...@ditter.org wrote: Hi ! a is b == id(a) == id(b) in builtin classes. Is that true ? Thanks, franck No. It is true that if a is b then id(a) == id(b) but the reverse

How to program test(expr) ?

2012-08-29 Thread Franck Ditter
Hi ! I use Python 3.2.3 + Idle. Is it possible to program test(e) which takes an expression e and whose execution produces at the toplevel an echo of e and the effects and result of its evaluation ? # file foo.py def foo(x) : print('x =',x) return x+1 test(foo(5)) # RUN ! # produces at the

when an iterable object is exhausted or not

2012-08-04 Thread Franck Ditter
Two similar iterable objects but with a different behavior : $$$ i = range(2,5) $$$ for x in i : print(x,end=' ') 2 3 4 $$$ for x in i : print(x,end=' ')# i is not exhausted 2 3 4 - Compare with : $$$ i = filter(lambda c : c.isdigit(), 'a1b2c3') $$$ for x in i :

Re: lambda in list comprehension acting funny

2012-07-12 Thread Franck Ditter
In article mailman.2007.1341988993.4697.python-l...@python.org, Daniel Fetchinson fetchin...@googlemail.com wrote: funcs = [ lambda x: x**i for i in range( 5 ) ] print funcs[0]( 2 ) print funcs[1]( 2 ) print funcs[2]( 2 ) This gives me 16 16 16 When I was excepting 1

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 ? Thanks, franck --

Re: Question on Python 3 shell restarting

2012-04-10 Thread Franck Ditter
In article 19745339.1683.1333981625966.JavaMail.geo-discussion-forums@yncc41, Miki Tebeka miki.teb...@gmail.com wrote: How may I get a fresh Python shell with Idle 3.2 ? Open the configuration panel (Options - Configure IDLE). Look in the Keys tab for the shortcut to restart-shell Fine,

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 mailman.390.1330912210.3037.python-l...@python.org, Ned Deily n...@acm.org 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 --

Complexity question on Python 3 lists

2012-02-15 Thread Franck Ditter
What is the cost of calling primes(n) below ? I'm mainly interested in knowing if the call to append is O(1), even amortized. Do lists in Python 3 behave like ArrayList in Java (if the capacity is full, then the array grows by more than 1 element) ? def sdiv(n) : # n = 2 returns the

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
Hi, I'm using Python 3.2.x with beginners. If I try the following in IDLE 3, it works as expected : from time import sleep import sys for i in range(4) : sys.stdout.write(str(i)) sys.stdout.flush() sleep(1) but with Wing-101, it write 0123 after the total sleep time. Why ??? I

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

2011-12-20 Thread Franck Ditter
...@python.org, Ned Deily n...@acm.org wrote: In article franck-6efd3c.10155219122...@news.free.fr, Franck Ditter fra...@ditter.org wrote: All is in the subject. I'm starting to use Python with Idle 3.2.2 on MacOS-X Lion (French). I can't get Option-N space to provide the ~ char. I tried

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

2011-12-19 Thread Franck Ditter
Hi ! All is in the subject. I'm starting to use Python with Idle 3.2.2 on MacOS-X Lion (French). I can't get Option-N space to provide the ~ char. I tried to go into the Keys preferences but I can't find Option-N space to modify its meaning. Its actual behavior is to merge lines of a paragraph.

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 b81ddfa6-053a-49a4-8431-889ef24eb...@y13g2000yqy.googlegroups.com, AlienBaby matt.j.war...@gmail.com wrote: On Jun 23, 2:07 pm, Jon Dowdall jon.dowdall+newsgr...@gmail.com wrote: Hi All, I'm pleased to announce that PyPad (Python

Python and Lisp : car and cdr

2011-06-17 Thread Franck Ditter
Hi, I'm just wondering about the complexity of some Python operations to mimic Lisp car and cdr in Python... def length(L) : if not L : return 0 return 1 + length(L[1:]) Should I think of the slice L[1:] as (cdr L) ? I mean, is the slice a copy of a segment of L, or do I actually get a

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
Pardon my noobness (?) but why is there a 2.x and 3.x development teams working concurrently in Python ? I hardly saw that in other languages. Which one should I choose to start with, to cope with the future ? Isn't 3.x supposed to extend 2.y ? This situation is very strange... Thanks for your

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