On 12/16/2010 7:33 PM, Steven D'Aprano wrote:
Python's exception system has to handle two different situations: buggy
code, and bad data. It's not even clear whether there is a general
distinction to be made between the two, but even if there's not a general
distinction, there's certainly a dist
On 12/14/2010 6:31 PM, Ethan Furman wrote:
kj wrote:
The one thing I don't like about this strategy is that the tracebacks
of exceptions raised during the execution of __pre_spam include one
unwanted stack level (namely, the one corresponding to __pre_spam
itself).
__pre_spam should be complete
On Dec 15, 2:16 am, Steven D'Aprano wrote:
> On Tue, 14 Dec 2010 21:14:35 +, kj wrote:
> > Consider this code:
>
> > def spam(*args, **kwargs):
> > args, kwargs = __pre_spam(*args, **kwargs)
>
> > # args & kwargs are OK: proceed
> > # ...
>
> > def __pre_spam(*args, **kwargs):
> >
On 12/16/2010 11:32 PM, Carl Banks wrote:
> On Dec 16, 2:56 pm, Ryan Kelly wrote:
>> On Thu, 2010-12-16 at 21:49 +, John Gordon wrote:
>>> (This is mostly a style question, and perhaps one that has already been
>>> discussed elsewhere. If so, a pointer to that discussion will be
>>> appreciat
Hi, cronoklee
maybe you should check every module directory you want to import to see if
there is a __init__.py in it?
missing a __init__.py file would cause error when you try to import the
directory as a module.
在 Fri, 17 Dec 2010 11:42:48 +0800,cronoklee 写道:
Hi
I'm starting my first p
On Dec 16, 2:56 pm, Ryan Kelly wrote:
> On Thu, 2010-12-16 at 21:49 +, John Gordon wrote:
> > (This is mostly a style question, and perhaps one that has already been
> > discussed elsewhere. If so, a pointer to that discussion will be
> > appreciated!)
>
> > When I started learning Python, I
Hi
I'm starting my first python project but I'm having trouble getting
off the ground.
I've read all I can find about relative and absolute import paths but
it's just not making sense to me... There seems to be around ten
different ways to import a script.
I need my project to be portable so I can
"Torsten Mohr" 写入消息 news:ieed6o$iq...@news.lf.net...
Hi,
i search for a possibility to access OpenOffoce SpreadSheets from Python
with a reasonably new version of Python.
Can anybody point me to a package that can do this?
Best regards,
Torsten.
--- news://freenews.netfront.net/ - comp
On 12/16/2010 07:53 PM, Tim Harig wrote:
On 2010-12-17, Torsten Mohr wrote:
i search for a possibility to access OpenOffoce SpreadSheets from Python
with a reasonably new version of Python.
Can anybody point me to a package that can do this?
There is no package needed to read or write the ne
On 2010-12-17, Torsten Mohr wrote:
> i search for a possibility to access OpenOffoce SpreadSheets from Python
> with a reasonably new version of Python.
>
> Can anybody point me to a package that can do this?
There is no package needed to read or write the new open document files.
The files are
"Steven D'Aprano" wrote in message
news:4d0aa5e7$0$29997$c3e8da3$54964...@news.astraweb.com...
It doesn't look like you were learning Python. It looks like you were
learning C with Python syntax :(
True, although in many cases one has to interface to legacy C code where it'd
be rather more co
On 12/16/2010 5:07 PM Torsten Mohr said...
Hi,
i search for a possibility to access OpenOffoce SpreadSheets from Python
with a reasonably new version of Python.
Can anybody point me to a package that can do this?
If you're open to 'saving as xls' then xlrd/xlwt works well.
Otherwise, when
Hi,
i search for a possibility to access OpenOffoce SpreadSheets from Python
with a reasonably new version of Python.
Can anybody point me to a package that can do this?
Best regards,
Torsten.
--
http://mail.python.org/mailman/listinfo/python-list
On Thu, 16 Dec 2010 23:34:21 +, BartC wrote:
> In terms of a more realistic function (admittedly still a little
> contrived, as the loop would be written differently), I tried this:
>
> def p2(n):
> p=1
> while True:
> if n<=p: return p
> p<<=1
> return 0
>
> for i in xrange(10
On Dec 16, 9:55 pm, Jean-Michel Pichavant
wrote:
> I'd like to illutrate the fact that comparing strings using identity is,
> most of the time, a bad idea. However I'm searching a short example of
> code that yields 2 differents object for the same string content.
>
> Anyone has that kind of code
On Thu, 16 Dec 2010 10:39:34 -0600, Robert Kern wrote:
> On 12/16/10 10:23 AM, Steven D'Aprano wrote:
>> On Thu, 16 Dec 2010 07:29:25 -0800, Ethan Furman wrote:
>>
>>> Tim Arnold wrote:
"Ethan Furman" wrote in message
news:mailman.4.1292379995.6505.python-l...@python.org...
> kj wro
John Gordon wrote:
> But lately I've been preferring this style:
>
> def myMethod(self, arg1, arg2):
>
> if some_bad_condition:
> return bad1
>
> elif some_other_bad_condition:
> return bad2
>
> elif yet_another_bad_condition:
> return bad3
>
> do_some_useful_st
On Dec 16, 4:34 pm, "BartC" wrote:
> def p2(n):
> p=1
> whileTrue:
> if n<=p: return p
> p<<=1
> return 0
>
> for i in xrange(100):
> x=p2(i)
>
> p2() calculates the smallest power of 2 >= it's operand.
def p2(n):
return 1 << n.bit_length()
--
http://mail.python.org/mailman/
On Thu, 16 Dec 2010 21:49:07 +, John Gordon wrote:
> (This is mostly a style question, and perhaps one that has already been
> discussed elsewhere. If so, a pointer to that discussion will be
> appreciated!)
>
> When I started learning Python, I wrote a lot of methods that looked
> like this
"Steve Holden" wrote in message
news:mailman.54.1292502247.6505.python-l...@python.org...
On 12/16/2010 5:44 AM, BartC wrote:
One these is 30% faster than the other. That's an appreciable
difference, which you can't really just dismiss.
shol...@lifeboy ~
$ python -m timeit -- "i = 1" "whi
On Thu, Dec 16, 2010 at 3:41 PM, Stefan Sonnenberg-Carstens
wrote:
> return [x for x,y in
> ((bad1,some_bad_condition),(bad2,some_other_bad_condition),(bad3,yet_another_bad_condition),(good1,do_some_useful_stuff()
> or True)) if x][0]
This doesn't work. do_some_usefull_stuff() gets called during
On Thu, 2010-12-16 at 21:49 +, John Gordon wrote:
> (This is mostly a style question, and perhaps one that has already been
> discussed elsewhere. If so, a pointer to that discussion will be
> appreciated!)
>
> When I started learning Python, I wrote a lot of methods that looked like
> this:
Am 16.12.2010 22:49, schrieb John Gordon:
(This is mostly a style question, and perhaps one that has already been
discussed elsewhere. If so, a pointer to that discussion will be
appreciated!)
When I started learning Python, I wrote a lot of methods that looked like
this:
def myMethod(self
On 2010-12-16, John Gordon wrote:
> (This is mostly a style question, and perhaps one that has already been
> discussed elsewhere. If so, a pointer to that discussion will be
> appreciated!)
>
> When I started learning Python, I wrote a lot of methods that looked like
> this:
>
>
> def myMethod
On 2010-12-16, John Gordon wrote:
> I like this style more, mostly because it eliminates a lot of indentation.
>
> However I recall one of my college CS courses stating that "one entry,
> one exit" was a good way to write code, and this style has lots of exits.
So, take the good intentation from
John Gordon wrote:
(This is mostly a style question, and perhaps one that has already been
discussed elsewhere. If so, a pointer to that discussion will be
appreciated!)
When I started learning Python, I wrote a lot of methods that looked like
this:
def myMethod(self, arg1, arg2):
if so
(This is mostly a style question, and perhaps one that has already been
discussed elsewhere. If so, a pointer to that discussion will be
appreciated!)
When I started learning Python, I wrote a lot of methods that looked like
this:
def myMethod(self, arg1, arg2):
if some_good_condition:
pyt...@bdurham.com, 16.12.2010 21:03:
Is text processing with dicts a good use case for Python
cross-compilers like Cython/Pyrex or ShedSkin? (I've read the
cross compiler claims about massive increases in pure numeric
performance).
Cython is generally a good choice for string processing, simpl
Hi - I was just trying to install the Python debugger pudb (http://
pypi.python.org/pypi/pudb) and easy install fell over saying it
couldn't find a module termios.
It turns out termios is only for Unix (http://docs.python.org/library/
termios.html).
Does anyone know of way around this ? Is there
Jean-Michel Pichavant writes:
> Fellows,
>
> I'd like to illutrate the fact that comparing strings using identity
> is, most of the time, a bad idea. However I'm searching a short
> example of code that yields 2 differents object for the same string
> content.
>
> id('foo')
> 3082385472L
> id('fo
Arnaud Delobelle wrote:
Ethan Furman writes:
...I timed exec vs function, and found the function style to be about
200% faster...
So it finished before it started?
Hmmm
Let me check my calculator...
.
.
.
Ah! Okay, that was 200x faster. :) I think -- it was a few months ago
no
On 12/16/2010 04:36 AM, Octavian Rasnita wrote:
> From: "Ian Kelly"
>
> On Mon, Dec 13, 2010 at 5:58 PM, Gerry Reno wrote:
>
>> The VIEW is the bits that stream out of the webserver back to the users
>> browser.
>>
> Why only to the user's browser? A web app could also offer the results
On 12/16/2010 7:23 AM, Steve Holden wrote:
On 12/16/2010 5:44 AM, BartC wrote:
One these is 30% faster than the other. That's an appreciable
difference, which you can't really just dismiss.
And you can't tell what the overall effect on a program will be: perhaps
the loop will be in a library
Ethan Furman writes:
> ...I timed exec vs function, and found the function style to be about
> 200% faster...
So it finished before it started?
--
Arnaud
--
http://mail.python.org/mailman/listinfo/python-list
Is text processing with dicts a good use case for Python
cross-compilers like Cython/Pyrex or ShedSkin? (I've read the
cross compiler claims about massive increases in pure numeric
performance).
I have 3 use cases I'm considering for Python-to-C++
cross-compilers for generating 32-bit Python exten
FWIW, I got around the issue with some samba mount options. They still
show as 0700, but I, or anybody elsefor that matter, can still access
them.
Computers are weird. :P
Thanks to all who responded. :)
On Dec 10, 2:57 pm, Alex Willmer wrote:
> On Dec 8, 6:26 pm, Christian Heimes wrote:
>
> >
Each lesson required you to complete a practical assignment. You submit
these assignments for evaluation, and do not proceed to the next lesson
until your assignment reaches a satisfactory standard. Thus, less
experienced students will tend to have more interaction with their tutors.
A class will
So how exactly does the class work? Is it like an elementary CS class
where you have a teacher, assignments, etc. Or is it more like a
guided tour through the O'Reilly Python book/cookbook?
On Thu, Dec 16, 2010 at 10:40 AM, Ethan Furman wrote:
> Please don't top-post. :)
>
> Nitin Pawar wrote:
>
On Nov 11, 11:48 pm, John Bond wrote:
> Anyone have any experience with this, ideally using Python 3?
>
> I'd like to sync my Thunderbird contacts with various things including
> my mobile phone. Of course, I want to do it with Python! I've seen some
> stuff around, eg. an XPI that provides Python
PyGUI 2.3.2 is available:
http://www.cosc.canterbury.ac.nz/greg.ewing/python_gui/
This version fixes a problem in Cocoa whereby the coordinate
system for drawing in a Pixmap was upside down, and corrects
a slight mistake in the Canvas documentation.
What is PyGUI?
--
PyGUI is a
On 12/16/10 10:23 AM, Steven D'Aprano wrote:
On Thu, 16 Dec 2010 07:29:25 -0800, Ethan Furman wrote:
Tim Arnold wrote:
"Ethan Furman" wrote in message
news:mailman.4.1292379995.6505.python-l...@python.org...
kj wrote:
The one thing I don't like about this strategy is that the tracebacks
of
On Thu, 16 Dec 2010 07:29:25 -0800, Ethan Furman wrote:
> Tim Arnold wrote:
>> "Ethan Furman" wrote in message
>> news:mailman.4.1292379995.6505.python-l...@python.org...
>>> kj wrote:
The one thing I don't like about this strategy is that the tracebacks
of exceptions raised during the
On 16 déc, 15:53, Jean-Michel Pichavant
wrote:
> Mel wrote:
> > Jean-Michel Pichavant wrote:
>
> >> Fellows,
>
> >> I'd like to illutrate the fact that comparing strings using identity is,
> >> most of the time, a bad idea. However I'm searching a short example of
> >> code that yields 2 different
On 16 déc, 15:52, Jean-Michel Pichavant
wrote:
> bruno.desthuilli...@gmail.com wrote:
> > On 16 d c, 12:55, Jean-Michel Pichavant
> > wrote:
>
> >> id('foo')
> >> 3082385472L
> >> id('foo')
> >> 3082385472L
>
> >> Anyone has that kind of code ?
>
> > 2 points:
>
> > 1- an id is only valid for the
Please don't top-post. :)
Nitin Pawar wrote:
Can someone provide any links or any starting points on how to apply and
what are the prerequisites
http://www.oreillyschool.com/certificates/python-programming.php
No prerequisites that I could see, and currently they are running a 25%
discount
BartC wrote:
"Steve Holden" wrote in message
news:mailman.462.1292214062.2649.python-l...@python.org...
On 12/12/2010 2:32 PM, Christian Heimes wrote:
Am 12.12.2010 19:31, schrieb Steve Holden:
$ python -m timeit -n20 -- "i = 0" "while 1:" "i+=1" "if i ==
100: break"
20 loops, best
Tim Arnold wrote:
"Ethan Furman" wrote in message
news:mailman.4.1292379995.6505.python-l...@python.org...
kj wrote:
The one thing I don't like about this strategy is that the tracebacks
of exceptions raised during the execution of __pre_spam include one
unwanted stack level (namely, the one c
Mel wrote:
Jean-Michel Pichavant wrote:
Fellows,
I'd like to illutrate the fact that comparing strings using identity is,
most of the time, a bad idea. However I'm searching a short example of
code that yields 2 differents object for the same string content.
id('foo')
3082385472L
id('foo')
bruno.desthuilli...@gmail.com wrote:
On 16 déc, 12:55, Jean-Michel Pichavant
wrote:
id('foo')
3082385472L
id('foo')
3082385472L
Anyone has that kind of code ?
2 points:
1- an id is only valid for the lifetime of a given object - when the
object has been collected, the id can be reu
Mark,
Congratulations on your latest release!
How well do python extension modules created with ShedSkin work
with applications that expose a GUI, eg. Tkinter or wxPython
apps?
Can ShedSkin code be run in a thread and communicate with the
main interpreter thread through a Queue or Lock? (Or shou
Jean-Michel Pichavant wrote:
Fellows,
I'd like to illutrate the fact that comparing strings using identity
is, most of the time, a bad idea. However I'm searching a short
example of code that yields 2 differents object for the same string
content.
id('foo')
3082385472L
id('foo')
3082385472L
Jean-Michel Pichavant wrote:
> Fellows,
>
> I'd like to illutrate the fact that comparing strings using identity is,
> most of the time, a bad idea. However I'm searching a short example of
> code that yields 2 differents object for the same string content.
>
> id('foo')
> 3082385472L
> id('foo'
John Bond writes:
> Anyone have any experience with this, ideally using Python 3?
I don't but there is a great need to have a working SyncML client for
Thunderbird. Funambol used to have one available, but it has crashing
problems with Thunderbird 3 for some people. The existing extension
was do
Peter Otten wrote:
> Steve Holden wrote:
>
>> On 12/16/2010 6:55 AM, Jean-Michel Pichavant wrote:
>>> Fellows,
>>>
>>> I'd like to illutrate the fact that comparing strings using identity is,
>>> most of the time, a bad idea. However I'm searching a short example of
>>> code that yields 2 differ
Steve Holden wrote:
> On 12/16/2010 6:55 AM, Jean-Michel Pichavant wrote:
>> Fellows,
>>
>> I'd like to illutrate the fact that comparing strings using identity is,
>> most of the time, a bad idea. However I'm searching a short example of
>> code that yields 2 differents object for the same strin
Hi all,
I have just released Shed Skin 0.7, an optimizing (restricted-)Python-to-C++
compiler. It comes with lots of minor fixes and some optimizations, a new
Windows package (which includes GCC 4.5), and two nice new examples, for a
total of 52 examples at around 14,000 lines (sloccount). Please
- Mensaje reenviado
> De: Peter Otten <__pete...@web.de>
> Para: python-list@python.org
> Asunto: Re: Calling function from another module
> Fecha: Thu, 16 Dec 2010 13:16:30 +0100
> Grupos de noticias: comp.lang.python
>
> craf wrote:
>
> > Hi.
> >
> > The query code is as follo
On 12/16/2010 6:55 AM, Jean-Michel Pichavant wrote:
> Fellows,
>
> I'd like to illutrate the fact that comparing strings using identity is,
> most of the time, a bad idea. However I'm searching a short example of
> code that yields 2 differents object for the same string content.
>
> id('foo')
>
On 12/16/2010 5:44 AM, BartC wrote:
>> On 12/12/2010 2:32 PM, Christian Heimes wrote:
>>> Am 12.12.2010 19:31, schrieb Steve Holden:
>>> $ python -m timeit -n20 -- "i = 0" "while 1:" "i+=1" "if i ==
>>> 100: break"
>>> 20 loops, best of 3: 89.7 msec per loop
>>> $ python -m timeit -n20
craf wrote:
> Hi.
>
> The query code is as follows:
>
> --
> import Tkinter
> import tkMessageBox
>
>
> class App:
> def __init__(self, master):
> master.protocol("WM_DELETE_WINDOW",quit)
>
>
> def quit():
> if tkMessageBox.
On 16 déc, 12:55, Jean-Michel Pichavant
wrote:
> Fellows,
>
> I'd like to illutrate the fact that comparing strings using identity is,
> most of the time, a bad idea. However I'm searching a short example of
> code that yields 2 differents object for the same string content.
>
> id('foo')
> 308238
On Thursday, December 16, 2010 7:55:20 AM UTC-4, jeanmichel wrote:
> Fellows,
>
> I'd like to illutrate the fact that comparing strings using identity is,
> most of the time, a bad idea. However I'm searching a short example of
> code that yields 2 differents object for the same string content.
Fellows,
I'd like to illutrate the fact that comparing strings using identity is,
most of the time, a bad idea. However I'm searching a short example of
code that yields 2 differents object for the same string content.
id('foo')
3082385472L
id('foo')
3082385472L
Anyone has that kind of code
"Steve Holden" wrote in message
news:mailman.462.1292214062.2649.python-l...@python.org...
On 12/12/2010 2:32 PM, Christian Heimes wrote:
Am 12.12.2010 19:31, schrieb Steve Holden:
$ python -m timeit -n20 -- "i = 0" "while 1:" "i+=1" "if i ==
100: break"
20 loops, best of 3: 89.7 ms
From: "Ian Kelly"
On Mon, Dec 13, 2010 at 5:58 PM, Gerry Reno wrote:
> The VIEW is the bits that stream out of the webserver back to the users
> browser.
Why only to the user's browser? A web app could also offer the results in
formats that can be accessed with something else than a browser.
Can someone provide any links or any starting points on how to apply and
what are the prerequisites
Thanks,
Nitin
On Thu, Dec 16, 2010 at 12:18 PM, Steve Holden wrote:
> On 12/15/2010 4:21 PM, Stefan Sonnenberg-Carstens wrote:
> > Am 15.12.2010 22:11, schrieb Steve Holden:
> >> On 12/15/2010 3:
On 15/12/2010 16:54, Stefan Sonnenberg-Carstens wrote:
> Just change to LDAP as authentication method.
> Even Active Directory offers LDAP (w/o SSL), and there
> are modules to interact with LDAP using python.
> And, it is platform indipendent.
>
> See here: http://www.python-ldap.org/
>
> I've
67 matches
Mail list logo