On Jan 4, 6:01 pm, Sion Arrowsmith <[EMAIL PROTECTED]>
wrote:
> hyperboreean <[EMAIL PROTECTED]> wrote:
> >Why doesn't python provide interfaces trough its standard library?
>
> Because they're pointless. Java interfaces are a hack around the
> complexities of multiple inheritence. Python does mul
I've created a class that has a property which points at a private
list. When I try to use the append() function on this list property,
the fget method is fired rather than the fset method. If I directly
set my property to a literal list, the set method fires.
Here's a stripped down version of m
On Jan 5, 7:07 am, John Nagle <[EMAIL PROTECTED]> wrote:
> Python doesn't really need explicit type declarations.
> They're not needed for correctness, and they're not needed for
> performance. Take a look at Shed Skin, which is able to hard-compile Python
> using type inference without explicit
Since
> Python is strongly-typed and dynamically-typed, this
> --
Hyphenating after "ly" is grammatically incorrect.
> \"It is the responsibility of intellectuals to tell the truth |
> `\and expose lies." -- Noam Chomsky
Never quote Noam Chomsky on "tr
Hey there..
I'm using boa constructor to debug a python application. For my
application, I need to insert break points and execute some piece of
code interactively through shell or someother window when the
breakpoint has been reached. Unfortunately the shell I think is a
seperate process so whatev
On 1/5/08, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote:
> Hello,
>
> I'm developing a Python-based web ap, but don't understand how to best
> organize the modules and set permissions for maximum security.
>
> Here's how the Python code for my ap is organized:
>
> 1) I have Python modules in a proje
Thanks for the all the replies. CPP2e is the Second Edition of the
book "Core Python Programming."
On Jan 4, 6:13 pm, Ben Finney <[EMAIL PROTECTED]>
wrote:
> Ming <[EMAIL PROTECTED]> writes:
> > I'm working through Wesley Chun's CPP2e and got this error on 13.11.1,
> > pp 548 where his interprete
On Jan 5, 9:50 pm, Paul Hankin <[EMAIL PROTECTED]> wrote:
> On Jan 5, 5:12 pm, Paul Hankin <[EMAIL PROTECTED]> wrote:
>
>
>
> > On Jan 5, 4:14 pm, [EMAIL PROTECTED] wrote:
>
> > > On Jan 5, 5:07 pm, [EMAIL PROTECTED] wrote:
>
> > > > Hello, Paul and Arnaud.
> > > > While I think about your answers:
John Nagle <[EMAIL PROTECTED]> writes:
>(I'm writing as someone who's used and liked very strictly typed
> languages like Ada and Modula.
Python is strictly typed (also known as "strongly typed"
http://en.wikipedia.org/wiki/Strongly-typed>), because its
objects know exactly what type they are
ttest wrote:
>> Reimplement colorsys.rgb_to_hsv() such that it operates on arrays instead of
>> scalars. Only minor modifications are necessary.
>>
>> --
>> Robert Kern
>
> Thanks! I'll try and see if a newcomer like me can get his head
> around the array-centric modifications to colorsys.
If yo
i want matlab6.5--
http://mail.python.org/mailman/listinfo/python-list
On Sat, 05 Jan 2008 15:07:10 -0800, bearophileHUGS wrote:
> Paddy:
>> Not really, it seems to me to be going the exact opposite way with
>> languages with automatic type conversions being seen as not suited for
>> larger programs.
>
> In Java you can add the number 1 to a string, and have it auto
hello group,
Using tkinter, is there any way to have the program not showing on the
taskbar, and even better showin in the system tray?
I realise tkinter does not have that much OS specific stuff but maybe there
is a way?
Thanks,
Sam
--
I intend to live forever - so far, so good.
SaM
--
http
Paddy:
> Not really, it seems to me to be going the exact opposite way with
> languages with automatic type conversions being seen as not suited for
> larger programs.
In Java you can add the number 1 to a string, and have it
automatically converted to string before the string join... What do
you
Sion Arrowsmith:
> Because ... how to be polite about this? No, I can't. std::set is
> crap. The implementation is a sorted sequence
What about using hash_map instead? You can use it with GCC too (but
you have to use a trick if you want to use string keys).
Bye,
bearophile
--
http://mail.python.
On Jan 4, 2:15 pm, Steven D'Aprano <[EMAIL PROTECTED]
cybersource.com.au> wrote:
> On Fri, 04 Jan 2008 09:29:50 -0800, bukzor wrote:
> > Why cant you implement < for complex numbers? Maybe I'm being naive, but
> > isn't this the normal definition?
> > a + bi < c + di iff sqrt(a**2 + b**2) < sqr
On Jan 5, 9:12 am, "Martin v. Löwis" <[EMAIL PROTECTED]> wrote:
> > Any other ideas?
>
> How about this:
>
> def random_pick(list, property):
> L = len(list)
> pos = start = random.randrange(L)
> while 1:
> x = list[pos]
> if property(x): return x
> pos = (pos +
On Jan 5, 8:14 am, [EMAIL PROTECTED] wrote:
> On Jan 5, 5:07 pm, [EMAIL PROTECTED] wrote:
>
> > Hello, Paul and Arnaud.
> > While I think about your answers: do you think there is any way to
> > avoid shuffle?
> > It may take unnecessary long on a long list most of whose elements
> > have the prope
On Jan 5, 8:50 pm, Paul Hankin <[EMAIL PROTECTED]> wrote:
> On Jan 5, 5:12 pm, Paul Hankin <[EMAIL PROTECTED]> wrote:
>
>
>
> > On Jan 5, 4:14 pm, [EMAIL PROTECTED] wrote:
>
> > > On Jan 5, 5:07 pm, [EMAIL PROTECTED] wrote:
>
> > > > Hello, Paul and Arnaud.
> > > > While I think about your answers:
On Sat, 05 Jan 2008 08:14:46 -0800, caca wrote:
> On Jan 5, 5:07 pm, [EMAIL PROTECTED] wrote:
>> Hello, Paul and Arnaud.
>> While I think about your answers: do you think there is any way to
>> avoid shuffle?
>> It may take unnecessary long on a long list most of whose elements have
>> the propert
On Jan 5, 5:12 pm, Paul Hankin <[EMAIL PROTECTED]> wrote:
> On Jan 5, 4:14 pm, [EMAIL PROTECTED] wrote:
>
> > On Jan 5, 5:07 pm, [EMAIL PROTECTED] wrote:
>
> > > Hello, Paul and Arnaud.
> > > While I think about your answers: do you think there is any way to
> > > avoid shuffle?
> > > It may take u
Sion Arrowsmith wrote:
> hyperboreean <[EMAIL PROTECTED]> wrote:
>> Why doesn't python provide interfaces trough its standard library?
>
> Because they're pointless.
Wrong. I'm using Eclipse with the Java Development Tools (JDT) who do
a wonderful job using interfaces to perform lots of checking
Sion Arrowsmith wrote:
> hyperboreean <[EMAIL PROTECTED]> wrote:
>> Why doesn't python provide interfaces trough its standard library?
>
> Because they're pointless.
Wrong. I'm using Eclipse with the Java Development Tools (JDT) who do
a wonderful job using interfaces to perform lots of checking
Hello,
I try to install mysqldb on windows vista 64bits but there is a
failure when i try to import mysqldb in python 2.5 :
"DLL load failed with error code 193"
Is there a solution to this problem ?
Thank you
--
http://mail.python.org/mailman/listinfo/python-list
Hello,
I'm developing a Python-based web ap, but don't understand how to best organize
the modules and set permissions for maximum security.
Here's how the Python code for my ap is organized:
1) I have Python modules in a project directory. The path to that directory is
in a *.pth file in th
On Jan 5, 5:40 pm, [EMAIL PROTECTED] wrote:
> Jeroen Ruigrok van der Werven wrote:
>
> > Shouldn't this be:
>
> > self.startLoc = start
> > self.stopLoc = stop
>
> Thanks! Of course it should. Old Java habits die slowly.
No, seriously it isn't Java habits only, most other languages wouldn't
need e
On Jan 5, 4:14 pm, [EMAIL PROTECTED] wrote:
> On Jan 5, 5:07 pm, [EMAIL PROTECTED] wrote:
>
> > Hello, Paul and Arnaud.
> > While I think about your answers: do you think there is any way to
> > avoid shuffle?
> > It may take unnecessary long on a long list most of whose elements
> > have the prope
On Jan 4, 4:32 pm, Carsten Haese <[EMAIL PROTECTED]> wrote:
> On Fri, 2008-01-04 at 00:03 -0800, Chris wrote:
> > You should bind all variables to save the pool.
>
> > cursor = connection.cursor()
> > cursor.executemany("""insert into as_siebel_hosts_temp
> > values (:whole, :
On 2008-01-05, Fredrik Lundh <[EMAIL PROTECTED]> wrote:
> Grant Edwards wrote:
>
>>> IOW, it's the same approach as on Unix.
>>
>> Not really. Under Unix you can safely create a temp file with
>> a name that can be used to open the file.
>
> Unless I'm missing something, it's not possible to do t
> OTOH, if you do know that the chances are high enough, you can try
> choosing items randomly without substitution (adapted from random.py's
> sample):
Sorry, this works:
def randpickuntil(lst, prop=bool):
selected = set()
n = len(lst)
for i in xrange(n):
j = int(random() * n
On Jan 5, 5:12 pm, "Martin v. Löwis" <[EMAIL PROTECTED]> wrote:
> > Any other ideas?
>
> How about this:
>
> def random_pick(list, property):
> L = len(list)
> pos = start = random.randrange(L)
> while 1:
> x = list[pos]
> if property(x): return x
> pos = (pos +
On Jan 4, 2008 11:55 PM, Steven W. Orr <[EMAIL PROTECTED]> wrote:
> class S(int):
> def __init__(self, value):
>self.value = value
> def addStr(self, str):
>self.doc = str
>
The original question has already been answered,
I only want to suggest to avoid shadowing builtin
On Jan 5, 4:14 pm, [EMAIL PROTECTED] wrote:
> On Jan 5, 5:07 pm, [EMAIL PROTECTED] wrote:
>
> > Hello, Paul and Arnaud.
> > While I think about your answers: do you think there is any way to
> > avoid shuffle?
> > It may take unnecessary long on a long list most of whose elements
> > have the prope
> Any other ideas?
How about this:
def random_pick(list, property):
L = len(list)
pos = start = random.randrange(L)
while 1:
x = list[pos]
if property(x): return x
pos = (pos + 1) % L
if pos == start:
raise ValueError, "no such item"
Regard
> That's an answer, though not for the question I asked.
I think you'll have to pose a complete question again,
rather than "how do I do that", if you want to get an
answer to your question.
> Not really. Under Unix you can safely create a temp file with
> a name that can be used to open the fil
Grant Edwards wrote:
>> IOW, it's the same approach as on Unix.
>
> Not really. Under Unix you can safely create a temp file with
> a name that can be used to open the file.
Unless I'm missing something, it's not possible to do this in a safe
way in the shared temp directory; you can do that on
Hi there :)
On Jan 5, 2:14 pm, [EMAIL PROTECTED] wrote:
> On Jan 5, 5:07 pm, [EMAIL PROTECTED] wrote:
>
> > Hello, Paul and Arnaud.
> > While I think about your answers: do you think there is any way to
> > avoid shuffle?
> > It may take unnecessary long on a long list most of whose elements
> > h
On Jan 5, 5:07 pm, [EMAIL PROTECTED] wrote:
> Hello, Paul and Arnaud.
> While I think about your answers: do you think there is any way to
> avoid shuffle?
> It may take unnecessary long on a long list most of whose elements
> have the property.
Umm...
You provide nice answers in the case many ele
On 2008-01-05, Martin v. Löwis <[EMAIL PROTECTED]> wrote:
>> I know. That's the point of my question: how do you do that
>> under Windows?
>
> When you create a new process, you have the option to inherit
> file handles to the new process. So the parent should open the
> file, and then inherit th
On Jan 4, 2:21 pm, Jeroen Ruigrok van der Werven <[EMAIL PROTECTED]
nomine.org> wrote:
> I got someone who asked me to make changes in an old Fortran program she is
> using for some calculations.
> The calculations are pretty standard aside from 2 calls to DLINCG (an IMSL
> numerical_libraries func
Hello, Paul and Arnaud.
While I think about your answers: do you think there is any way to
avoid shuffle?
It may take unnecessary long on a long list most of whose elements
have the property.
--
http://mail.python.org/mailman/listinfo/python-list
> Reimplement colorsys.rgb_to_hsv() such that it operates on arrays instead of
> scalars. Only minor modifications are necessary.
>
> --
> Robert Kern
Thanks! I'll try and see if a newcomer like me can get his head
around the array-centric modifications to colorsys.
--
http://mail.python.org/mai
> I know. That's the point of my question: how do you do that
> under Windows?
When you create a new process, you have the option to inherit
file handles to the new process. So the parent should open the
file, and then inherit the handle to the new process.
The new process will need to know what
>> I'm using Windows XP, using IDLE (which was mentioned already)
> in the context of editing/displaying code, not executing it. Does the
> problem occur before or after you edit a file with IDLE?
Actually, neither. I'm not editing the code. I open it in IDLE in 2.5
and attempt to run it through
Hallo liebe Pythonfreunde,
das nächste Treffen von pyCologne, der Python User Group Köln, findet
statt:
Datum: Mittwoch, den 9.1.2008
Uhrzeit: 18:30 Uhr c.t.
Ort: Pool 0.14, Benutzerrechenzentrum (RRZK-B) der Universität
Köln,
Berrenrather Str. 136, 50937 Köln
Das Programm für das
On 2008-01-05, Jarek Zgoda <[EMAIL PROTECTED]> wrote:
>> Under Windows, is there a "safe" way to create a temp file
>> that has a name that can be passed to a program which will
>> then open it? I never figured out a way to do that and had to
>> fall back on the "unsafe" tmpnam method.
>
> I think
On Jan 4, 3:50 pm, "Reedick, Andrew" <[EMAIL PROTECTED]> wrote:
> > From: Stephen Hansen [mailto:[EMAIL PROTECTED]
> > Sent: Thursday, January 03, 2008 7:39 PM
> > To: Reedick, Andrew
> > Cc: [EMAIL PROTECTED]
> > Subject: Re: dictionary/hash and '1' versus 1
>
> > Well one important thing to learn
The address is http://englearn.zhan.cn.yahoo.com
And I need your advice. Well, maybe your help. You see. aha!
--
http://mail.python.org/mailman/listinfo/python-list
On Jan 4, 7:55 pm, [EMAIL PROTECTED] wrote:
> Hello,
> This is a question for the best method (in terms of performance
> only) to choose a random element from a list among those that satisfy
> a certain property.
>
> This is the setting: I need to pick from a list a random element
> that sati
Thank you Jean, I could fix this problem. Creating the symbolic link
wasn't really obvious though.
They also say about the documentation:
*Extract the documentation files, and place them in some suitable
location, e.g.
~/Library/Python-Docs
*Edit your "environment.plist" file, and create an enviro
On Sat, 05 Jan 2008 03:37:33 -0800, [EMAIL PROTECTED] wrote:
> I am nes to python and need some help. Can anyone lead me in the
> right direction to create and print a Point object, and then use id to
> print the object's unique identifier. Translate the hexadecimal form
> into decimal and confir
Grant Edwards pisze:
>> you get a name instead of a file, so someone else can create that file
>> after you've called tempnam/tmpnam, but before you've actually gotten
>> around to create the file yourself. which means that anyone on the
>> machine might be able to mess with your application's
I am nes to python and need some help. Can anyone lead me in the
right direction to create and print a Point object, and then use id to
print the object's unique identifier. Translate the hexadecimal form
into decimal and confirm that they match.
Any help woul be much appreciated.
Pete
--
http:
On Jan 4, 7:55 pm, [EMAIL PROTECTED] wrote:
> Hello,
> This is a question for the best method (in terms of performance
> only) to choose a random element from a list among those that satisfy
> a certain property.
>
> This is the setting: I need to pick from a list a random element
> that sati
On Jan 4, 3:33 pm, cf29 <[EMAIL PROTECTED]> wrote:
> I installed Python 2.5 on my Mac (OS X Tiger). When running scripts
> with the TextWrangler Run command it is using the system installed
> version of Python (2.3). If I run the scripts with the Apple Terminal
> it uses the new version (2.5).
>
>
Jeroen Ruigrok van der Werven wrote:
> -On [20080104 19:21], Dennis Lee Bieber ([EMAIL PROTECTED]) wrote:
>> If the FORTRAN is using single precision reals, I'd expect a
>> slow-down in Python just on that alone, as Python uses doubles as the
>> only float type. There is also the overhead of o
[EMAIL PROTECTED] wrote:
> Jeroen Ruigrok van der Werven wrote:
>> self.startLoc = start
>> self.stopLoc = stop
>
> Thanks! Of course it should. Old Java habits die slowly.
That's not really a Java habit. In Java and C++, personally I like
to write
this.startLoc = start
this.stopLoc = stop
It
Yaakov Nemoy wrote:
> A couple of developers have mentioned that python might be fragmenting
> its memory space, and is unable to free up those pages. How can I go
> about testing for this, and are there any known problems like this?
> If not, what else can I do to look for leaks?
Marc-Andre bro
Jeroen Ruigrok van der Werven wrote:
> Shouldn't this be:
>
> self.startLoc = start
> self.stopLoc = stop
Thanks! Of course it should. Old Java habits die slowly.
--
http://mail.python.org/mailman/listinfo/python-list
On Jan 5, 10:31 am, [EMAIL PROTECTED] wrote:
> ...
> class code:
> def __init__( self, start, stop ):
> startLoc = start
> stopLoc = stop
> ...
You've forgotten the explicit self.
def __init__( self, start, stop ):
self.startLoc = start
self.stopLoc = sto
-On [20080105 11:36], [EMAIL PROTECTED] ([EMAIL PROTECTED]) wrote:
>class code:
>def __init__( self, start, stop ):
>startLoc = start
>stopLoc = stop
Shouldn't this be:
self.startLoc = start
self.stopLoc = stop
?
--
Jeroen Ruigrok van der Werven / asmodai
-On [20080104 19:21], Dennis Lee Bieber ([EMAIL PROTECTED]) wrote:
> If the FORTRAN is using single precision reals, I'd expect a
>slow-down in Python just on that alone, as Python uses doubles as the
>only float type. There is also the overhead of object access for each.
In this case it use
-On [20080105 11:21], [EMAIL PROTECTED] ([EMAIL PROTECTED]) wrote:
>Why convert? Modern Fortran is an object oriented, structured language
>with the singular advantage that it can run old Fortran programs.
With all due respect to Fortran but I find the syntax to be utterly
horr
Working on parser for my language, I see that all classes (Token,
Production, Statement, ...) have one thing in common. They all
maintain start and stop positions in the source text. So it seems
logical to have them all inherit from a base class that defines those,
but this doesn't work:
import to
> I mean, really, I've been using web-mail and various varieties of
> remote
> storage for over a decade. What is *new* about the concept? (I see
> some
> hints above, but it's mixed in with a lot of other stuff...)
In essence, you're correct, this concept of cloud computing actually
have existe
> Caching might help.
>
> If random_pick is called several times with the same list(s) then
> cache the result of
> [property(i) for i in a_list] against a_list.
>
> If random_pick is called several times with list(s) with multiple
> instances of list items then cache
> property(i) against i for
Jeroen Ruigrok van der Werven wrote:
> I got someone who asked me to make changes in an old Fortran program she is
> using for some calculations.
Why convert? Modern Fortran is an object oriented, structured language
with the singular advantage that it can run old Fortran programs.
--
http://ma
On Jan 4, 6:08 pm, Sion Arrowsmith <[EMAIL PROTECTED]>
wrote:
> Hrvoje Niksic <[EMAIL PROTECTED]> wrote:
>
> >BTW if you're using C++, why not simply use std::set?
>
> Because ... how to be polite about this? No, I can't. std::set is
> crap. The implementation is a sorted sequence -- if you're luc
On Jan 5, 4:39 am, aspineux <[EMAIL PROTECTED]> wrote:
> Hi
>
> I read the PEP 3117 about the new "Postfix type declarations" in
> Python3000.
> THIS PEP as been REJECTED ! But ...
>
> The notation in the PEP is very ugly ! This make python code more
> difficult to read!
>
> Anyway when I switche
I was able to recompile zlib
$./configure --shared
then recompile Python 2.5.1; I am now able to import the zlib module.
cheers
-sg
I was able to recompile zlib
$./configure --shared
then recompile Python 2.5.1; I am now able to import the zlib module.
cheers
-sg
On Jan 4, 5:17 pm, Zent
log on to
http://profiles.friendster.com/58431435
--
http://mail.python.org/mailman/listinfo/python-list
On Fri, 04 Jan 2008 23:03:15 -0800, sanjeet wrote:
> hi all,
> I am facing problem to fetch mail from internet mail server. Plz help
> me, how can do this?
Yes.
Everything you need to know to fix your problem can be found here:
www.catb.org/~esr/faqs/smart-questions.html
--
Steven
--
http:
When trying to import a module from a filesystem directory there are
several possibilities. Most obviously one can use an import statement
but if this is not sufficient one has also API functions. However
these API functions don't seem to be consistent with each other.
If one uses the builtin __im
73 matches
Mail list logo