John Machin wrote:
reversed came later; returning an iterator rather than a list provides
more flexibility.
As in flexibility for the implementer, the day someone invents a sort
algorithm that doesn't have to look at all source items before it starts
producing output?
Because I fail to see
John Machin wrote:
and don't use the name of the built-in file function as one of your
own names
"file" is a type, not a function, and has been removed in 3.0.
given that "file" is hardly ever used in properly written Python 2 code
(if you need to check for file-like behaviour in Python 2, c
Gabriel Genellina wrote:
Could anyone point me to a good site for pearl compiler download.
Would be better to ask for it in a Perl group, don't you think?
Or a Pearl group, even:
http://www.irt.uni-hannover.de/pearl/pearl-gb.html
--
http://mail.python.org/mailman/listinfo/python-list
Peter Otten wrote:
++imanshu wrote:
I agree. Iterator is more flexible.
I disagree. Neither is more flexible. You can iter the list returned
by sorted and list the iter returned by reversed. Both do the minimum
work necessary. See below.
> Together and both might have returned the
thanks all,
>Yes. That's the exact purpose of the in-place operators when they deal with
>mutable objects. What else did you expect?
well, frankly I expected a |= b to mean exactly the same as a = a | b
regardless of the object type.
> The manual explicitly specifies that mutable objects may imp
Bruno Desthuilliers wrote:
Unless you have a really good reason to use an antiquated and deprecated
object model, use "new-style" classes (for a value of "new" being "now
many years old"):
the distinction is gone in 3.0, so can we please stop flaming people for
violating a crap rule that's q
akva wrote:
could you please refer me a link where this is specified? I couldn't
find it in python documentation
http://docs.python.org/ref/augassign.html
"An augmented assignment expression like x += 1 can be rewritten as x =
x + 1 to achieve a similar, but not exactly equal effect. In the
Bill Purcell said:
"... I was wondering what more experienced programmers think about what
languages are necessary to be able to handle most programming problems. ..."
Bill,
I have a similar length of experience with python to you. I look at
other languages from time to time but the only two
John Machin a écrit :
(snip)
A quick rule of thumb for Python: if your code looks ugly or strained
or awkward, it's probably also wrong.
+1 QOTW
--
http://mail.python.org/mailman/listinfo/python-list
Hi,
why is this code failing?
class B(object):
pass
B.testattr = property(lambda s:"hallo")
b = B()
b.testattr = "test"
Python 2.5.2 (r252:60911, Jul 31 2008, 17:28:52)
/tmp/python-14202ViU.py in ()
14 B.testattr = property(lambda s:"hallo")
15 b = B()
---> 16 b.testattr = "tes
Gregor Horvath schrieb:
why is this code failing?
OK I answer myself :-)
Because there is not fset function definied in the property.
I have to del the attr before rebinding the attributename to another object.
--
Greg
--
http://mail.python.org/mailman/listinfo/python-list
On Aug 22, 5:38 am, Gregor Horvath <[EMAIL PROTECTED]> wrote:
> why is this code failing?
>
> class B(object):
> pass
>
> B.testattr = property(lambda s:"hallo")
> b = B()
> b.testattr = "test"
First, property() only works when attached to classes, not instances.
So the assignment should be:
Raymond Hettinger a écrit :
On Aug 22, 5:38 am, Gregor Horvath <[EMAIL PROTECTED]> wrote:
why is this code failing?
class B(object):
pass
B.testattr = property(lambda s:"hallo")
b = B()
b.testattr = "test"
First, property() only works when attached to classes, not instances.
So the assi
On Aug 22, 12:12Â am, Saurabh Sharma <[EMAIL PROTECTED]> wrote:
> How can I run .exe file from my python script?
import os
os.startfile('file.exe')
The downside is that it doesn't work on the mac.. but it does work on
stuff like
os.startfile('notepad.txt')
I have been waiting for a good hacke
Hi all.
I've stumbled onto a python behavior that I don't understand at all.
Python 2.5.2 (r252:60911, Jul 31 2008, 17:28:52)
# function
def X(l=[]):
l.append(1)
print l
# first call of X
X()
[1]
#second call of X
X()
[1, 1]
Where does the list parameter 'l' live between the two succe
Fredrik Lundh a écrit :
Bruno Desthuilliers wrote:
Unless you have a really good reason to use an antiquated and
deprecated object model, use "new-style" classes (for a value of "new"
being "now many years old"):
the distinction is gone in 3.0,
Yeps, but not in 2.5.2, which is still the cu
On Aug 22, 11:13 am, Bart van Deenen
<[EMAIL PROTECTED]> wrote:
> Hi all.
>
> I've stumbled onto a python behavior that I don't understand at all.
>
> Python 2.5.2 (r252:60911, Jul 31 2008, 17:28:52)
>
> # function
> def X(l=[]):
> l.append(1)
> print l
>
> # first call of X
> X()
> [1]
>
> #
On Fri, 22 Aug 2008 11:13:52 +0200, Bart van Deenen wrote:
> I've stumbled onto a python behavior that I don't understand at all.
...
> Does anyone have any pointers to the language documentation where this
> behavior is described?
Yes, it's documented in FAQ:
http://www.python.org/doc/faq/gener
Hi
Thanks all for your answers. I figured your solution already, but now I
understand where the behavior is from. One question remains: can I find my
parameter 'l' somewhere? I looked in a lot of objects, but couldn't find it.
Thanks
Bart.
[EMAIL PROTECTED] wrote:
> On Aug 22, 11:13 am, Bar
Wojtek Walczak schrieb:
On Fri, 22 Aug 2008 11:13:52 +0200, Bart van Deenen wrote:
I've stumbled onto a python behavior that I don't understand at all.
...
Does anyone have any pointers to the language documentation where this behavior
is described?
Yes, it's documented in FAQ:
http://www.
Bart van Deenen a écrit :
(ot : please don't top post - corrected)
[EMAIL PROTECTED] wrote:
On Aug 22, 11:13 am, Bart van Deenen
<[EMAIL PROTECTED]> wrote:
# function def X(l=[]): l.append(1) print l
# first call of X X() [1]
#second call of X X() [1, 1]
Where does the list parameter 'l' li
On Fri, 22 Aug 2008 11:41:18 +0200, Bart van Deenen wrote:
> Thanks all for your answers. I figured your solution already, but now I
> understand where the behavior is from. One question remains: can I find my
> parameter 'l' somewhere? I looked in a lot of objects, but couldn't find it.
YOURFU
On Fri, 22 Aug 2008 11:42:03 +0200, Diez B. Roggisch wrote:
> It's amazing. I didn't analyse this properly, but IMHO this issue is the
> single most asked question (or rather the effects in produces) on this list.
>
> Maybe we should get *really* explicit in
>
> http://docs.python.org/tut/node6.h
Hello,
I am new in Python programming and I have the following problem:
I have a script in which I need to open an application (called from a batch
file - "trace.bat"). For this purpuse, I'm executing the following piece of
code:
Â
import os, win32process
from win32api import Sleep
from ctypes
Bruno Desthuilliers @ Thursday 21 August 2008 22:54:
> magloca a écrit :
>> Bruno Desthuilliers @ Thursday 21 August 2008 17:31:
>>
> If you mean "the exceptions *explicitely raised* by your code",
> then I agree. But with any generic enough code, documenting any
> possible exception
I am trying to take some data in file that looks like this
command colnum_1 columnum_2
and look for the command and then cange the value in the collum(word)
number indicated. I am under
the impression I need enumerate but I am not sure what to do with it
any help would be nice.
import sys
pa
On Aug 21, 3:57 pm, "Gabriel Genellina" <[EMAIL PROTECTED]>
wrote:
> En Thu, 21 Aug 2008 15:37:41 -0300, Brendan <[EMAIL PROTECTED]>
> escribi :
>
> > Is there any way to resume an https file download using urllib2 and an
> > HTTPBasicAuthHandler?
>
> You should provide the Range header (and prob
Hi,
I am trying to install the mechanize lib so I can use python to do
webbrowseing.
First I set up easy_install
When I ran the script, it download the files ok, then I got these
error messages
sun is not reganized as a internal command
I did a sercah on sun.* and the sercah came up empty, am I m
Le Thursday 21 August 2008 09:34:47 Bruno Desthuilliers, vous avez écrit :
> > The point
> > is that EAFP conflicts with the interest of reporting errors as soon
> > as possible (on which much has been written see, for instance Ch. 8 -
> > Defensive Programming in Code Complete),
>
> Defensive prog
> Biggest issue I have with Python is screen input and output. I am trying
> to master wxPython (and Tkinter) but find this aspect harder than it
> ought to be.
>
This is hardly an issue with Python. You'll run into it with all
languages. You think wxPython is hard to master ? You should try
writi
Hello,
I wrote aprogram that imports odbc and dbi. Originally I used PyWin,
but now I prefer IDLE for working in Windows. Anyway, when I start my
program from IDLE, it can't import the odbc and dbi modules. However,
when I restart the shell and type "import odbc" at the prompt by, I
don't get an e
[EMAIL PROTECTED] schrieb:
Hello,
I wrote aprogram that imports odbc and dbi. Originally I used PyWin,
but now I prefer IDLE for working in Windows. Anyway, when I start my
program from IDLE, it can't import the odbc and dbi modules. However,
when I restart the shell and type "import odbc" at th
On Aug 22, 1:14 pm, "[EMAIL PROTECTED]" <[EMAIL PROTECTED]> wrote:
> I am trying to take some data in file that looks like this
>
> command colnum_1 columnum_2
>
> and look for the command and then cange the value in the collum(word)
> number indicated. I am under
> the impression I need enumera
On Aug 21, 12:59 am, Steven D'Aprano <[EMAIL PROTECTED]
cybersource.com.au> wrote:
> On Wed, 20 Aug 2008 09:23:22 -0700, [EMAIL PROTECTED] wrote:
> > On Aug 19, 4:12 pm, Steven D'Aprano <[EMAIL PROTECTED]
> > cybersource.com.au> wrote:
> >> On Tue, 19 Aug 2008 11:07:39 -0700, [EMAIL PROTECTED] wrot
Maric Michaud a écrit :
Le Thursday 21 August 2008 09:34:47 Bruno Desthuilliers, vous avez écrit :
The point
is that EAFP conflicts with the interest of reporting errors as soon
as possible (on which much has been written see, for instance Ch. 8 -
Defensive Programming in Code Complete),
Defens
thanks!
--
http://mail.python.org/mailman/listinfo/python-list
why when I try to insert gridSizer to a panel which already inside
another panel the gridSizer doesn't work?
this is the code:
panel3= wx.Panel(self, -1, (0, 60), size=(400, 240) ,
style=wx.SIMPLE_BORDER);
panel3.SetBackgroundColour('#dadadb')
panel = wx.Panel(panel3, wx.ID_ANY, s
Thanks for the replies.
I am still wondering if C++ would be worth learning and I think it could be
answered by these three questions...
1. Are programs written in C++ better (in any form of the word) than
programs written in python or vise versa or equal?
2. Is compiled better than interpreted?
On Aug 21, 2:34 pm, Bruno Desthuilliers wrote:
> [EMAIL PROTECTED] a écrit :
>
>
>
> > On Aug 19, 4:12 pm, Steven D'Aprano <[EMAIL PROTECTED]
> > cybersource.com.au> wrote:
> >> On Tue, 19 Aug 2008 11:07:39 -0700, [EMAIL PROTECTED] wrote:
> >>> def do_something(filename):
> >>> if not os.acc
On 18 ago, 08:28, "Gabriel Genellina" <[EMAIL PROTECTED]> wrote:
> A package is a library, meant to be imported by some other code. Your main
> script (or the testing code) is a program, it uses (i.e. imports) the library.
You are right that a module is a library and its main use is to be
importe
On Aug 22, 2:09 pm, Gandalf <[EMAIL PROTECTED]> wrote:
> why when I try to insert gridSizer to a panel which already inside
> another panel the gridSizer doesn't work?
>
> this is the code:
>
> panel3= wx.Panel(self, -1, (0, 60), size=(400, 240) ,
> style=wx.SIMPLE_BORDER);
> panel3.SetBack
I'm trying to use codecs.open() and I see two issues when I pass
encoding='utf8':
1) Newlines are hardcoded to LINEFEED (ascii 10) instead of the
platform-specific byte(s).
import codecs
f = codecs.open('tmp.txt', 'w', encoding='utf8')
s = u'\u0391\u03b8\u03ae\u03bd\u03b1'
print >
On Fri, 22 Aug 2008 06:43:58 -0700 (PDT), Lie wrote:
> I think we should change except: into expect:, it would confuse less,
> would it? It signifies that the program expects so and so kinds of
> exceptional situations. The try: should also be changed to... perhaps
> in:, block:, onthiscode:, etc
Hello. Im a bit new to using Tkinter and im not a real pro in
programming itself... :P. Need some help here.
Problem 1:
How do I make something appear on 2 separate windows using Tkinter? By
this I mean that the format would be something like this:
You have Page1 : This has 2-3 buttons on it.
Cl
On Aug 15, 9:55 pm, Fredrik Lundh <[EMAIL PROTECTED]> wrote:
> Lie wrote:
> > When you've got a nested loop a StopIteration in the Inner Loop would
> > break the loop for the outer loop too:
>
> > a, b, c = [1, 2, 3], [1, 2, 3, 4], [1, 2, 3, 4, 5]
>
> > def looper(a, b, c):
> > for a_ in a:
> >
On Aug 22, 7:56 am, Chris <[EMAIL PROTECTED]> wrote:
> On Aug 22, 1:14 pm, "[EMAIL PROTECTED]" <[EMAIL PROTECTED]> wrote:
>
>
>
>
>
> > I am trying to take some data in file that looks like this
>
> > command colnum_1 columnum_2
>
> > and look for the command and then cange the value in the collu
Le Friday 22 August 2008 15:03:21 Bruno Desthuilliers, vous avez écrit :
> Maric Michaud a écrit :
> > Le Thursday 21 August 2008 09:34:47 Bruno Desthuilliers, vous avez écrit :
> >>> The point
> >>> is that EAFP conflicts with the interest of reporting errors as soon
> >>> as possible (on which mu
Sometimes it seems that barely a day goes by without some newbie, or not-
so-newbie, getting confused by the behaviour of functions with mutable
default arguments. No sooner does one thread finally, and painfully, fade
away than another one starts up.
I suggest that Python should raise warnings.
Chris:
> """Iterate over your input file, split the line into it's component
> parts
>and then lookup if the first element 'command' is contained in the
>replacement data and if so change the data.
>If you want all input to be saved into your output file, just
> dedent
>the 'outFile
Dennis Lee Bieber wrote:
On Thu, 21 Aug 2008 13:22:33 +0200, Gabriel Rossetti
<[EMAIL PROTECTED]> declaimed the following in
comp.lang.python:
have a solution? I have to create unique and temp. directories to use an
external program that creates a temp. file with the same name every
time, t
Steven D'Aprano schrieb:
Sometimes it seems that barely a day goes by without some newbie, or not-
so-newbie, getting confused by the behaviour of functions with mutable
default arguments. No sooner does one thread finally, and painfully, fade
away than another one starts up.
I suggest that P
Where can I find an explanation of how the new light dict views of
Python 3 are implemented (or what's the name of the C source file to
look inside for their implementation)?
Thank you,
bearophile
--
http://mail.python.org/mailman/listinfo/python-list
Steven D'Aprano wrote:
I suggest that Python should raise warnings.RuntimeWarning (or similar?)
when a function is defined with a default argument consisting of a list,
dict or set. (This is not meant as an exhaustive list of all possible
mutable types, but as the most common ones that I expect
On Thu, 21 Aug 2008 02:30:27 GMT, [EMAIL PROTECTED] wrote:
>On Wed, 20 Aug 2008 21:18:22 -0500, [EMAIL PROTECTED] (Rob Warnock) wrote:
>
>>Martin Gregorie <[EMAIL PROTECTED]> wrote:
>>+---
>>| I was fascinated, though by the designs of early assemblers: I first
>>| learnt Elliott ass
On Fri, Aug 22, 2008 at 08:17:27AM -0500, William Purcell wrote:
> I am still wondering if C++ would be worth learning and I think it could be
> answered by these three questions...
>
> 1. Are programs written in C++ better (in any form of the word) than
> programs written in python or vise versa
On Aug 22, 8:09 am, Gandalf <[EMAIL PROTECTED]> wrote:
> why when I try to insert gridSizer to a panel which already inside
> another panel the gridSizer doesn't work?
>
> this is the code:
>
>
I'm not sure how to do multiple panels like that. And I'm not really
sure what you're trying to achiev
On Aug 22, 8:51 am, Iain King <[EMAIL PROTECTED]> wrote:
> On Aug 22, 2:09 pm, Gandalf <[EMAIL PROTECTED]> wrote:
>
>
>
> > why when I try to insert gridSizer to a panel which already inside
> > another panel the gridSizer doesn't work?
>
> > this is the code:
>
> > panel3= wx.Panel(self, -1, (0, 6
Christian Heimes wrote:
> Steven D'Aprano wrote:
>> I suggest that Python should raise warnings.RuntimeWarning (or similar?)
>> when a function is defined with a default argument consisting of a list,
>> dict or set. (This is not meant as an exhaustive list of all possible
>> mutable types, but as
DrScheme is an implementation of Scheme that is very newbie-friendly.
It has several limited sub-languages, etc.
So maybe a command line option can be added to Python3 ( -
newbie ? :-) ) that just switches on similar warnings, to help newbies
(in schools, where there's a teacher that encourages to
George Sakkis wrote:
> I'm trying to use codecs.open() and I see two issues when I pass
> encoding='utf8':
>
> 1) Newlines are hardcoded to LINEFEED (ascii 10) instead of the
> platform-specific byte(s).
>
> import codecs
> f = codecs.open('tmp.txt', 'w', encoding='utf8')
> s = u'\u0
[EMAIL PROTECTED] wrote:
> DrScheme is an implementation of Scheme that is very newbie-friendly.
> It has several limited sub-languages, etc.
>
> So maybe a command line option can be added to Python3 ( -
> newbie ? :-) ) that just switches on similar warnings, to help newbies
> (in schools, wher
Diez B. Roggisch wrote:
> It's amazing. I didn't analyse this properly, but IMHO this issue is the
> single most asked question (or rather the effects in produces) on this
> list.
I feel a bit dumb to ask a FAQ on the newsgroup. The problem with this
particular question is that I found it hard to
hi william,
I am slightly more experienced in python than you (2 years to be presise).
Before this I handled pritty heavy as in coding and as in usage
projects in java.
Untill I came into the wonderful and powerful world of free software,
I programmed in c++ using borlands c++ compiler and IDE.
But
Hi
I'm trying to build a small application that can display some images
in a toplevel window. I have this code:
def Results(master):
from Tkinter import Toplevel, Button, Label
from PIL import ImageTk
figures = ['first.png', 'second.png']
ResultsWindow = Toplevel(master)
Res
Hi,
I want to manage and control access to several important attributes in
a class and override the behaviour of some of them in various
subclasses.
Below is a stripped version of how I've implemented this in my current
bit of work.
It works well enough, but I can't help feeling there a cleaner
On Aug 22, 11:18 am, David Moss <[EMAIL PROTECTED]> wrote:
> Hi,
>
> I want to manage and control access to several important attributes in
> a class and override the behaviour of some of them in various
> subclasses.
>
> Below is a stripped version of how I've implemented this in my current
> bit
On Aug 22, 9:42 am, Steven D'Aprano <[EMAIL PROTECTED]
cybersource.com.au> wrote:
> Sometimes it seems that barely a day goes by without some newbie, or not-
> so-newbie, getting confused by the behaviour of functions with mutable
> default arguments. No sooner does one thread finally, and painfull
En Fri, 22 Aug 2008 08:55:57 -0300, Brendan <[EMAIL PROTECTED]>
escribi�:
On Aug 21, 3:57 pm, "Gabriel Genellina" <[EMAIL PROTECTED]>
wrote:
En Thu, 21 Aug 2008 15:37:41 -0300, Brendan <[EMAIL PROTECTED]>
escribi :
> Is there any way to resume an https file download using urllib2 and an
I am considering using python as a replacement for a lot of bash
scripting that I have been doing. I would like to be as cross platform
as possible, writing scripts for both windows and linux. Are there any
guides are general rules of thumb on
1) keeping code os independant
2) nifty lambda's or oth
Thanks again for the replies.
I think that Python will solve about any problem that I will need to do in
some way or another. To give myself a better understanding of the computer
mechanism in general and to be more rounded, I think I need to dabble in a
lower language a little like C (and maybe o
I am contemplating the need for a way to handle high speed data
passing between two processes. One process would act as a queue that
would 'buffer' data coming from another processes. Seems that the
easiest way to handle the data would be to just pass pickles. Further,
I'm thinking that using a uni
On Aug 22, 11:17 am, "Krishnakant Mane" <[EMAIL PROTECTED]> wrote:
> hi william,
> I am slightly more experienced in python than you (2 years to be presise).
> Before this I handled pritty heavy as in coding and as in usage
> projects in java.
> Untill I came into the wonderful and powerful world o
On Fri, 2008-08-22 at 10:09 -0700, DwBear75 wrote:
> I am contemplating the need for a way to handle high speed data
> passing between two processes. One process would act as a queue that
> would 'buffer' data coming from another processes. Seems that the
> easiest way to handle the data would be t
En Fri, 22 Aug 2008 10:48:50 -0300, [EMAIL PROTECTED] <[EMAIL PROTECTED]>
escribió:
On 18 ago, 08:28, "Gabriel Genellina" <[EMAIL PROTECTED]> wrote:
A package is a library, meant to be imported by some other code. Your
main script (or the testing code) is a program, it uses (i.e. imports)
Gregor Horvath wrote:
Hi,
why is this code failing?
class B(object):
pass
B.testattr = property(lambda s:"hallo")
b = B()
b.testattr = "test"
Python 2.5.2 (r252:60911, Jul 31 2008, 17:28:52)
/tmp/python-14202ViU.py in ()
14 B.testattr = property(lambda s:"hallo")
15 b = B()
--
On Fri, 22 Aug 2008 00:35:31 -0700 (PDT), akva <[EMAIL PROTECTED]> wrote:
>
> well, frankly I expected a |= b to mean exactly the same as a = a | b
> regardless of the object type.
So did I. I'm glad your post called this to my attention; I
recently told my kid exactly that wrong thing.
--
To
On Aug 22, 12:09 pm, DwBear75 <[EMAIL PROTECTED]> wrote:
> I am contemplating the need for a way to handle high speed data
> passing between two processes. One process would act as a queue that
> would 'buffer' data coming from another processes. Seems that the
> easiest way to handle the data woul
I'd like to read and write the same socket in different threads.
one thread is only used to read from the socket, and the other is only
used to write to the socket.
But I always get a 10022 'Invalid argument' exception. Anyone knows why?
I'm using windows xp.
my source code is here:
http://pasteb
On Fri, Aug 22, 2008 at 12:18 PM, David Moss <[EMAIL PROTECTED]> wrote:
> Hi,
>
> I want to manage and control access to several important attributes in
> a class and override the behaviour of some of them in various
> subclasses.
>
> Below is a stripped version of how I've implemented this in my c
On Sat, 23 Aug 2008 01:47:23 +0800, Leo Jay <[EMAIL PROTECTED]> wrote:
I'd like to read and write the same socket in different threads.
one thread is only used to read from the socket, and the other is only
used to write to the socket.
But I always get a 10022 'Invalid argument' exception. Anyone
[EMAIL PROTECTED] wrote:
Where can I find an explanation of how the new light dict views of
Python 3 are implemented (or what's the name of the C source file to
look inside for their implementation)?
The views are implemented next to the dict object. Grepping for
PyTypeObject in
http://svn.pyt
On Aug 22, 12:18 pm, David Moss <[EMAIL PROTECTED]> wrote:
> Hi,
>
> I want to manage and control access to several important attributes in
> a class and override the behaviour of some of them in various
> subclasses.
>
> Below is a stripped version of how I've implemented this in my current
> bit
Steven D'Aprano wrote:
Sometimes it seems that barely a day goes by without some newbie, or not-
so-newbie, getting confused by the behaviour of functions with mutable
default arguments. No sooner does one thread finally, and painfully, fade
away than another one starts up.
I suggest that Pyt
On Aug 22, 4:09 pm, Christian Heimes <[EMAIL PROTECTED]> wrote:
> Steven D'Aprano wrote:
> > I suggest that Python should raise warnings.RuntimeWarning (or similar?)
> > when a function is defined with a default argument consisting of a list,
> > dict or set. (This is not meant as an exhaustive lis
David Moss wrote:
Hi,
I want to manage and control access to several important attributes in
a class and override the behaviour of some of them in various
subclasses.
Below is a stripped version of how I've implemented this in my current
bit of work.
It works well enough, but I can't help feel
On Sat, Aug 23, 2008 at 1:58 AM, Jean-Paul Calderone <[EMAIL PROTECTED]> wrote:
> On Sat, 23 Aug 2008 01:47:23 +0800, Leo Jay <[EMAIL PROTECTED]> wrote:
>>
>> I'd like to read and write the same socket in different threads.
>> one thread is only used to read from the socket, and the other is only
>
On Sat, 23 Aug 2008 02:25:17 +0800, Leo Jay <[EMAIL PROTECTED]> wrote:
On Sat, Aug 23, 2008 at 1:58 AM, Jean-Paul Calderone <[EMAIL PROTECTED]> wrote:
On Sat, 23 Aug 2008 01:47:23 +0800, Leo Jay <[EMAIL PROTECTED]> wrote:
I'd like to read and write the same socket in different threads.
one thr
MRAB wrote:
Could there be a new special method __mutable__?
Why should we add a new method?
Seriously, why should Python be cluttered and slowed down to warn about
mutable arguments. It's neither a design flaw nor a surprising feature
*ONCE* you have understood how functions work. I agree t
For references, you may use these PDF files (One URL changed since my
last time there, but it should be correct for now):
http://www.pythonware.com/media/data/an-introduction-to-tkinter.pdf
http://infohost.nmt.edu/tcc/help/pubs/tkinter/tkinter.pdf
(The first one may be useful for starting out)
I'l
Emile van Sebille schrieb:
Steven D'Aprano wrote:
Sometimes it seems that barely a day goes by without some newbie, or not-
so-newbie, getting confused by the behaviour of functions with mutable
default arguments. No sooner does one thread finally, and painfully,
fade away than another one sta
En Thu, 21 Aug 2008 14:48:45 -0300, magloca <[EMAIL PROTECTED]>
escribió:
Bruno Desthuilliers @ Thursday 21 August 2008 17:31:
Java's "checked exception" system has proven to be a total disaster.
Could you elaborate on that? I'm not disagreeing with you (or agreeing,
for that matter); I'd
Hi,
Do we have python one-liner like perl one-liner 'perl -e'??
Thanks,
Srini
Unlimited freedom, unlimited storage. Get it now, on
http://help.yahoo.com/l/in/yahoo/mail/yahoomail/tools/tools-08.html/
--
http://mail.python.org/mailman/listinfo/python-list
Is there a way to make a fake mouse or something like that? I'm
planning to create a frame with web open and then macro on it with
that fake mouse. And i want fake mouse so i can use my computer while
that fake mouse is doing its job.
--
http://mail.python.org/mailman/listinfo/python-list
Thanks. I tried to use 'for' instead of 'while' as both of you
suggested. It's running well as my previous version but breaks
completely instead of just skipping the empty file. I suspect the
reason is that this part is inside another 'for' so it stops
everything. I just want to it to break
Dennis Lee Bieber wrote:
On Thu, 21 Aug 2008 13:22:33 +0200, Gabriel Rossetti
<[EMAIL PROTECTED]> declaimed the following in
comp.lang.python:
have a solution? I have to create unique and temp. directories to use an
external program that creates a temp. file with the same name every
time, t
I'm looking on how to apply a regex on a pretty huge input text (a file
that's a couple of gigabytes). I found finditer which would return results
iteratively which is good but it looks like I still need to send a string
which would be bigger than my RAM. Is there a way to apply a regex directly
on
|Hi
Im trying to download a file from a server. But how do I detect EOF ?
||
import urllib2
f1 = urllib2.urlopen('ftp://username:[EMAIL PROTECTED]/data.zip')
f2 = file("data.zip", "wb")
while f1: # When to stop ?
f2.write(f1.read(1024))
f1.close()
f2.close()
||
I can get the size & us
On Fri, 22 Aug 2008 22:18:37 +0530, Anjanesh Lekshminarayanan wrote:
> Im trying to download a file from a server. But how do I detect EOF ?
Whenever read() method returns empty string/list.
> while f1: # When to stop ?
retval = f1.read()
if not retval:
break
f2.write(ret
On Fri, Aug 22, 2008 at 1:49 PM, Miles <[EMAIL PROTECTED]> wrote:
> from operator import attrgetter
> class attrsetter(object):
>def __init__(self, attr):
>self._attr = attr
>def __call__(self, object, value):
>setattr(object, self._attr, value)
This solution is very nice,
On Fri, 22 Aug 2008 10:42:13 -0400, Ben Keshet wrote:
> Thanks. I tried to use 'for' instead of 'while' as both of you
> suggested. It's running well as my previous version but breaks
> completely instead of just skipping the empty file. I suspect the
> reason is that this part is inside anot
1 - 100 of 170 matches
Mail list logo