"Ben Finney" <[EMAIL PROTECTED]> wrote:
To:
Sent: Thursday, October 26, 2006 4:44 AM
Subject: Re: basic questions on cmp, < and sort
Schüle Daniel <[EMAIL PROTECTED]> writes:
8<---
> third question
>
> sort([[1,2,3],["ABC"],['Z','A'], X(), 4)
>>> sor
"Robert Kern" <[EMAIL PROTECTED]> wrote:
8<--
> It's a bit of an abuse on the English language, but what isn't in software?
jumps used not to be
- Hendrik
--
http://mail.python.org/mailman/listinfo/python-list
Schüle Daniel wrote:
> first question
>
> In [117]: cmp("ABC",['A','B','C'])
> Out[117]: 1
>
> against what part of the list is the string "ABC" compared?
http://docs.python.org/lib/comparisons.html
"Objects of different types, except different numeric types and
different string
Paul McGuire wrote:
> "J. Clifford Dyer" <[EMAIL PROTECTED]> wrote in message
> news:[EMAIL PROTECTED]
>> ZeD wrote:
>>> Paul Rubin wrote:
>>>
> A = [0,1,2,3,4,5,6,7,8,9,10]
> B = [2,3,7,8]
>
> desired_result = [2,3,7,8,0,1,4,5,6,9,10]
How about:
desired_result = B
steve wrote:
> The example code from: http://sjbrown.ezide.com/games/example1.py.html
> ...
> def Notify( self, event ):
> if not isinstance(event, TickEvent): Debug( "
> Message: " + event.name )
> for listener in self.listeners.keys():
> #I
Neil Cerutti <[EMAIL PROTECTED]> wrote:
>
>Some experimentation shows that Python does seem to provide
>*some* translation. Windows lets me use '/' as a path separator,
>but not as the name of the root of a partition name. But perhaps
>this a peculiarity of the commands themselves, and not of Windo
Steve Holden wrote:
> Sebastian Busch wrote:
>> [EMAIL PROTECTED] wrote:
>>> ... I would like to remove two lines from a file. ...
>> ... grep -v ...
> ... show ...
grep -v "`grep -v "commentsymbol" yourfile | head -2`" yourfile
i frankly admit that there is also 'head' invoved ;)
i really have
The example code from: http://sjbrown.ezide.com/games/example1.py.html
...
def Notify( self, event ):
if not isinstance(event, TickEvent): Debug( "
Message: " + event.name )
for listener in self.listeners.keys():
#If the weakref has died, remo
"Lucas" <[EMAIL PROTECTED]> wrote:
>
>2) I want to put a number into the picture for encryption(replace least
>significant bit (LSB) of image intensity with message bit).
What formats are your images? Remember that JPEG images are compressed
when they are written. It is rather unlikely that your
Schüle Daniel schrieb:
> first question
>
> In [117]: cmp("ABC",['A','B','C'])
> Out[117]: 1
>
> against what part of the list is the string "ABC" compared?
The names of the types are compared:
py> cmp("string", "list")
1
> second question
>
> In [119]: class X(object):
>.: pass
>
[EMAIL PROTECTED] schrieb:
> However, I would like to be able to import this package dynamically
> within the application running on the host machine. When I attempted
> to import the package within the already loaded python modules, I would
> get errors that the C portions of the package could no
/What's your favorite IDE?/
Eclipse with pydev and extentions, and subclipse for subversion
/
What do you like about it?
/When I started Python I tried a whole bunch of IDEs, Komodo, Idle, active
state but got tired by having to learn to navigate through a new environment,
so I settled for PyDev
With the most recent edition of PyDev, I find Eclipse works quite well
for me.
Ken
[EMAIL PROTECTED] wrote:
> Recently I've had some problems with PythonWin when I switched to
> Py2.5, tooka long hiatus, and came back. So now I'm without my god sent
> helper, and I'm looking for a cool replaceme
Thanks for all the feedback. Yes the original post was incorrect, it was
an intellectual burp that had me asking about a instead of f(something).
Boy, that answer's something I would never have known...
Thanks,
Ken
Leo Kislov wrote:
> Michael Spencer wrote:
>
>> Kenneth McDonald wrote:
>>
"sturlamolden" <[EMAIL PROTECTED]> writes:
> However, "memory mapping" a file by means of fseek() is probably more
> efficient than using UNIX' mmap() or Windows'
> CreateFileMapping()/MapViewOfFile().
Why on would you think that?! It is counterintuitive. fseek beyond
whatever is buffered in std
"sturlamolden" <[EMAIL PROTECTED]> wrote:
>
>However, "memory mapping" a file by means of fseek() is probably more
>efficient than using UNIX' mmap() or Windows'
>CreateFileMapping()/MapViewOfFile().
My goodness, do I disagree with that! At least on Windows, I/O on a file
mapped with MapViewOfFil
I have a Python (2.3.x) interpreter running embedded in a C++
application on a host machine. I would like to run a specific package
on that host machine (numpy). I have managed to compile
(cross-compile) the library, so that I have the python modules and the
compiled .so files. I am relatively
John Coleman wrote:
> Paul Rubin wrote:
> > "John Coleman" <[EMAIL PROTECTED]> writes:
> > > > then "x == 3" is false, but "int(x) == 3" is true.
> > > But then why is 3.0 == 3 true? They are different types.
> >
> > The 3 gets converted to float, like when you say
> >
> > x = 3.1 + 3
> >
> > th
>> Vim
>> you'll be frustrated for about a week,
You'll be frustrated for at least two weeks. But you'll use it forever
for everything from writing to programming, so who cares?
Auto completion is called omni completion in VIM
type ':h new-omni-completion' at the command line after two weeks of
> But, when I call it from another module it locks
methinks this "other module" has the answer.
jim-on-linux wrote:
> py help,
>
> The file below will run as a stand alone file.
> It works fine as it is.
>
> But, when I call it from another module it locks
> my computer, The off switch is the only
Paul Rubin <"http://phr.cx"@NOSPAM.invalid> writes:
> Max Erickson <[EMAIL PROTECTED]> writes:
> > > [Steve:] There's still a very obvious omission ...
> >
> > bool.
> >
> > unicode and long if you are fussy.
>
> There's another. Imagine a datatype for Discordian religious
> leaders and conside
Max Erickson <[EMAIL PROTECTED]> writes:
> > [Steve:] There's still a very obvious omission ...
>
> bool.
>
> unicode and long if you are fussy.
There's another. Imagine a datatype for Discordian religious leaders
and consider what a genderless one would be called.
--
http://mail.python.org/ma
Schüle Daniel <[EMAIL PROTECTED]> writes:
> Hello,
>
> first question
>
> In [117]: cmp("ABC",['A','B','C'])
> Out[117]: 1
>
> against what part of the list is the string "ABC" compared?
Why "part"? There are two objects; they are compared to each other.
How this comparison is implemented is a m
Before that, I mentioned I was trying to make a text adventure, from
scratch to add more clarity.
--
http://mail.python.org/mailman/listinfo/python-list
"[EMAIL PROTECTED]" <[EMAIL PROTECTED]> writes:
> this has revieled I no nothing about parsing or classes. Both are
> required to make an IDE I believe.
Are you trying to make an IDE, or choose an existing one?
--
\ "This sentence contradicts itself -- no actually it doesn't." |
`\
Steve Holden <[EMAIL PROTECTED]> wrote:
> Gabriel Genellina wrote:
>> At Wednesday 25/10/2006 22:29, Terry Reedy wrote:
>>
>>> >> the string class's "nil" value. Each of the builtin types
>>> >> has such an "empty" or "nil" value:
>>> >>
>>> >> string ""
>>> >> list
Steve Holden <[EMAIL PROTECTED]> writes:
> Gabriel Genellina wrote:
> > Just for fun:
> > buffer('')
> > frozenset()
> > iter(())
> > xrange(0)
I get that iter(()) is True (Python 2.3.4).
> [Steve:] There's still a very obvious omission ...
Hehehe...
--
http://mail.python.org/mailman/listinfo/p
Steve Holden <[EMAIL PROTECTED]> writes:
> [EMAIL PROTECTED] wrote:
> > Each of the builtin types has such an "empty" or "nil" value:
> >
> > string ""
> > list[]
> > tuple ()
> > dict{}
> > int 0
> >
Gabriel Genellina wrote:
> At Wednesday 25/10/2006 22:29, Terry Reedy wrote:
>
>> >> the string class's "nil" value. Each of the builtin types has such an
>> >> "empty" or "nil" value:
>> >>
>> >> string ""
>> >> list[]
>> >> tuple ()
>> >>
Hello,
first question
In [117]: cmp("ABC",['A','B','C'])
Out[117]: 1
against what part of the list is the string "ABC" compared?
second question
In [119]: class X(object):
.: pass
.:
In [120]: X() < X()
Out[120]: True
In [121]: X() < X()
Out[121]: False
In [122]: X() < X
That's surely an idea, but I'm not to that point yet. Right not I'm
struggling to understand a text adventure, and because I wanted to try
it my own at it (before using a tutorial), this has revieled I no
nothing about parsing or classes. Both are required to make an IDE I
believe.
As for UliPad .
John Henry wrote:
> What's the cleanest way to say:
>
> 1) Give me a list of the items that are in all of the sets? (3 in the
> above example)
> 2) Give me a list of the items that are not in all of the sets? (1,2 in
> the above example)
>
> Thanks,
If you have an arbitrary list of sets, reduce
At Wednesday 25/10/2006 22:29, Terry Reedy wrote:
>> the string class's "nil" value. Each of the builtin types has such an
>> "empty" or "nil" value:
>>
>> string ""
>> list[]
>> tuple ()
>> dict{}
>> int
Ben Finney wrote:
> "[EMAIL PROTECTED]" <[EMAIL PROTECTED]> writes:
>
>> After researching Komodo, I found it's not free. The only funds I
>> have are a college fund, and I can't start diping into that until
>> I'm going to college. Any free AND good IDEs?
>
> Please consider trying Python with
At Wednesday 25/10/2006 21:28, George Sakkis wrote:
It's the first time in the three years I've been using python that a
program crashes without a nice traceback to give me a clue of what
might be wrong. After searching a little, it seems it's one of those
hard to get down to cases, so I've no i
"Steve Holden" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
>> the string class's "nil" value. Each of the builtin types has such an
>> "empty" or "nil" value:
>>
>> string ""
>> list[]
>> tuple ()
>> dict
"Delaney, Timothy (Tim)" <[EMAIL PROTECTED]> writes:
> George Sakkis wrote:
>
> > What makes the problem worse is that it's not deterministic; I can
> > restart it from (a little before) the point of crash and it doesn't
> > happen again at the same point, but it might happen further down. Now,
>
Roy Smith <[EMAIL PROTECTED]> writes:
> Isn't this the kind of thing that the new-fangled "with" statement is
> supposed to solve?
1) that would require rewriting the wx.TextEntryDialog to have an
exit method.
2) It's not necessarily always the case that you want to destroy the
dialog when the f
> What's your favorite IDE?
Vim
> What do you like about it?
If you are a very good typist you can rock with Vim. Vi and variants
are on _every_ Unix system. It's highly configurable, syntax
highlighting, supports scripting with Python.
> It would be fine for a begginer, right?
Not really, you'
"[EMAIL PROTECTED]" <[EMAIL PROTECTED]> writes:
> After researching Komodo, I found it's not free. The only funds I
> have are a college fund, and I can't start diping into that until
> I'm going to college. Any free AND good IDEs?
Please consider trying Python with a powerful editor, instead of
Steve Holden <[EMAIL PROTECTED]> writes:
> [EMAIL PROTECTED] wrote:
> > s is not equal to the boolean object True, but it also doesn't
> > evaluate to the string class's "nil" value. Each of the builtin
> > types has such an "empty" or "nil" value:
> >
> > string ""
> > list
[EMAIL PROTECTED] wrote:
> After researching Komodo, I found it's not free. The only funds I have
> are a college fund, and I can't start diping into that until I'm going
> to college. Any free AND good IDEs?
>
http://wiki.python.org/moin/IntegratedDevelopmentEnvironments
Duncan
--
http://mail.
At Wednesday 25/10/2006 21:20, [EMAIL PROTECTED] wrote:
After researching Komodo, I found it's not free. The only funds I have
are a college fund, and I can't start diping into that until I'm going
to college. Any free AND good IDEs?
There is a list at http://wiki.python.org/moin/PythonEditors
George Sakkis wrote:
> What makes the problem worse is that it's not deterministic; I can
> restart it from (a little before) the point of crash and it doesn't
> happen again at the same point, but it might happen further down. Now,
> I wouldn't mind restarting it manually every time since the cra
On 25 Oct 2006 17:20:32 -0700, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote:
> After researching Komodo, I found it's not free. The only funds I have
> are a college fund, and I can't start diping into that until I'm going
> to college. Any free AND good IDEs?
>
I think most of wxPython IDE are good
At Wednesday 25/10/2006 21:12, John Henry wrote:
Oops. Forgot to mention, I am still using 2.3.
try: set
except NameError: from sets import Set as set
and the code will work almost exactly the same in 2.3/2.4
> 1) Give me a list of the items that are in all of the sets? (3 in the
> above e
It's the first time in the three years I've been using python that a
program crashes without a nice traceback to give me a clue of what
might be wrong. After searching a little, it seems it's one of those
hard to get down to cases, so I've no idea where to look for. Briefly
what I do is, select som
[EMAIL PROTECTED] wrote:
> Hello,
>
> While playing to write an inverted index (see:
> http://en.wikipedia.org/wiki/Inverted_index), i run out of memory with
> a classic dict, (i have thousand of documents and millions of terms,
> stemming or other filtering are not considered, i wanted to underst
After researching Komodo, I found it's not free. The only funds I have
are a college fund, and I can't start diping into that until I'm going
to college. Any free AND good IDEs?
--
http://mail.python.org/mailman/listinfo/python-list
In article <[EMAIL PROTECTED]>,
Ben Finney <[EMAIL PROTECTED]> wrote:
> John Salerno <[EMAIL PROTECTED]> writes:
>
> > if dlg.ShowModal() == wx.ID_OK:
> > db_name = dlg.GetValue()
> > dlg.Destroy()
> > return db_name
> > else:
> >
Aye!
I did a:
a and b and c
Bonk!
Thanks,
Tim Peters wrote:
> [John Henry]
> > If I have a bunch of sets:
> >
> > a = set((1, 2, 3))
> > b = set((2, 3))
> > c = set((1, 3))
> >
> >
> > What's the cleanest way to say:
> >
> > 1) Give me a list of the items that are in all of the sets? (3
[John Henry]
> If I have a bunch of sets:
>
> a = set((1, 2, 3))
> b = set((2, 3))
> c = set((1, 3))
>
>
> What's the cleanest way to say:
>
> 1) Give me a list of the items that are in all of the sets? (3 in the
> above example)
list(a & b & c)
> 2) Give me a list of the items that are not
Oops. Forgot to mention, I am still using 2.3.
John Henry wrote:
> Hi list,
>
> If I have a bunch of sets:
>
> a = set((1, 2, 3))
> b = set((2, 3))
> c = set((1, 3))
>
>
> What's the cleanest way to say:
>
> 1) Give me a list of the items that are in all of the sets? (3 in the
> above examp
py help,
The file below will run as a stand alone file.
It works fine as it is.
But, when I call it from another module it locks
my computer, The off switch is the only
salvation.
This module when run as a stand alone, it will
open a jpeg image and add a vertical and
horizontal scrollbar
Hi list,
If I have a bunch of sets:
a = set((1, 2, 3))
b = set((2, 3))
c = set((1, 3))
What's the cleanest way to say:
1) Give me a list of the items that are in all of the sets? (3 in the
above example)
2) Give me a list of the items that are not in all of the sets? (1,2 in
the above exam
On 2006-10-26, Neil Cerutti <[EMAIL PROTECTED]> wrote:
> It seems like the holy wars are pretty. We disciples of Vim and
> Emacs are now content merely being holier than all he others.
>
> Actually, I'm not sure there's been a good Emacs VS Vim holy war
> in years. So... ya know what's I find to be
On 2006-10-25, Bruno Desthuilliers <[EMAIL PROTECTED]> wrote:
> [EMAIL PROTECTED] a écrit :
>> Recently I've had some problems with PythonWin when I switched to
>> Py2.5, tooka long hiatus, and came back. So now I'm without my god sent
>> helper, and I'm looking for a cool replacement, or some advo
> > can I somehow call the IONotificationPortCreate in the
> > Framework that Apple built instead,
>
> $ cd /System/Library/Frameworks/
> $ cd IOKit.framework/Versions/Current/
> $ file IOKit
Also ctypes.util.find_library('CoreFoundation')
--
http://mail.python.org/mailman/listinfo/python-list
PS: Search engine . . . I knew this had probably come up very often,
but I get it's pretty silly of me that I didn't utilize this.
And while I was posting another mark for Komodo came. Nice, is it.
--
http://mail.python.org/mailman/listinfo/python-list
George Sakkis wrote:
> Martin v. Löwis wrote:
>> Not-so-obviously, arbitrary user-defined values can also be
>> treated as false: If they implement __nonzero__, they are
>> false if False is returned from __nonzero__; otherwise,
>> if they implement __len__, they are false if 0 is returned
>> from
> I don't really have a good answer here, but maybe a data point. I got
> tired of waiting for ActiveState to put out a Python 2.5 and installed
> the one from python.org instead, which doesn't include PythonWin. I
> figured that I should take the opportunity to try out Komodo, which I'd
> heard
Farshid Lashkari <[EMAIL PROTECTED]> writes:
> Paul Rubin wrote:
> > I like
> >
> > if dlg.ShowModal() == wx.ID_OK:
> > db_name = dlg.GetValue()
> > else:
> > db_name = None
> > dlg.Destroy()
> > return db_name
> >
> > better than
> >
> > db_name = None
> >
On 2006-10-25, John Coleman <[EMAIL PROTECTED]> wrote:
>
> Paul Rubin wrote:
>> John Salerno <[EMAIL PROTECTED]> writes:
>> > I'm a little confused. Why doesn't s evaluate to True in the first
>> > part, but it does in the second? Is the first statement something
>> > different?
>>
>> No. True and
I perform python development for cross platform firmware integration
and analysis on a daily basis and the IDE I use and recommend is Komodo
from ActiveState. Our worldwide development group (30) has recently all
purchased the professional version as it integrates with several
version control syste
I want to convert some algorithms from a Pascal dialect to Python. (Not
embedding, but code itself)
Its mainly only math and function calls and simple array access but lengthy.
Think Pascal is quite simlar/simpler in logic for that kind of stuff (in
comparison to C/C++), so maybe quite simple
John Salerno <[EMAIL PROTECTED]> writes:
> if dlg.ShowModal() == wx.ID_OK:
> db_name = dlg.GetValue()
> dlg.Destroy()
> return db_name
> else:
> dlg.Destroy()
> return
It's for reasons like this that I prefer to ha
I'm not going to call it the 'best' ide as thats just silly. But if your developing on Windows pyscripter http://mmm-experts.com/Products.aspx?ProductId=4
is a great IDE. -JoshOn 10/25/06, Bruno Desthuilliers <[EMAIL PROTECTED]
> wrote:[EMAIL PROTECTED] a écrit :> Recently I've had some problems w
[EMAIL PROTECTED] a écrit :
> Recently I've had some problems with PythonWin when I switched to
> Py2.5, tooka long hiatus, and came back. So now I'm without my god sent
> helper, and I'm looking for a cool replacement, or some advocation to
> reinstall/setup PyWin. But the Python website's list is
[EMAIL PROTECTED] wrote:
> Recently I've had some problems with PythonWin when I switched to
> Py2.5, tooka long hiatus, and came back. So now I'm without my god sent
> helper, and I'm looking for a cool replacement, or some advocation to
> reinstall/setup PyWin. But the Python website's list is ir
Paul Rubin wrote:
> John Salerno <[EMAIL PROTECTED]> writes:
>
>>if (10 > 5)
>>would be the same as
>>if (10 > 5) == True
>
>
> Yes.
Though it would be bad style to write it in the latter way, not to
mention less efficient.
regards
Steve
--
Steve Holden +44 150 684 7255 +1 800 494 3
Recently I've had some problems with PythonWin when I switched to
Py2.5, tooka long hiatus, and came back. So now I'm without my god sent
helper, and I'm looking for a cool replacement, or some advocation to
reinstall/setup PyWin. But the Python website's list is irrefutably
long. It would take a m
John Coleman wrote:
> Martin v. Löwis wrote:
>
>>John Coleman schrieb:
>>
>>>Yes - it just seems that there isn't a principled reason for implicitly
>>>converting 3 to 3.0 in 3.0 == 3 but not implicitly converting "cat" to
>>>boolean in "cat" == true.
>>
>>Sure there is: equality should be transit
Problem solved.
Turns out it was a problem of mistranslating VBS code to Python.
The PYTHON line "print str(tet)" casts tet to a string and prints. This
is what I thought the VBS line "Str = Tet.ConvertToString()" was doing.
But of course "ConvertToString()" is a method of a Tet instance. So in
p
[EMAIL PROTECTED] wrote:
> John> I'm a little confused. Why doesn't s evaluate to True in the first
> John> part, but it does in the second? Is the first statement something
> John> different?
>
> >>> s = 'hello'
> >>> s == True
> False
> >>> if s:
> ... pri
At Wednesday 25/10/2006 16:19, trevor lock wrote:
I've just started using python and have observed the following :
class foo:
a=[]
def __init__(self, val):
self.a.append ( val )
It's a common pitfall. As seen just a few days ago:
http://groups.google.com/group/comp.lang.py
John Salerno wrote:
> Paul Rubin wrote:
>
>
>>Oh, I see. You really want something like repeat...while, which Python
>>doesn't have. Anyway I start to prefer something like (untested):
>>
>> def create_db_name(self):
>> try:
>>while True:
>> dlg = wx.TextEn
In article <[EMAIL PROTECTED]>,
"John Coleman" <[EMAIL PROTECTED]> wrote:
> Very good point, though one could argue perhaps that when one is
> comparing an object with a truth value then one is implicitly asking
> for the truth value of that object
On the contrary -- since there is normally no n
Now at http://pyfaq.infogami.com/suggest we have:
FAQ: How do I declare that a CTypes function returns unsigned char?
A: c_uchar = ctypes.c_ubyte
This irregularity actually is doc'ed, it's just pointlessly annoying.
Hope this helps (and of course I trust you'll dispute if I'm nuts),
--
http:/
Paul Rubin wrote:
> John Salerno <[EMAIL PROTECTED]> writes:
>
>> if dlg.ShowModal() == wx.ID_OK:
>> db_name = dlg.GetValue()
>> dlg.Destroy()
>> return db_name
>> else:
>> dlg.Destroy()
>> return
>
>
> I like
>
> i
Now at http://pyfaq.infogami.com/suggest we have:
FAQ: How do I declare that CTypes function returns void?
A: c_void = None is not doc'ed, but is suggested by:
>>> ctypes.POINTER(None)
>>>
Remembering c_void = c_int from K&R C often works, but if you say a
restype is c_int, then doctest's of th
TiNo wrote:
> How do you send and receive this email?
email?
--
http://mail.python.org/mailman/listinfo/python-list
Five and a half years ago, Tim Peters (glory be to his name) made the
following statement:
> In that respect, None is unique among non-keyword names, and for that reason
> alone it should be a keyword instead of a global. I expect that will happen
> someday, too. But it's a race between that and
Martin v. Löwis wrote:
> [EMAIL PROTECTED] schrieb:
> > the string class's "nil" value. Each of the builtin types has such an
> > "empty" or "nil" value:
> >
> > string ""
> > list[]
> > tuple ()
> > dict{}
> > int
>
>It appears that there is a 255 argument limit in Python 2.4.3?
>
maybe the argument limit is for the sake of not making functions too
complicated.
if your function takes more than 200 arguments it can probably go to
thedailywtf.com,
better be strict like i am and even avoid making a 100 arg
How do you send and receive this email?24 Oct 2006 22:12:35 -0700, Paul Rubin <"http://phr.cx"@nospam.invalid>:
I've given up on email pretty much. I no longer have a public emailaddress of any type. I just give out a URL (including on my resume,business cards, etc), which leads to a HTTPS contac
Kenneth McDonald wrote:
> I would like to avoid putting this up on sourceforge as I think it would
> do much better at a site aimed specifically at Python development.
I've been using python-hosting.com for the argparse module and found it
to be a pretty good solution. They offer free Trac/Subv
Michael Spencer wrote:
> Kenneth McDonald wrote:
> > I'm trying to write a 'flatten' generator which, when give a
> > generator/iterator that can yield iterators, generators, and other data
> > types, will 'flatten' everything so that it in turns yields stuff by
> > simply yielding the instances o
At Wednesday 25/10/2006 11:32, [EMAIL PROTECTED] wrote:
Fredrik Lundh wrote:
> [EMAIL PROTECTED] wrote:
> > thanks for the reply,but unfortunately this does not work with the type
> > of classes I am dealing with. When trying to pickle the class I get the
> > following error:
> >
> > File "/usr
Martin v. Löwis wrote:
> John Coleman schrieb:
> > Yes - it just seems that there isn't a principled reason for implicitly
> > converting 3 to 3.0 in 3.0 == 3 but not implicitly converting "cat" to
> > boolean in "cat" == true.
>
> Sure there is: equality should be transitive. So while we have
> 3
Bruno Desthuilliers <[EMAIL PROTECTED]> writes:
> > But if the user doesn't enter any text, I don't want the method to
> > return at all (even None).
>
> John, please re-read the FineManual(tm). None is the default return
> value of a function - even if there's no return statement.
Correct, but i
John Salerno a écrit :
> Paul Rubin wrote:
>
>> John Salerno <[EMAIL PROTECTED]> writes:
>>
>>> I just need some advice for how to structure
>>> the check of the empty string.
>>
>>
>> How about
>>
>> return db_name or None
>>
>> since the empty string taken as a boolean is False.
>
>
> But
Kenneth McDonald schrieb:
> To do this, I need to determine (as fair as I can see), what are
> Is there a way to do this? Or perhaps another (better) way to achieve
> this flattening effect? itertools doesn't seem to have anything that
> will do it.
As others have pointed out, there is a proper te
Kenneth McDonald wrote:
> I'm trying to write a 'flatten' generator which, when give a
> generator/iterator that can yield iterators, generators, and other data
> types, will 'flatten' everything so that it in turns yields stuff by
> simply yielding the instances of other types, and recursively
Kenneth McDonald wrote:
> I'm trying to write a 'flatten' generator which, when give a
> generator/iterator that can yield iterators, generators, and other data
> types, will 'flatten' everything so that it in turns yields stuff by
> simply yielding the instances of other types, and recursively yi
trevor lock wrote:
> Hello,
>
> I've just started using python and have observed the following :
>
> class foo:
> a=[]
> def __init__(self, val):
> self.a.append ( val )
> def getA(self):
> print self.a
> return self.a
>
> z = foo(5)
> y = foo(4)
> z.
John Coleman schrieb:
> Yes - it just seems that there isn't a principled reason for implicitly
> converting 3 to 3.0 in 3.0 == 3 but not implicitly converting "cat" to
> boolean in "cat" == true.
Sure there is: equality should be transitive. So while we have
3 == 3L == 3.0 == 3.0+0j
and can there
Kenneth McDonald schrieb:
> I would like to avoid putting this up on sourceforge as I think it would
> do much better at a site aimed specifically at Python development.
As somebody else said: you should put the code and announce the package
at the Cheeseshop: cheeseshop.python.org.
This doesn't
On Oct 25, 10:00 pm, "David S." <[EMAIL PROTECTED]> wrote:
> Does something like operator.getattr exist to perform a chained attr
> lookup?
Do you mean something like
class cattrgetter:
def __init__(self, name):
self.names = name.split('.')
def __call__(self, obj):
for nam
Paul Rubin wrote:
> John Salerno <[EMAIL PROTECTED]> writes:
>> Interesting idea to use try/finally to ensure that dlg.Destroy() runs
>> even with a return earlier in the method.
>
> Note that the code is wrong, the dialog should either be created
> outside the while loop, or destroyed inside it.
How about this?
def create_db_name(self):
dlg = wx.TextEntryDialog(self.frame, 'Enter a
database name:',
'Create New
Database')
db_name = None #or db_name = ""
if dlg.ShowModal() == wx.ID_OK:
db_name = dlg.GetValue()
1 - 100 of 274 matches
Mail list logo