getting the state of an object511 (10/7/2012 8:50:38 AM) comp.lang.python 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 ...
... Franck
question on log as an instance method325 (10/7/2012 8:33:36 AM) comp.lang.python 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__(... Franck
print or write on a text file ?332 (9/28/2012 6:42:03 PM) comp.lang.python 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
... Franck
Reading a file in IDLE 3 on Mac-Lion613 (9/21/2012 2:29:55 PM) comp.lang.python 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).
... Franck
sum works in sequences (Python 3)1316 (9/19/2012 2:41:20 PM) comp.lang.python 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'
... Franck
How to program test(expr) ?225 (8/29/2012 3:04:05 PM) comp.lang.python 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 ?
# f... Franck
when an iterable object is exhausted or not615 (8/4/2012 7:20:36 PM) comp.lang.python 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
---... Franck
How to launch idle -n on windows ?021 (5/23/2012 12:04:44 PM) comp.lang.python 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 ? Th... Franck
Installing pygame on MacOS-X Lion with Python 3.3011 (5/1/2012 1:54:31 PM) comp.lang.python 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 ... Franck
Bootcamp on MacBook 13"246 (12/28/2010 10:40:32 AM) comp.sys.mac.misc Hi ! I just bought a new MacBook 13" with Snow Leopard. I partitionned then installed Windows XP-Pro SP2, and bootcamp from the Apple DVD (which says 3.1). I can't installe 3.2 32 bits bootcamp upgrade. It tell... franck8(37)
PyPad 2.7.1 Update 4 (Python on iPad and iPhone)212 (6/23/2011 1:07:35 PM) comp.lang.python 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 in this version is the ability to create custom modules. Modules can be in... newsgroup766(170)
scheme on ipad?740 (9/29/2011 11:44:07 AM) comp.lang.scheme Hello everyone! Today I install python on my ipad through cydia.So i think is it possible to install scheme on iOS?(mit-scheme is good). Does someone have idea about this? ... yuprincesay(1)
Buffering in Wing and IDLE 3417 (2/1/2012 3:17:39 PM) comp.lang.python 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() ... franck8(37)
scheme web programming554 (7/10/2012 10:54:56 PM) comp.lang.scheme anyone share what they are doing? how they are doing it? what they
like/dislike? about serving web apps with scheme? how they expoit 8
cpu boxes with scheme?
... gavcomedy(1610)
Reading a file in IDLE 3 on Mac-Lion613 (9/21/2012 2:29:55 PM) comp.lang.python 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).
... franck8(37)