On Fri, 29 Aug 2008 21:26:35 -0700, cnb wrote:
> def averageGrade(self):
> tot = 0
> for review in self.reviews:
> tot += review.grade
> return tot / len(self.reviews)
>
> def av_grade(self):
> return sum(review.grade for review in self.reviews) / \
>
Carl Banks wrote:
I wouldn't say that the possibility of EAFP in Python makes it
obsolute to use LBYL.
when using CPython, EAFP at the Python level always involve LBYL at the
C level. and it should be obvious to any programmer that checking for
the same thing twice is quite often a waste of
En Sat, 30 Aug 2008 01:26:35 -0300, cnb <[EMAIL PROTECTED]> escribi�:
For a big nbr of it might matter?
Is av_grade O(n*2) and the first O(n) when it comes to adding or is
"sum x for x in y" just traversing the list ones, accumulating the
values, it doesnt first build the list and then travese
cnb wrote:
For a big nbr of it might matter?
Is av_grade O(n*2) and the first O(n) when it comes to adding or is
"sum x for x in y" just traversing the list ones, accumulating the
values, it doesnt first build the list and then travese it for sum?
sum() doesn't build a list, but even if it wo
On Aug 29, 11:25 pm, Uberman <[EMAIL PROTECTED]> wrote:
> On Fri, Aug 29, 2008 at 6:51 AM, Heston James <[EMAIL PROTECTED]> wrote:
> > Good afternoon all.
>
> > I have an application/script which is launched by crontab on a regular
> > basis. I need an effective and accurate way to ensure that only
On Aug 29, 10:30 pm, Tim Roberts <[EMAIL PROTECTED]> wrote:
> castironpi <[EMAIL PROTECTED]> wrote:
>
> >CMIIW correct me if I'm wrong, I don't think that pack_into returns a
> >value the way that pack does.
>
> Sorry, I was not aware that struct.pack_into and struct.unpack_from already
> existed (
For a big nbr of it might matter?
Is av_grade O(n*2) and the first O(n) when it comes to adding or is
"sum x for x in y" just traversing the list ones, accumulating the
values, it doesnt first build the list and then travese it for sum?
def averageGrade(self):
tot = 0
for review i
On Aug 29, 2:33 pm, "Chris Rebert" <[EMAIL PROTECTED]> wrote:
> On Fri, Aug 29, 2008 at 10:56 AM, cnb <[EMAIL PROTECTED]> wrote:
> > On Aug 29, 7:40 pm, Daniel <[EMAIL PROTECTED]> wrote:
> >> On Aug 29, 11:23 am, cnb <[EMAIL PROTECTED]> wrote:
>
> >> > If I get zero division error it is obv a poor
castironpi <[EMAIL PROTECTED]> wrote:
>
>CMIIW correct me if I'm wrong, I don't think that pack_into returns a
>value the way that pack does.
Sorry, I was not aware that struct.pack_into and struct.unpack_from already
existed (they were added in Python 2.5). I thought you were proposing them
as n
On Aug 30, 10:41 am, "W. eWatson" <[EMAIL PROTECTED]> wrote:
> What I'm trying to do is adjust date-time stamped file names for date and
> time errors. The software program collects through a period that roughly
> coincides with night hours every day and according to the OS clock. It
> sometimes h
On Aug 29, 7:23 am, cnb <[EMAIL PROTECTED]> wrote:
> If I get zero division error it is obv a poor solution to do try and
> except since it can be solved with an if-clause.
>
> However if a program runs out of memory I should just let it crash
> right? Because if not then I'd have to write exceptio
On Aug 29, 1:56 pm, cnb <[EMAIL PROTECTED]> wrote:
> On Aug 29, 7:40 pm, Daniel <[EMAIL PROTECTED]> wrote:
>
>
>
> > On Aug 29, 11:23 am, cnb <[EMAIL PROTECTED]> wrote:
>
> > > If I get zero division error it is obv a poor solution to do try and
> > > except since it can be solved with an if-clause
Neal Becker <[EMAIL PROTECTED]> writes:
> Does that provide semaphores between unrelated processes?
The threading module is just for threads of a single process.
There's an shm module that implements semaphores:
http://nikitathespider.com/python/shm/
--
http://mail.python.org/mailman/listinfo
In article <[EMAIL PROTECTED]>,
Gabriel Genellina <[EMAIL PROTECTED]> wrote:
>En Fri, 29 Aug 2008 14:41:53 -0300, Ron Brennan <[EMAIL PROTECTED]>
>escribi�:
>
>> I am trying to find the amount of values there are pertaining to one key.
>>
>> For example:
>>
>> - To find the average of the value
Thomas Heller wrote:
Paul McNett schrieb:
Anyone have anything to suggest on this error:
{{{
Traceback (most recent call last):
File "shutter_studio.py", line 41, in
File "App.pyo", line 25, in
File "ui\__init__.pyo", line 23, in
File "ui\FrmProductionOrders.pyo", line 10, in
John Machin wrote:
On Aug 30, 2:32 am, "W. eWatson" <[EMAIL PROTECTED]> wrote:
I just tried the following code, and got an unexpected result.
from pyfdate import *
t = Time()
ts = Time(2008, 8, 29,15,20,7)
tnew = ts.plus(months=6)
print "new date: ", tnew
Result:
new date: 2009-02-28 15:20:0
On Aug 29, 6:11 pm, "Diez B. Roggisch" <[EMAIL PROTECTED]> wrote:
> > That will mean that there will be no (easy?) way to determine after the
> > import whether the module was imported from a source file or a compiled
> > file. I've suggested that the original justification for the patch no
> > lon
[EMAIL PROTECTED] wrote:
On Fri, Aug 29, 2008 at 7:40 PM, Chris Rebert <[EMAIL PROTECTED]> wrote:
On Fri, Aug 29, 2008 at 11:25 AM, <[EMAIL PROTECTED]> wrote:
Hi,
I've a list some of whose elements with character \.
I want to delete this last character from the elements that have this
charact
Anyone know how to get ahold of Mark Hahn, the would-be creator of
next-generation Python? He had a language project called Prothon
(classless Python, or Python with Prototypes) a few years ago that was
being built upon the Apache Portable Runtime, using a stackless, 64-
bit architecture and nativ
In article <[EMAIL PROTECTED]>,
Timothy Grant <[EMAIL PROTECTED]> wrote:
>On Fri, Aug 29, 2008 at 3:38 PM, <[EMAIL PROTECTED]> wrote:
>>>Seriously, did you think we've hacked your computer and are spying on
>>>your web browsing? How would we know what web page you have visited?
>>
>> I was hoping
En Thu, 28 Aug 2008 02:52:42 -0300, Fredrik Lundh <[EMAIL PROTECTED]>
escribi�:
Asun Friere wrote:
Never ascribe to humour that which can be adequately explained by
increadible stupidity! On the other hand given up/down vs. high/low,
upper/downer might appear logical to someone who doesn't
On Fri, 29 Aug 2008 07:12:28 -0700, Mike Driscoll wrote:
> On Aug 28, 5:45 pm, Tyler Shopshire <[EMAIL PROTECTED]> wrote:
>> I can't seem to access the pydoc sever from my web browser. I start the
>> server from the command prompt and everything seems to be working fine,
>> then I got tohttp://loc
En Fri, 29 Aug 2008 14:41:53 -0300, Ron Brennan <[EMAIL PROTECTED]>
escribi�:
I am trying to find the amount of values there are pertaining to one key.
For example:
- To find the average of the values pertaining to the key.
- Use the amount of values to calculate a histogram
What is a "mul
On Aug 30, 2:32 am, "W. eWatson" <[EMAIL PROTECTED]> wrote:
> I just tried the following code, and got an unexpected result.
>
> from pyfdate import *
> t = Time()
>
> ts = Time(2008, 8, 29,15,20,7)
> tnew = ts.plus(months=6)
> print "new date: ", tnew
>
> Result:
> new date: 2009-02-28 15:20:07
>
Neal Becker wrote:
Does that provide semaphores between unrelated processes?
No, it just provides unshared semaphores. You can either create your own
Python extensions or you can use ctypes if you need a shared or named
semaphore.
Depending on your requirements you can choose between sem_in
walterbyrd wrote:
I have heard about Pysco. But does create a single executable that can
run without Python being installed? Or does that just compile the
libraries?
Psyco is a kind of JIT (just in time) optimizer for Python. It's limited
to i386 compatible CPUs (aka X86 architecture). It has
In article <[EMAIL PROTECTED]>,
Uberman <[EMAIL PROTECTED]> wrote:
>On Fri, Aug 29, 2008 at 6:51 AM, Heston James <[EMAIL PROTECTED]> wrote:
>> Good afternoon all.
>>
>> I have an application/script which is launched by crontab on a regular
>> basis. I need an effective and accurate way to ensure
Hi,
What you're probably referring to is py2exe tool (http://www.py2exe.org/) which
creates windows executable programs out of python scripts. Once created,
such executable can be run on a Windows machine without Python installed.
Psyco, on the other hand, is a tool that greatly optimizes and
inc
I have heard about Pysco. But does create a single executable that can
run without Python being installed? Or does that just compile the
libraries?
--
http://mail.python.org/mailman/listinfo/python-list
Christian Heimes wrote:
> Neal Becker wrote:
>> Is there a posix semaphore wrapper for python?
>>
>> Would that be a good addition?
>
> The threading module provides a high level interface to native
> semaphores, e.g. pthread.
>
> Christian
>
Does that provide semaphores between unrelated pro
On Fri, Aug 29, 2008 at 3:38 PM, <[EMAIL PROTECTED]> wrote:
>>Seriously, did you think we've hacked your computer and are spying on
>>your web browsing? How would we know what web page you have visited?
>
> I was hoping someone would give me a page add where such code could be
> found.
> Thanks fo
On Aug 30, 6:18 am, Patrick Maupin <[EMAIL PROTECTED]> wrote:
> On Aug 29, 4:24 am, Peter Otten <[EMAIL PROTECTED]> wrote:
>
>
>
> > A minimal example is
>
> > >>> class Complex(complex):
>
> > ... def __radd__(self, other): print "radd"
> > ...>>> 1j + Complex()
>
> > 1j
>
> > versus
>
> > >>>
On Aug 29, 5:10 pm, SUBHABRATA <[EMAIL PROTECTED]> wrote:
> Dear group,
> Thanx for your idea to use dictionary instead of a list. Your code is
> more or less, OK, some problems are there, I'll debug them. Well, I
> feel the insert problem is coming because of the Hindi thing.
It's nothing to do w
Vinay Sajip schrieb:
> On Aug 27, 11:28 am, Thomas Heller <[EMAIL PROTECTED]> wrote:
>>
>> I came up with a workaround that seems to do what I want. I add a NULL
>> handler
>> to my top-level logger which is not the root logger but a logger named
>> 'comtypes',
>> other loggers are named 'comtyp
On Aug 29, 1:15 pm, Paul Boddie <[EMAIL PROTECTED]> wrote:
> On 29 Aug, 19:08, Daniel <[EMAIL PROTECTED]> wrote:
>
>
>
>
>
> > I have tried running both commands above from the mypackage directory
> > and unittests directory. I get the following response universtally.
>
> > C:\mypackage>dir
> > V
Neal Becker wrote:
Is there a posix semaphore wrapper for python?
Would that be a good addition?
The threading module provides a high level interface to native
semaphores, e.g. pthread.
Christian
--
http://mail.python.org/mailman/listinfo/python-list
Paul McNett schrieb:
> Anyone have anything to suggest on this error:
>
> {{{
> Traceback (most recent call last):
>File "shutter_studio.py", line 41, in
>File "App.pyo", line 25, in
>File "ui\__init__.pyo", line 23, in
>File "ui\FrmProductionOrders.pyo", line 10, in
>File
I know this isn't the right mailing list, but it saves me the hassle
of signing up for another one if someone on here knows. I have never
used pyGoogle before, and I just read that google isn't giving out
license keys anymore? If that is the case, can I still get pygoogle to
work another wa
On Fri, Aug 29, 2008 at 6:51 AM, Heston James <[EMAIL PROTECTED]> wrote:
> Good afternoon all.
>
> I have an application/script which is launched by crontab on a regular
> basis. I need an effective and accurate way to ensure that only one instance
> of the script is running at any one time.
You c
Is there a posix semaphore wrapper for python?
Would that be a good addition?
--
http://mail.python.org/mailman/listinfo/python-list
On Fri, Aug 29, 2008 at 07:37:50PM +, Steven D'Aprano wrote:
> On Fri, 29 Aug 2008 14:46:53 -0400, Derek Martin wrote:
>
> > On Fri, Aug 29, 2008 at 07:28:40PM +0100, [EMAIL PROTECTED] wrote:
> >> dirListFinal = []
> >> for item in dirList:
> >>print item
> >>if item.en
On Fri, 29 Aug 2008 09:40:32 -0700, W. eWatson wrote:
> Actually, I'm getting the file names from listdir, and they appear to be
> sorted low to high. I tried it on a folder with lots of dissimilar
> files.
But that's not guaranteed. It depends on the operating system and file
system driver if
Hi john.
Thanks for your reply. I tried your suggestion of using RobustFactory, and
still get a badly maligned html back!!! The html is listed below. I would
have thought that the mech process, would have interpreted the
"http-equiv="refresh" Unfortunately, mechanize apparently isn't able to
handl
On Fri, Aug 29, 2008 at 6:51 AM, Heston James <[EMAIL PROTECTED]> wrote:
> Good afternoon all.
>
> I have an application/script which is launched by crontab on a regular
> basis. I need an effective and accurate way to ensure that only one instance
> of the script is running at any one time.
>
> Af
Anyone have anything to suggest on this error:
{{{
Traceback (most recent call last):
File "shutter_studio.py", line 41, in
File "App.pyo", line 25, in
File "ui\__init__.pyo", line 23, in
File "ui\FrmProductionOrders.pyo", line 10, in
File "ui\PagEditProductionOrders.pyo", line 8, i
On Fri, Aug 29, 2008 at 12:48 AM, Alexis Boutillier
<[EMAIL PROTECTED]> wrote:
> Timothy Grant a écrit :
>>
>> On Thu, Aug 28, 2008 at 1:40 AM, Alexis Boutillier
>> <[EMAIL PROTECTED]> wrote:
>>>
>>> Timothy Grant a écrit :
On Wed, Aug 27, 2008 at 2:49 AM, Alexis Boutillier
<[EMAIL P
On Fri, Aug 29, 2008 at 8:37 PM, Steven D'Aprano
<[EMAIL PROTECTED]> wrote:
> On Fri, 29 Aug 2008 14:46:53 -0400, Derek Martin wrote:
>
>> On Fri, Aug 29, 2008 at 07:28:40PM +0100, [EMAIL PROTECTED] wrote:
>>> dirListFinal = []
>>> for item in dirList:
>>>print item
>>>if it
On Aug 29, 3:51 pm, "Diez B. Roggisch" <[EMAIL PROTECTED]> wrote:
> Macygasp wrote:
> > Hi,
>
> > Can anybody tell me why and how this is working:
>
> ','.join(str(a) for a in range(0,10))
> > '0,1,2,3,4,5,6,7,8,9'
>
> > I find this a little weird because join takes a sequence as argument;
> >
Steven D'Aprano wrote:
On Thu, 28 Aug 2008 16:28:03 -0700, Paul McNett wrote:
[EMAIL PROTECTED] wrote:
x=[1,2,3]
and
x=[1,2,3,]
are exactly the same, right?
When confronted with this type of question, I ask the interpreter:
{{{
mac:~ pmcnett$ python
Python 2.5.2 (r252:60911, Feb 22 2008, 07
Glenn Hutchings wrote:
Have you checked memory usage while your program is running? Your
lines = f.readlines()[2:]
statement will need almost twice the memory of your largest file.
footnote: list objects contain references to string objects, not the
strings themselves. the above tempo
On Fri, 29 Aug 2008 14:46:53 -0400, Derek Martin wrote:
> On Fri, Aug 29, 2008 at 07:28:40PM +0100, [EMAIL PROTECTED] wrote:
>> dirListFinal = []
>> for item in dirList:
>>print item
>>if item.endswith('\\') == True:
>
> if item[-1] == '\\':
Which will fail b
dieter wrote:
Any Ideas? Is there a buffer limitation? Do you think it could be the
filesystem?
what does "ulimit -a" say?
--
http://mail.python.org/mailman/listinfo/python-list
On Fri, 29 Aug 2008, bruce wrote:
[...]
does the page (test.html) need to be completely valid html?
No, but there are certainly (poorly-defined) limitations.
I haven't tried to understand your script or the HTML, but did you try
this:
br = mechanize.Browser(mechanize.RobustFactory())
...
On 28 Aug, 07:30, dieter <[EMAIL PROTECTED]> wrote:
>
> I'm doing some simple file manipulation work and the process gets
> "Killed" everytime I run it. No traceback, no segfault... just the
> word "Killed" in the bash shell and the process ends. The first few
> batch runs would only succeed with o
On Aug 29, 1:51 pm, Fett <[EMAIL PROTECTED]> wrote:
> > Your way of thinking is similar to Microsoft's. Encrypting and Signing
> > is a kludge, a real fix should fix the underlying cause. Anyway using
> > data parsers isn't that much harder than using eval/exec.
>
> While I agree that in this situa
On 29 Aug, 19:08, Daniel <[EMAIL PROTECTED]> wrote:
>
> I have tried running both commands above from the mypackage directory
> and unittests directory. I get the following response universtally.
>
> C:\mypackage>dir
> Volume in drive C is Default
>
> Directory of C:\mypackage
>
> 08/29/2008 11
[EMAIL PROTECTED] wrote:
There is just a single \ at the end of every item. My list is as below:
['Results v1.0/', 'Results v1.1/']
so,
if x.endswith('\\'):
is that correct?
if your list contains forward slashes, maybe you should test for forward
slashes and not backward slashes.
--
ht
dieter <[EMAIL PROTECTED]> writes:
> I'm doing some simple file manipulation work and the process gets
> "Killed" everytime I run it. No traceback, no segfault... just the
> word "Killed" in the bash shell and the process ends. The first few
> batch runs would only succeed with one or two files be
cnb,
That is on of the things i want to fix with this code. I meant to mention in
my original post that i've only been
programming with Python for a little over two weeks. The only other experience
with programming i've had is with Basic
on my TI-83 calculator in high school. This isn't my ex
Kevin McKinley wrote:
> # I posted a few days ago about a memory leak that I think i'm having
> # with my first Tkinter program. I've had trouble pinpointing what is
> # wrong so i thought i would submit the code and see if anyone would like
> # to critique it.
Don't create new widgets every
On Fri, Aug 29, 2008 at 7:59 PM, <[EMAIL PROTECTED]> wrote:
> On Fri, Aug 29, 2008 at 7:41 PM, Mike Driscoll <[EMAIL PROTECTED]> wrote:
>> On Aug 29, 1:28 pm, [EMAIL PROTECTED] wrote:
>>> Sorry : Earlier mail had a typo in Subject line which might look
>>> in-appropriate to my friends
>>>
>>> Hi,
[EMAIL PROTECTED] wrote:
Hi,
I've a list some of whose elements with character \.
I want to delete this last character from the elements that have this
character set at their end,
I don't understand this. Give an example of input and expected output.
I have written a small program, unfort
On Fri, Aug 29, 2008 at 7:41 PM, Mike Driscoll <[EMAIL PROTECTED]> wrote:
> On Aug 29, 1:28 pm, [EMAIL PROTECTED] wrote:
>> Sorry : Earlier mail had a typo in Subject line which might look
>> in-appropriate to my friends
>>
>> Hi,
>>
>> I've a list some of whose elements with character \.
>> I want
cnb wrote:
In median grade, can I sort on Review-grade somehow?
Google "Python sort key attribute"
the first hit (after your post) is http://wiki.python.org/moin/HowTo/Sorting
Find 'attribute' on that page for your answer (two options).
--
http://mail.python.org/mailman/listinfo/python-list
> Your way of thinking is similar to Microsoft's. Encrypting and Signing
> is a kludge, a real fix should fix the underlying cause. Anyway using
> data parsers isn't that much harder than using eval/exec.
While I agree that in this situation I should do both, what would you
propose for cases where
[EMAIL PROTECTED] wrote:
I've a list some of whose elements with character \.
I want to delete this last character from the elements that have this
character set at their end,
I have written a small program, unfortunately this does not work:
dirListFinal = []
for item in dirList:
pr
It's worth noting that Ubuntu's creator is a fan of python.
So it comes as no surprise that the distribution has a lot of
components written in this language.
Also, and as far as I know, the use of python is encouraged for making
contributions.
On Aug 29, 11:57 am, azrael <[EMAIL PROTECTED]> wrot
On Fri, Aug 29, 2008 at 7:40 PM, Chris Rebert <[EMAIL PROTECTED]> wrote:
> On Fri, Aug 29, 2008 at 11:25 AM, <[EMAIL PROTECTED]> wrote:
>> Hi,
>>
>> I've a list some of whose elements with character \.
>> I want to delete this last character from the elements that have this
>> character set at the
Just use the "key" argument to list.sort; e.g.
class Foo(object):
def __init__(self, x):
self.x = x
def __repr__(self):
return "Foo:"+str(self.x)
foos = [Foo(75), Foo(10), Foo(-1)]
foos.sort(key = lambda foo: foo.x)
print foos #=> [Foo:-1, Foo:10, Foo:75]
- Chris
On Fri, Aug 29, 2008 at 07:28:40PM +0100, [EMAIL PROTECTED] wrote:
> dirListFinal = []
> for item in dirList:
>print item
>if item.endswith('\\') == True:
if item[-1] == '\\':
--
Derek D. Martin
http://www.pizzashack.org/
GPG Key ID: 0x81CFE75D
pgp5fVWPp4A
On Aug 29, 1:28 pm, [EMAIL PROTECTED] wrote:
> Sorry : Earlier mail had a typo in Subject line which might look
> in-appropriate to my friends
>
> Hi,
>
> I've a list some of whose elements with character \.
> I want to delete this last character from the elements that have this
> character set at
On Aug 29, 2:28 pm, [EMAIL PROTECTED] wrote:
> Sorry : Earlier mail had a typo in Subject line which might look
> in-appropriate to my friends
>
> Hi,
>
> I've a list some of whose elements with character \.
> I want to delete this last character from the elements that have this
> character set at
W. eWatson wrote:
I just tried the following code, and got an unexpected result.
from pyfdate import *
t = Time()
ts = Time(2008, 8, 29,15,20,7)
tnew = ts.plus(months=6)
print "new date: ", tnew
Result:
new date: 2009-02-28 15:20:07
I believe that should be April 1, 2009. If I use months = 1
On Fri, Aug 29, 2008 at 11:25 AM, <[EMAIL PROTECTED]> wrote:
> Hi,
>
> I've a list some of whose elements with character \.
> I want to delete this last character from the elements that have this
> character set at their end,
>
> I have written a small program, unfortunately this does not work:
>
On Fri, Aug 29, 2008 at 10:56 AM, cnb <[EMAIL PROTECTED]> wrote:
> On Aug 29, 7:40 pm, Daniel <[EMAIL PROTECTED]> wrote:
>> On Aug 29, 11:23 am, cnb <[EMAIL PROTECTED]> wrote:
>>
>> > If I get zero division error it is obv a poor solution to do try and
>> > except since it can be solved with an if-
cnb <[EMAIL PROTECTED]> writes:
> A ZeroDivisionError is better avoided wth an if-clause, don't you
> think? It is a predictable exception...
It depends. If zero-division is unlikely, then things would probably[*]
run faster without checking. If speed is what you're interested in, that
is...
G
cnb:
> In median grade, can I sort on Review-grade somehow?
operator.attrgetter may help.
Bye,
bearophile
--
http://mail.python.org/mailman/listinfo/python-list
Sorry : Earlier mail had a typo in Subject line which might look
in-appropriate to my friends
Hi,
I've a list some of whose elements with character \.
I want to delete this last character from the elements that have this
character set at their end,
I have written a small program, unfortunately
Hi,
I've a list some of whose elements with character \.
I want to delete this last character from the elements that have this
character set at their end,
I have written a small program, unfortunately this does not work:
dirListFinal = []
for item in dirList:
print item
i
In median grade, can I sort on Review-grade somehow?
something like:
sr = self.reviews.sort(key=self.reviews.instance.grade)
class Review(object):
def __init__(self, movieId, grade, date):
self.movieId = movieId
self.grade = grade
self.date = date
class Customer(object
On Aug 29, 1:54 pm, cnb <[EMAIL PROTECTED]> wrote:
> class Customer(object):
> def __init__(self, idnumber, review):
> self.idnumber = idnumber
> self.reviews = [review]
>
> def addReview(self, review):
> self.reviews.append(review)
>
> def averageGrade(self):
>
On Aug 29, 4:24 am, Peter Otten <[EMAIL PROTECTED]> wrote:
> A minimal example is
>
> >>> class Complex(complex):
>
> ... def __radd__(self, other): print "radd"
> ...>>> 1j + Complex()
>
> 1j
>
> versus
>
> >>> class Int(int):
>
> ... def __radd__(self, other): print "radd"
> ...>>> 1 + In
On Aug 29, 10:11 am, Roy Smith <[EMAIL PROTECTED]> wrote:
> In article <[EMAIL PROTECTED]>,
> Grant Edwards <[EMAIL PROTECTED]> wrote:
>
>
>
>
>
> > On 2008-08-29, Roy Smith <[EMAIL PROTECTED]> wrote:
>
> > > Exactly. This is one of those little pieces of syntactic
> > > sugar which makes python
On Aug 29, 11:44 am, [EMAIL PROTECTED] wrote:
> On Aug 28, 3:23 pm, gordyt <[EMAIL PROTECTED]> wrote:
>
>
>
> > Peter here is an example. I just tried it and it works fine.
>
> > from smtplib import SMTP
> > HOST = "smtp.gmail.com"
> > PORT = 587
> > ACCOUNT = "" # put your gmail email account na
you could prob abstract away a lot of that code, very similar-looking.
then it would be easier to find bugs.
--
http://mail.python.org/mailman/listinfo/python-list
On Aug 29, 7:40 pm, Daniel <[EMAIL PROTECTED]> wrote:
> On Aug 29, 11:23 am, cnb <[EMAIL PROTECTED]> wrote:
>
> > If I get zero division error it is obv a poor solution to do try and
> > except since it can be solved with an if-clause.
>
> > However if a program runs out of memory I should just let
> A friend of mine told me something about Guido and google developing
> an Ubuntu distribution based and totaly oriented for the Python
> appliction development. I googled for it with no results. Is it
> possible that My Buddy is trying to foole me or is it possible that
> someone knows something
class Customer(object):
def __init__(self, idnumber, review):
self.idnumber = idnumber
self.reviews = [review]
def addReview(self, review):
self.reviews.append(review)
def averageGrade(self):
tot = 0
for review in self.reviews:
tot +
hy list,
I've built _libfoo.so and libfoo.py library with swig and I've copied
in /usr/lib/python2.5/lib-dynload/ but when import the module
>>import libfoo
I've that message
Traceback (most recent call last):
File "", line 1, in
ImportError: /usr/lib/python2.5/lib-dynload/_libfoo.so: undefi
In article
<[EMAIL PROTECTED]>,
gordon <[EMAIL PROTECTED]> wrote:
> On Aug 29, 4:45 am, "Russell E. Owen" <[EMAIL PROTECTED]> wrote:
> >your Controller object should not create root nor should
> > it call mainloop to start the event loop.
>
> guys
> thanks for the helpful replies..I rewrote the
On Aug 29, 1:23 pm, cnb <[EMAIL PROTECTED]> wrote:
> If I get zero division error it is obv a poor solution to do try and
> except since it can be solved with an if-clause.
>
> However if a program runs out of memory I should just let it crash
> right? Because if not then I'd have to write excepti
On Aug 29, 11:23 am, cnb <[EMAIL PROTECTED]> wrote:
> If I get zero division error it is obv a poor solution to do try and
> except since it can be solved with an if-clause.
>
> However if a program runs out of memory I should just let it crash
> right? Because if not then I'd have to write excepti
hello,
I am trying to find the amount of values there are pertaining to one key.
For example:
- To find the average of the values pertaining to the key.
- Use the amount of values to calculate a histogram
Also, how do reference a specific value for a key in a multipart?
Thanks,
Ron
--
FYI,
# I posted a few days ago about a memory leak that I think i'm having with my
first Tkinter program.
# I've had trouble pinpointing what is wrong so i thought i would submit the
code and see if anyone would
# like to critique it.
# I have one more problem that i can't figure out either.
On Aug 29, 12:16 pm, [EMAIL PROTECTED] wrote:
> Hi,
>
> How to check if something is a list or a dictionary or just a string?
> Eg:
>
> for item in self.__libVerDict.itervalues():
> self.cbAnalysisLibVersion(END, item)
>
> where __libVerDict is a dictionary that holds values as strings
If I get zero division error it is obv a poor solution to do try and
except since it can be solved with an if-clause.
However if a program runs out of memory I should just let it crash
right? Because if not then I'd have to write exceptions everywhere to
prevent that right?
So when would I actual
On Aug 29, 4:45 am, "Russell E. Owen" <[EMAIL PROTECTED]> wrote:
>your Controller object should not create root nor should
> it call mainloop to start the event loop.
guys
thanks for the helpful replies..I rewrote the code as you advised. It
creates a controller object and a gui object from main s
On Aug 29, 1:29 am, "W. eWatson" <[EMAIL PROTECTED]> wrote:
> It looks like I have a few new features to learn about in Python. In
> particular,
> dictionaries.
In Python it's hard to think of many non-trivial problems that you
*don't* have to know about dictionaries.
George
--
http://mail.pyth
On Fri, 29 Aug 2008 17:20:37 +0100, London wrote:
> I am new to python.
> I did find a page which listed some code - IE "chdir" type code but can
> not find it again.
> Can you supply an address?
http://www.google.com is a good address to use.
Seriously, did you think we've hacked your compute
> That will mean that there will be no (easy?) way to determine after the
> import whether the module was imported from a source file or a compiled
> file. I've suggested that the original justification for the patch no
> longer applies, and that the secondary purpose of the patch is better
> solve
1 - 100 of 182 matches
Mail list logo