Am 09.09.2011 07:47 schrieb Oliver:
class Container(object):
"""Container to store a number of non-overlapping rectangles."""
def __init__(self, xsize=1200, ysize=800):
super(Container, self).__init__(xsize, ysize)
And this is the nonsense: Container derives from object and
Hi,
Is there a recommended way for writing unittests of
SocketServer.StreamRequestHandler subclasses? I've tried making a
server stub class and a connection stub class with a recv() method
that immediately raises socket.error(errno.ECONNRESET, ).
This works OK, but it means that whatever unittest
On Sep 9, 3:29 am, Paul Watson wrote:
> I have read some of the talk around these two frameworks.
>
> Would you say that web2py is more geared toward the enterprise?
>
> Which one do you believe will be on Python 3 more quickly?
Both Django & web2py are good frameworks.
I have tried both of them
Thomas Rachel wrote:
> Am 09.09.2011 07:47 schrieb Oliver:
>> class Container(object):
>> """Container to store a number of non-overlapping rectangles."""
>> def __init__(self, xsize=1200, ysize=800):
>> super(Container, self).__init__(xsize, ysize)
>
> And this is the nonsense: Container derive
Cameron Simpson wrote:
> On 30Aug2011 14:13, Steven D'Aprano
> wrote:
> | On Tue, 30 Aug 2011 08:53 am Arnaud Delobelle wrote:
> | >> Yes, but if I am not mistaken, that will require me to put a line or
> | >> two after each os.system call. That's almost like whack-a-mole at the
> | >> code level
Am 09.09.2011 10:33 schrieb Steven D'Aprano:
Not nonsense. Merely a backward-incompatible change:
[1]
In Python 2.2, the default object constructor accepts, and ignores, any
parameters. In Python 2.3 on up, that becomes an error.
Thanks, I wasn't aware of that. My first contact with Pytho
Why are you trying to force a specific locale to your program
anyway?
Because I wish to be able to correctly sort Croatian names.
Well, all right. If you want to sort Croatian names from a program that
runs on an English (or whatever) system, then you will have to check the
platform and use a
Thomas Rachel wrote:
> Am 09.09.2011 07:47 schrieb Oliver:
>> class Container(object):
>> """Container to store a number of non-overlapping rectangles."""
>> def __init__(self, xsize=1200, ysize=800):
>> super(Container, self).__init__(xsize, ysize)
>
> And this is the nonsen
On Sep 9, 12:47 pm, Vineet wrote:
> On Sep 9, 3:29 am, Paul Watson wrote:
>
> > I have read some of the talk around these two frameworks.
>
> > Would you say that web2py is more geared toward the enterprise?
>
> > Which one do you believe will be on Python 3 more quickly?
>
> Both Django & web2py
On 9/09/11 11:07:24, Steven D'Aprano wrote:
Sure enough, I now have to hit Ctrl-C repeatedly, once per invocation of
script.py. While script.py is running, it receives the Ctrl-C, the calling
process does not.
You misinterpret what you are seeing: the calling process *does* receive
the ctrl-C,
Simon Cropper wrote:
> Certainly doable but
> considering the shear commonality of this task I don't understand why a
> simple script does not already exist - hence my original request for
> assistance.
I think you may have underestimated the complexity of the task in general.
To do it for a
Cameron Simpson wrote:
> About the only time I do this is my personal "the()" convenience
> function:
>
> def the(list, context=None):
> ''' Returns the first element of an iterable, but requires there to be
> exactly one.
> '''
> icontext="expected exactly one value"
>
On Fri, Sep 9, 2011 at 9:04 PM, Peter Otten <__pete...@web.de> wrote:
[x] = ""
> Traceback (most recent call last):
> File "", line 1, in
> ValueError: need more than 0 values to unpack
[x] = "a"
[x] = "ab"
> Traceback (most recent call last):
> File "", line 1, in
> ValueError:
http://123maza.com/65/clock747/
--
http://mail.python.org/mailman/listinfo/python-list
Hello friends,
How do we carry out the command "*cd ..*" in
python?
My problem is :
I have a set of folders say m=1,2,3,4. In each of these folders, I have
subfolders with common name say m_5,m_6,m_7,m_8. In each of these subfolder,
there is a file which I have edit.
Hans Mulder wrote:
> On 9/09/11 11:07:24, Steven D'Aprano wrote:
>> Sure enough, I now have to hit Ctrl-C repeatedly, once per invocation of
>> script.py. While script.py is running, it receives the Ctrl-C, the
>> calling process does not.
>
> You misinterpret what you are seeing: the calling pro
2011/9/9 kaustubh joshi :
> Hello friends,
> How do we carry out the command "cd .." in python?
>
> My problem is :
> I have a set of folders say m=1,2,3,4. In each of these folders, I have
> subfolders with common name say m_5,m_6,m_7,m_8. In each of these subfolder,
> the
kaustubh joshi wrote:
> Hello friends,
> How do we carry out the command "*cd ..*" in
> python?
import os
os.chdir('..')
But think carefully before doing this. Some functions may be confused if you
change directories while they are running. You may be better off staying
In article
,
aspineux wrote:
> On Sep 9, 12:49 am, Abhishek Pratap wrote:
> > 1. My input file is 10 GB.
> > 2. I want to open 10 file handles each handling 1 GB of the file
> > 3. Each file handle is processed in by an individual thread using the
> > same function ( so total 10 cores are assu
Steven D'Aprano wrote:
> Thomas Rachel wrote:
>
>> Am 09.09.2011 07:47 schrieb Oliver:
>>> class Container(object):
>>> """Container to store  a number of non-overlapping rectangles."""
>>> def __init__(self, xsize=1200, ysize=800):
>>> super(Container, self).__init__(xsize, ysize)
>>
>> And t
Duncan Booth wrote:
> Steven D'Aprano wrote:
>> In Python 2.2, the default object constructor accepts, and ignores, any
>> parameters. In Python 2.3 on up, that becomes an error.
>>
> More recently than that. It only became an error in 2.6:
For __init__, sure, but it was an error for __new__ b
I'm about to create a system which will need to allow hundreds of
users to create and maintain their own rules in a similar fashion to
MS Outlook rules. ie.
Each rule consists of one or more user configurable conditions and if/
when the conditions are met then one or more user configurable actions
You might want to have a look at this:
http://www.ccs.neu.edu/home/matthias/htdc.html
On Fri, Sep 9, 2011 at 2:37 AM, Chris Angelico wrote:
> On Fri, Sep 9, 2011 at 10:45 AM, Nobody wrote:
> > The Java compiler also acts as a "make" program. If it doesn't find
> > a .class file for a needed cla
Something like this?
http://stackoverflow.com/questions/387606/using-user-input-to-find-information-in-a-mysql-database
On Sat, Sep 10, 2011 at 12:29 AM, Brian wrote:
> I'm about to create a system which will need to allow hundreds of
> users to create and maintain their own rules in a similar f
Kayode: Are the number of pages in that tutorial planned?
:P
> On Sat, Sep 10, 2011 at 1:57 AM, Kayode Odeyemi wrote:
>> You might want to have a look at this:
>> http://www.ccs.neu.edu/home/matthias/htdc.html
>>
>> On Fri, Sep 9, 2011 at 2:37 AM, Chris Angelico wrote:
>>>
>>> On Fri, Sep 9, 20
Hi All
@Roy : split in unix sounds good but will it be as efficient as
opening 10 different file handles on a file. I haven't tried it so
just wondering if you have any experience with it.
Thanks for your input. Also I was not aware of the python's GIL limitation.
My application is not I/O boun
On 9/9/2011 1:47 AM, Oliver wrote:
If I want to run shapes.py I receive this error message:
Others have explained why code that ran once now does not.
class Container(object):
"""Container to store a number of non-overlapping rectangles."""
def __init__(self, xsize=1200, ysize=800
Hi,
I need a bit of help sorting this out...
I have a memory test script that is a bit of compiled C. The test itself
can only ever return a 0 or 1 exit code, this is explicitly coded and there
are no other options.
I also have a wrapper test script that calls the C program that should also
onl
On 9/9/2011 9:03 AM, Steven D'Aprano wrote:
kaustubh joshi wrote:
Hello friends,
How do we carry out the command "*cd ..*" in
python?
import os
os.chdir('..')
But think carefully before doing this. Some functions may be confused if you
change directories while they
I have not found binaries for this install. The page
http://www.python.org/download/windows/
takes me to
http://www.python.org/download/releases/
which goes to
http://www.python.org/download/releases/2.6.7/
Here are Gzip and Bzip tar balls. The readme files describe linux
builds and the content s
On Fri, Sep 9, 2011 at 15:04, ray wrote:
>
> I have not found binaries for this install. The page
> http://www.python.org/download/windows/
> takes me to
> http://www.python.org/download/releases/
> which goes to
> http://www.python.org/download/releases/2.6.7/
> Here are Gzip and Bzip tar balls.
On Sep 9, 2011 4:07 PM, "ray" wrote:
>
> I have not found binaries for this install. The page
> http://www.python.org/download/windows/
> takes me to
> http://www.python.org/download/releases/
> which goes to
> http://www.python.org/download/releases/2.6.7/
> Here are Gzip and Bzip tar balls. Th
On 9/9/2011 6:07 AM, kaustubh joshi wrote:
Hello friends,
How do we carry out the command "*cd ..*" in
python?
os.chdir, like so:
>>> os.getcwd()
'/home/tyler'
>>> os.chdir("../")
>>> os.getcwd()
'/home'
So you could do something like: os.chdir("../foo")
My problem
On 9/9/2011 2:04 PM, ray wrote:
I have not found binaries for this install. The page
http://www.python.org/download/windows/
takes me to
http://www.python.org/download/releases/
which goes to
http://www.python.org/download/releases/2.6.7/
Here are Gzip and Bzip tar balls. The readme files descr
Chris Torek wrote:
> (I have also never been sure whether something is going to raise
> an IOError or an OSError for various OS-related read or write
> operation failures -- such as exceeding a resource limit, for
> instance -- so most places that do I/O operations on OS files, I
> catch both. St
On 09Sep2011 22:16, Steven D'Aprano
wrote:
| Hans Mulder wrote:
| > On 9/09/11 11:07:24, Steven D'Aprano wrote:
| >> Sure enough, I now have to hit Ctrl-C repeatedly, once per invocation of
| >> script.py. While script.py is running, it receives the Ctrl-C, the
| >> calling process does not.
| >
The title should have been "can't generate list from iterator".
--
View this message in context:
http://old.nabble.com/can%27t-generate-iterator-from-list-tp32435519p32435569.html
Sent from the Python - python-list mailing list archive at Nabble.com.
--
http://mail.python.org/mailman/listinfo/
It is supposed to be possible to generate a list representation of any
iterator that produces a sequence of finite length, but this doesn't always
work. Here's a case where it does work:
Input:
from itertools import combinations
list(combinations(range(4),2))
Output:
[(0, 1), (0, 2), (0, 3), (
1. Can you post the code somewhere where it's indented properly?
(http://paste.pocoo.org/)
2. In the list example you call balls_in_numbered_boxes(2, [3,3,3]) but in the
interactive example you call balls_in_numbered_boxes(3,[3,3,3])
--
http://mail.python.org/mailman/listinfo/python-list
I'm using urllib2's urlopen function to post to a service which should
return a rather lengthy JSON object as the body of its response.
Here's the code:
{{{
ctype, body = encode_multipart(fields, files)
url = 'http://someservice:8080/path/to/resource'
headers = {'Content-Type': ctype, 'Content-Len
Dr. Phillip M. Feldman wrote:
>
> It is supposed to be possible to generate a list representation of any
> iterator that produces a sequence of finite length, but this doesn't
> always work. Here's a case where it does work:
>
> Input:
>
> from itertools import combinations
> list(combinations(
matt wrote:
> When I try to look at "resp_body" I get this error:
>
> IOError: [Errno 35] Resource temporarily unavailable
>
> I posted to the same URI using curl and it worked fine, so I don't
> think it has to do with the server.
Are your Python code and curl both using the same proxy? It may
Brian,
Thank you, that was great.
Ray Joseph, PE832 586-5854r...@aarden.us
Original Message Subject: Re: Installing 2.6 on Win 7From: Brian Curtin Date: Fri, September 09, 2011 3:14 pmTo: ray Cc: python-list@python.orgOn Fri, Sep 9,
Cameron Simpson wrote:
> On 09Sep2011 22:16, Steven D'Aprano
> wrote:
> | Hans Mulder wrote:
> | > On 9/09/11 11:07:24, Steven D'Aprano wrote:
> | >> Sure enough, I now have to hit Ctrl-C repeatedly, once per invocation
> | >> of script.py. While script.py is running, it receives the Ctrl-C, the
On Sat, Sep 10, 2011 at 11:25 AM, Steven D'Aprano
wrote:
>> This is implemented by calling the Standard C function system(), and
>> has the same limitations.
>>
>> and sure enough, "man 3 system" says:
>
> I don't consider having to look up documentation for a function in a
> completely differ
Hello all:
I'm curious if there are some good solutions for using Python in web
applications.
I'm not feeling particularly masochistic, so I do not want to develop
this project in PHP; essentially I'm looking to build a web-based MMO. I
know that you can use nginx with Python with servers lik
"Littlefield, Tyler" writes:
> I'm curious if there are some good solutions for using Python in web
> applications.
Start with:
http://docs.python.org/howto/webservers.html#frameworks>
http://wiki.python.org/moin/WebFrameworks>
and try your criteria against what you find there.
--
\ “As
Abhishek Pratap wrote:
>
>My application is not I/O bound as far as I can understand it. Each
>line is read and then processed independently of each other. May be
>this might sound I/O intensive as #N files will be read but I think if
>I have 10 processes running under a parent then it might not b
http://scummos.blogspot.com/2011/09/kdev-python-argument-type-guessing.html
I'm not used to big ide/rad for python... but I think this work is
excellent!
Are there alternatives (pydev? others?) capable of this sort of thinks (I
mean "guessing the type" and method autocomplete)
--
By ZeD
--
49 matches
Mail list logo