I wish I new why google doesn't show nicely aligned python code when
you paste the script.
Anyways, in case this helps someone else you can download the script
from
http://www.kirbyfooty.com/simplemapi.py
Ian
--
http://mail.python.org/mailman/listinfo/python-list
Hi Lenard,
You just beat me to it.
Suprise, suprise, I discovered the answer myself this time.
I have modified the script to allow the attachment(s) to still be
passed as a string.
Some error checking is also done to verify the attachment file exists.
I have also modified it so it can be used for
Fredrik Lundh <[EMAIL PROTECTED]> wrote:
> the undocumented sre.Scanner provides a ready-made mechanism for this
> kind of RE matching; see
>
> http://aspn.activestate.com/ASPN/Mail/Message/python-dev/1614344
>
> for some discussion.
>
> here's (a slight variation of) the code example t
sometimes a have no internet access, but want to work :)
--
http://mail.python.org/mailman/listinfo/python-list
[EMAIL PROTECTED] writes:
> Hello again,
> Thanks for the advice!
> Unfortunately I still cannot get it to send attachments.
> It comes up with the following windows error..
> (I have a feeling it has something to do with the file count)
>
> >>> import simplemapi
> >>> simplemapi.SendMail("[EMAIL
Peter Hansen <[EMAIL PROTECTED]> wrote:
>
> John Roth wrote:
> > "Rocco Moretti" <[EMAIL PROTECTED]> wrote:
> >> The question is, should Guido state "TDD is the one true way to
> >> program in Python.", or should concessions be made in the language
> >> design for those who don't "drink the TDD
Add these lines to test1.py and see what you get:
import test2
print 'test2.glbl postinc ', test2.glbl
This will work as you expect.
Next try chaning glbl in test2 to a list (a mutable type).
test2.py:
glbl = [25]
def inc_glbl():
global glbl
glbl[0] = glbl[0] + 1
def get_glb
PD wrote:
> Hello,
>
> I am new to python, but i am quite curious about the following.
>
> suppose you had
>
> print '\378'
>
> which should not work because \377 is the max. then it displays two
> characters (an 8 and a heart in my case...). What else does'nt quite
> make sense is that if this is
I have a newby type question on how global variables work between
modules.
I have a module test2.py that defines a global variable as well as two
functions to operate on that variable. A script test1.py imports the
three names and prints out values of the global between operations, and
the resul
PD wrote:
I am new to python, but i am quite curious about the following.
print '\378'
which should not work because \377 is the max. then it displays two
characters (an 8 and a heart in my case...). What else does'nt quite
make sense is that if this is an octal why is an 8 accepted?
It would appea
'\378' becomes a two character string. The first character is '\37'
and the second character is '8'.
>>> str = '\378'
>>> str[0]
'\x1f'
>>> str[1]
'8'
>>>
On 23 Dec 2004 20:53:13 -0800, PD <[EMAIL PROTECTED]> wrote:
> Hello,
>
> I am new to python, but i am quite curious about the following.
>
Hello,
I am new to python, but i am quite curious about the following.
suppose you had
print '\378'
which should not work because \377 is the max. then it displays two
characters (an 8 and a heart in my case...). What else does'nt quite
make sense is that if this is an octal why is an 8 accepte
Hi,
I thought I'd throw in my 2 cents worth.
I have written a freeware task scheduler that might be of interest to
you.
It's called Kirby Alarm And Task Scheduler.
Over 16000 people around the world use it.
Kirby Alarm will run a program, pop up a note, play a sound, or send an
email at whatever
Web browser "widgets" seem pretty limited to me, though. You don't even
have something as simple as a combo box (i.e. an editable entry with
a drop
down), let alone the rich set of widgets something like wxwidgets
offers.
Also web development doesn't seem as coherent to me as development
with a
I have several ascii files that contain '\ooo' strings which represent
the octal value for a character. I want to convert these files to
unicode, and I came up with the following script. But it seems to me
that there must be a much simpler way to do it. Could someone more
experienced suggest some i
Stephen Thorne wrote:
> Lambdas contain only a single expression. Even the py3k
> wiki page ignores this critical difference. A single expression
> means no statements of any kind can be included. Assignment,
> if/elif/else, while, for, try/except, etc are not catered
> for in lambdas.
That's been
Nick Coghlan wrote:
> ...rather than pushing to retain lambda for Py3K, it might
> be more productive to find a better statement -> expression
> translation for function definitions. Guido seems to prefer
> named functions, so it would still be tough to gain his
> acceptance. However, a more Python
Sorry... I just realized that somebody else already had started a
thread on this...
--
http://mail.python.org/mailman/listinfo/python-list
Hi folks,
This is an interesting new article (published today Dec. 23).
Guido discusses the possibility of adding optional static typing to
Python:
http://www.artima.com/weblogs/viewpost.jsp?thread=85551
--
http://mail.python.org/mailman/listinfo/python-list
I'm curious about the long term trends chart on the TIOBE Programming
Community Index chart at http://www.tiobe.com/tpci.htm. It shows the
prevalence of Delphi and Python have tracked roughly equivalent usage paths
for some years now. Does anyone know why, or is this just an interesting
but i
Hello again,
Thanks for the advice!
Unfortunately I still cannot get it to send attachments.
It comes up with the following windows error..
(I have a feeling it has something to do with the file count)
>>> import simplemapi
>>> simplemapi.SendMail("[EMAIL PROTECTED]","The Subject","The
body","c:\i
Hello Aaron,
You need to check the demo that comes with wxPython if you don't
have it get it. Look under wxHtmlWindow and click the demo tab then
just scroll down and there is a link to it that says IMAGEMAP.
Or in other words RTFD ;)
M.E.Farmer
--
http://mail.python.org/mailman/listinfo/python-
"Stephen" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED]
>I like the idea of being able to port specific sections to C ... Python
> seems more flexible than PHP ... scalable.
If you want portions of your code in C, then wrap them with Swig.
That way they can be available in any numbe
> I considered doing exactly the same thing a while ago, but was worried
> about running into an annoyance like that.
FWIW, The synchronous Pyro server performed much faster than the
multithreaded version, even under heavy use from 3 machines.
It appeared that while the database queries were se
I know this is a thing used primarily on websites..but since python can do
anything ;)
I'm trying to make a clickable image map for my wxPython program.
Basically, I know how to organize the images into one large image in a
panel, but how do I make the individual pieces clickable like webpage
link
Mike Meyer <[EMAIL PROTECTED]> wrote:
> Noam Raphael <[EMAIL PROTECTED]> writes:
>
> > The answer is that a subclass is guaranteed to have the same
> > *interface* as the base class. And that's what matters.
>
> This is false. For instance:
>
> class A(object):
> def method(self, a):
> pri
Noam Raphael <[EMAIL PROTECTED]> wrote:
> However, I'm not sure if this solves my practical problem - testing
> whether all abstract methods were implemented. I think that usually, you
> can't write a test which checks whether an abstract method did what it
> should have, since different implemen
Dave Cook <[EMAIL PROTECTED]> writes:
> > You might not care.
>
> And in that case Tk is much simpler than just about anything else, unless
> looks are really important.
I've used tk and I don't think it's simpler than html.
> Takes up twice as much space and is potentially confusing as the drop
Mike Meyer wrote:
Noam Raphael <[EMAIL PROTECTED]> writes:
The answer is that a subclass is guaranteed to have the same
*interface* as the base class. And that's what matters.
This is false. For instance:
class A(object):
def method(self, a):
print a
class B(A):
def method(self, a, b):
p
<[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> Well, you can say apply() is 'deprecated' now,
What is deprecated is the spelling, not the concept or functionality.
As far as I know, apply(func, args) is exactly equivalent to func(*args).
If the latter had been invented in the begi
On Fri, 24 Dec 2004 02:59:40 +1030, Ishwor <[EMAIL PROTECTED]> wrote:
> >>> 123[0] + 2
> 3
TypeError: unsubscriptable object
> > > in which basically python can infer from the object type and print out
> > > 1 instead of coughing up those errors?
> >
> > Why do you feel it should cough up 1?
> >
Jp Calderone wrote:
This lets you avoid duplicate test code as well as easily test
new concrete implementations. It's an ideal approach for frameworks
which mandate application-level implementations of a particular
interface and want to ease the application developer's task.
Jp
It's a great
I like the idea of being able to port specific sections to C ... Python
seems more flexible than PHP ... scalable.
We're mainly using it to drive dynamic web apps ... online store ...
etc.
Thanks Again!
Stephen
--
http://mail.python.org/mailman/listinfo/python-list
Ishwor wrote:
> On 23 Dec 2004 06:46:50 -0800, Fuzzyman <[EMAIL PROTECTED]> wrote:
> > damn... I'm losing my leading spaces indentation should be
obvious
> We'll forgive you for that. It was from "top-of-your-head" ~;-)
>
Hey - I put the indentation in there... it just got stripped out when
i
Steven Bethard wrote:
> Fuzzyman wrote:
> >>>Steven Bethard wrote:
>
> So, one of my really common use cases that takes advantage of the
> fact that default parameters are evaluated at function definition
> time:
>
> def foo(bar, baz, matcher=re.compile(r'...')):
>
Steve Holden wrote:
you might want to look at www.egenix.com and think about installing
the mxODBC module, which I have used with very good results.
I'd also recommend checking out the imaginatively named adodbapi
(http://adodbapi.sourceforge.net/) which allows you to use any ODBC
driver through
Bob Cowdery wrote:
> Thanks for your help Robert. I'm still not
> understanding what I am seeing. I've forgotten
> about the objective for the moment. I just want
> to understand metaclasses.
All right; then I'll skip the speech about how metaclasses are not the solution
you're looking for. ;) Th
Simon Wittber wrote:
If you can get the DB-API wrappers running on Win2k, how about doing that
locally and then
writing a quickie socket server which your linux client can connect to?
I've exposed the DB API using Pyro. I had to turn multithreading off,
as the server leaked memory on every query.
On 2004-12-21, Paul Rubin wrote:
> Dave Cook <[EMAIL PROTECTED]> writes:
>> Web browser "widgets" seem pretty limited to me, though.
>
> You might not care.
And in that case Tk is much simpler than just about anything else, unless
looks are really important.
>> You don't even have something as
flupke wrote:
On winsdows i could get by by using ODBC and the dll's to access the
solid database but i want to eventually run it on a linux server.
ODBTP (http://odbtp.sourceforge.net/) allows you to hit Windows ODBC
drivers over the network from any machine with a C compiler. If it
sounds lik
John Roth wrote:
"Rocco Moretti" <[EMAIL PROTECTED]> wrote:
The question is, should Guido state "TDD is the one true way to
program in Python.", or should concessions be made in the language
design for those who don't "drink the TDD Kool-aide".
Neither one. I hope you didn't mean that people
who
Dear Python User:
Following my last message, I am pleased to be able to
announce that you can register for PyCon DC 2005 on the
web at
http://www.python.org/pycon/2005/register.html
starting at 1700 EST today (December 23). Thanks to
George Belotsky of Open Light Software for assistance
in
Jeff Shannon wrote:
> Ishwor wrote:
>
> >On Thu, 23 Dec 2004 13:33:16 -0300, Batista, Facundo
> ><[EMAIL PROTECTED]> wrote:
> >
> >
> >>[Ishwor]
> >>
> >>#- > What should 035[0] cough up? Be carefull it should
> >>#-
> >>#- >>>035[0]
> >>#- 3 # my own opinion.
> >>
> >>
> >why 3? The reason we get
Hey Steve,
I did write a program to deal with the windows command interpreter, and
it works.
I don't need to do this, but a friend of mine needed to issue commands
to the interpreter via pipes from a non python program, and he has a
fully functional component for using pipes, and has done it wi
<[EMAIL PROTECTED]> wrote:
> Thanks. :-) Two remarks.
> o One-liner fits the eyes & brains of a portion of people.
True! So, personally, I'd rather code, e.g.,
def bools(lst): return map(bool, lst)
rather than breal this one-liner into two lines at the colon, as per
standard Python style. How
[EMAIL PROTECTED] writes:
> Hi Lenard,
>
> As the risk of severely embarassing myself can I ask for your help one
> more time.
> I have tried changing your script to include attachments, but guess
> what, (and this should come as no suprise) I can't do it.
> So
> Here is my feeble attempt at
Jp Calderone <[EMAIL PROTECTED]> wrote in
news:[EMAIL PROTECTED]:
> On Thu, 23 Dec 2004 13:36:08 GMT, rzed <[EMAIL PROTECTED]> wrote:
>>Stephen Thorne <[EMAIL PROTECTED]> wrote in
>> news:[EMAIL PROTECTED]:
>> > [snip]
>> >
>> > {
>> > 'one': lambda x:x.blat(),
>> > 'two': lambda x:x.blah(),
Robin Becker wrote:
Alex Martelli wrote:
.
By the way, if that's very important to you, you might enjoy Mozart
(http://www.mozart-oz.org/)
.very interesting, but it wants to make me install emacs. :(
Apparently you can also use oz with a compiler and runtime engine...see
http://www.mozart-o
In article <[EMAIL PROTECTED]>,
Alan Gauld <[EMAIL PROTECTED]> wrote:
> I dunno. Here in the UK there was a small home computer called (I
> think) the Oric(*) which had a membrane keyboard, 4K or RAM and
> ran Forth.It had a small cult following before dying out. It
> looked a bit like the early
Avi Berkovich wrote:
Hello,
I was unable to use popen2.popen4 to grab python.exe's (2.3) output, for
starts, it doesn't show the version information at the beginning and
won't return anything when writing to the stdin pipe, it seems that if I
give it some error nous expression, the pipe would re
-Galahad,
Thank you very much. I will give it a shot and see if I can make it
hapen. I think this will help a lot.
I was just trying to implement a simple sorting algorithm that I knew
from C++, for practice but I couldn't figure the mechanics of Python.
Thanks again,
Novitiate
--
http://mai
Ishwor wrote:
On Thu, 23 Dec 2004 13:33:16 -0300, Batista, Facundo
<[EMAIL PROTECTED]> wrote:
[Ishwor]
#- > What should 035[0] cough up? Be carefull it should
#-
#- >>>035[0]
#- 3 # my own opinion.
why 3? The reason we get 3 and not 0 here is the *fact* that Python
knows that its an o
Ishwor wrote:
On Thu, 23 Dec 2004 11:17:57 -0300, Batista, Facundo
Well, because the integer is not a subscriptable object
If i see this code 'a'[0] then what does it really say about semantics
?? Really its hard for me to digest that 'a'[0] is supported by Python
where as 1[0] isn't.
5.2/3 is
Alex Martelli wrote:
> I don't know what it IS about lambda that prompts so much dubious to
> absurd use, but that's what I observed. I don't know if that plays any
> role in Guido's current thinking, though -- I have no idea how much
> "dubious Python" he's had to struggle with.
Just a side com
-Galahad,
Thank you very much. I will give it a shot and see if I can make it
hapen. I think this will help a lot.
I was just trying to implement a simple sorting algorithm that I knew
from C++, for practice but I couldn't figure the mechanics of Python.
Thanks again,
Novitiate
--
http://mai
Hello,
I was unable to use popen2.popen4 to grab python.exe's (2.3) output, for
starts, it doesn't show the version information at the beginning and
won't return anything when writing to the stdin pipe, it seems that if I
give it some error nous expression, the pipe would return the exception
d
Skip Montanaro <[EMAIL PROTECTED]> wrote in
news:[EMAIL PROTECTED]:
>
> Stephen> {
> Stephen> 'one': lambda x:x.blat(),
> Stephen> 'two': lambda x:x.blah(),
> Stephen> }.get(someValue, lambda x:0)(someOtherValue)
>
> One thing to remember is that function calls in Python are
>
Hi all,
I got python 2.3 on a XP and win2k. I'm looking for
a _socket.pyd that support raw socket (IP_HDRINCL).
I did found someone guy that did compile his
own _socket (pysockraw) but the web is not working anymore :/
I'm lazy to compile my own :)
Thx, and Merry X-mas!!
Simon Roses Fe
John Roth wrote:
"Rocco Moretti" <[EMAIL PROTECTED]> wrote
>
Looking at C, it's doubtful error prevention and program clarification
was a serious objective in the static typing system. It's more
reasonable to conclude that C is statically typed because it allows
the compiler to more easily allo
Dear Jeff,
Thank you, it was the numeric. After I installed the numeric library
which is Numeric-23.6.win32-py2.3.exe for python 2.3.4 verson, it is
working correctly.
Thank you again,
Kyung
--
http://mail.python.org/mailman/listinfo/python-list
Title: hidding the "console" window + system global shortcut keys
Hi, it's a broad topic because they all poped in my head at the same time while writting the alpha version of a desktop-helper app.
The app must be the less obstrusive possible. some history: It's mainly for win32. I started wr
I have gone through the pain of trying to use those commands and use
other available cron clients for Windows to find they are expensive, or
have bugs and are not stable. So I wrote a very simple yet powerful
script that handles all the basic functionality of Cron. It has been
stable and used in pr
Cron clients for Windows to find they are expensive, or have bugs and
are not stable. So I wrote a very simple yet powerful script that
handles all the basic functionality of Cron. It has been stable and
used in production for about a year. The source code is in Python and
you can read it, it is a
Jp> PyStones may be short (and be nearly lambda free!) but it is one
Jp> opaque blob to me. I'd be hard pressed to rewrite it in any style,
Jp> given its perverse use of global state.
It's written that way on purpose, of course. Pystone is almost a direct
translation of a similar pr
"Rocco Moretti" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
John Roth wrote:
One of the comments on Artima asks a rather profound
question: static typing is an answer. What's the question?
(That's a paraphrase.)
The answer that everyone seems to give is that it
prevents errors and
On Thu, 23 Dec 2004 12:00:29 -0600, Skip Montanaro <[EMAIL PROTECTED]> wrote:
>
> >> While I'm sure it can be done, I'd hate to see a non-trivial Python
> >> program written with lambda instead of def.
>
> Jp> What, like this?
>
> Jp> (lambda r,p,b:...
>
> Jp> OTOH, maybe
Doug Holton:
>And there are some disadvantages to doing it this way.
>It means Python is more flexible to use than Boo,
I've just suggested the *syntax* that I like more.
Bye,
Bearophile
--
http://mail.python.org/mailman/listinfo/python-list
Scott David Daniels wrote:
I encourage anyone who gets further into solving the "How do I use
MinGW to build Python2.4 (and later) standard-distribution compatible
modules (.pyd s)?" question to share any clues they have. The MS
free compiler is useful to many, but not all of us.
I think the simpl
André Amram Duque wrote:
I have problem with re-install python 2.3.4, when I execute ./configure
is appear one message in config.log, follow below :
configure:1710: gccconftest.cc >&5
gcc: installation problem, cannot exec `cc1plus': No such file or directory
configure:1713: $? = 1
My gnu/li
Hi all!
I'm new to python and I seem to have a hit a of a brick wall. I hope
you guys can help.
I'm trying to rewrite some of my vbscripts in python. This particular
script connects to a mailbox in MS Exchange via ADO and calculates the
mailbox size. I seem to have run into a couple of issues get
Thomas Heller wrote:
It seems that Python itself converts unicode entries in sys.path to
normal strings using windows default conversion rules - is this a
problem that I can fix by changing some regional setting on my machine?
You can set the system code page on the third tab on the XP
regional set
> ;-) gotcha. But shouldn't this be valid too??
> >>> 123232[0]
No, it shouldn't be valid. It makes the implicit assumption that you
want the base 10 digit, which isn't really a good assumption to make in
the world of computers. Programmers are just as likely to want
hexadecimal, and arguments c
Grant Edwards wrote:
On 2004-12-23, Steven Bethard <[EMAIL PROTECTED]> wrote:
Ah, my mistake, I missed the [:] after the source argument
that was taking a copy... which brings up the question, how
many other people would miss it?
Too many. This is why I greatly prefer
list(lst)
T
Skip Montanaro wrote:
>Jp> OTOH, maybe that's still trivial, it's only a multiuser network
>Jp> chat server, after all.
>
> You cheated by not rewriting Twisted using only lambda.
isn't twisted already written with lambdas only? why else would they call it
"twisted"?
--
http:
"jfj" wrote:
> Personally I'm not a fan of functional programming but lambda *is* useful
> when I want to say for
> example:
>
> f (callback=lambda x, y: foo (y,x))
>
> I don't believe it will ever disappear.
agreed. there's no reason to spend this christmas rewriting your programs,
folks.
>> While I'm sure it can be done, I'd hate to see a non-trivial Python
>> program written with lambda instead of def.
Jp> What, like this?
Jp> (lambda r,p,b:...
Jp> OTOH, maybe that's still trivial, it's only a multiuser network
Jp> chat server, after all.
You che
[EMAIL PROTECTED] wrote:
> o Why don't you just say all python can be written in equivalent java,
your argumentation skills are awesome.
--
http://mail.python.org/mailman/listinfo/python-list
[EMAIL PROTECTED] wrote:
Hi,
According to your advice, I installed the numeric library which is
numarray-1.1.1.win32-py2.4.exe, but I got the error message as follows.
Any help? frustrated...
from nltk.corpus import gutenberg
John Roth wrote:
One of the comments on Artima asks a rather profound
question: static typing is an answer. What's the question?
(That's a paraphrase.)
The answer that everyone seems to give is that it
prevents errors and clarifies the program.
It might just be me, but I thought it was to simpl
Thanks. :-) Two remarks.
o One-liner fits the eyes & brains of a portion of people.
o Why don't you just say all python can be written in equivalent java,
can I assert that Guido doesn't want to get mixed with those
mainstream>?
--
http://mail.python.org/mailman/listinfo/python-list
Title: RE: extract news article from web
Excel in later offices has the "web query" feature.
(sorry about top posting)
-Original Message-
From: Steve Holden [mailto:[EMAIL PROTECTED]]
Sent: quinta-feira, 23 de dezembro de 2004 12:59
To: python-list@python.org
Subject: Re: extract n
[EMAIL PROTECTED] wrote:
I have this book called TEXT PROCESSING IN PYTHON by David Mertz on
hand, it is a good book and in the first chapter it is really a show
room for higher-order functions which I may now cite to remind you of
the FLEXIBILITY of this keyword.
I'm not exactly sure what you mean
"Eric Pederson" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED]
> My beloved Python-oriented webhost doesn't currently support Mod-Python
You can always do what I did. I wrote the backend of my app in Python
and run it as an XML-RPC server. I did the front end in PHP using the
Smart
I have problem with re-install python 2.3.4, when I execute ./configure
is appear one message in config.log, follow below :
configure:1710: gccconftest.cc >&5
gcc: installation problem, cannot exec `cc1plus': No such file or directory
configure:1713: $? = 1
My gnu/linux is 2.6.8-1-386(debian
<[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
Adding Optional Static Typing to Python looks like a quite complex
thing, but useful too:
http://www.artima.com/weblogs/viewpost.jsp?thread=85551
One of the comments on Artima asks a rather profound
question: static typing is an answer. W
Grant Edwards wrote:
I would have guessed that calling list() on a list
was a noop. I would be wrong. Surprised, but wrong.
I guess it's probably worth pointing out that most builtin mutable types
can be copied using the type constructor:
py> def check(obj):
... copy = type(obj)(obj)
...
I have this book called TEXT PROCESSING IN PYTHON by David Mertz on
hand, it is a good book and in the first chapter it is really a show
room for higher-order functions which I may now cite to remind you of
the FLEXIBILITY of this keyword.
''' combinatorial.py
from operator import mul, add, truth
Ishwor wrote:
On Thu, 23 Dec 2004 13:33:16 -0300, Batista, Facundo
<[EMAIL PROTECTED]> wrote:
[Ishwor]
#- > What should 035[0] cough up? Be carefull it should
#-
#- >>>035[0]
#- 3 # my own opinion.
#-
#- > cough up the same as 29[0].
#-
#- >>>29[0]
#- 2 #again my own opinion
Be aware th
On Thu, 23 Dec 2004 13:57:55 -0300, Batista, Facundo
<[EMAIL PROTECTED]> wrote:
>
>
> [Steven Bethard]
>
> #- True, true. Maybe you could lobby for copy as a builtin in
> #- Python 3000?
>
> That's a good idea to me. But copy() as a builtin is not clear if it's
> shallow or deep.
IMHO its
Title: RE: list IndexError
[Steven Bethard]
#- True, true. Maybe you could lobby for copy as a builtin in
#- Python 3000?
That's a good idea to me. But copy() as a builtin is not clear if it's shallow or deep.
. Facundo
. . . . . . . . . . . . . . . . . . . . . . . . . . . .
Jp Calderone wrote:
On Thu, 23 Dec 2004 10:19:33 -0600, Skip Montanaro <[EMAIL PROTECTED]> wrote:
While I'm sure it can be done, I'd hate to see a non-trivial Python program
written with lambda instead of def.
What, like this?
[snip horrible lambda expression]
OTOH, maybe that's still trivial,
Grant Edwards wrote:
Wouldn't the clearest way to get a copy would be to do
something like:
copy(lst) # I still think copy.copy() is a bit verbose...
True, true. Maybe you could lobby for copy as a builtin in Python 3000?
Steve
--
http://mail.python.org/mailman/listinfo/python-list
On 2004-12-23, Steven Bethard <[EMAIL PROTECTED]> wrote:
>> Ah, my mistake, I missed the [:] after the source argument
>> that was taking a copy... which brings up the question, how
>> many other people would miss it?
>
> Too many. This is why I greatly prefer
>
> list(lst)
To me, that's jus
On Thu, 23 Dec 2004 13:33:16 -0300, Batista, Facundo
<[EMAIL PROTECTED]> wrote:
>
>
> [Ishwor]
>
> #- > What should 035[0] cough up? Be carefull it should
> #-
> #- >>>035[0]
> #- 3 # my own opinion.
why 3? The reason we get 3 and not 0 here is the *fact* that Python
knows that its an octal
On Thu, 23 Dec 2004 13:33:16 -0300, Batista, Facundo
<[EMAIL PROTECTED]> wrote:
>
>
> [Ishwor]
>
> #- > What should 035[0] cough up? Be carefull it should
> #-
> #- >>>035[0]
> #- 3 # my own opinion.
> #-
> #- > cough up the same as 29[0].
> #-
> #- >>>29[0]
> #- 2 #again my own opinion
Title: RE: list Integer indexing dies??
[Ishwor]
#- > What should 035[0] cough up? Be carefull it should
#-
#- >>>035[0]
#- 3 # my own opinion.
#-
#- > cough up the same as 29[0].
#-
#- >>>29[0]
#- 2 #again my own opinion
Be aware that:
>>> 035 == 29
True
>>>
. Facundo
Skip Montanaro wrote:
>
>Keith> My personal gripe is this. I think the core language, as of 2.3
>Keith> or 2.4 is very good, has more features than most people will ever
>Keith> use, and they (Guido, et al.) can stop tinkering with it now and
>Keith> concentrate more on the standard
[Per Erik Stendahl <[EMAIL PROTECTED]>]
> sdfdsafasd
Generally speaking, yes, but not if you're concerned about Pythons
before 1.5.2 too. If you are, a reasonable workaround is:
try:
sdfdsafasd
except NameError:
pass
else:
True = None is None and 1 != 2
False = None is not None o
On Thu, 23 Dec 2004 10:19:33 -0600, Skip Montanaro <[EMAIL PROTECTED]> wrote:
>
> >> readability. Pythonic lambdas are just syntactic sugar in practice,
>
> Paul> Actually it's the other way around: it's named functions that are
> Paul> the syntactic sugar.
>
> While I'm sure it can b
Fuzzyman wrote:
Steven Bethard wrote:
So, one of my really common use cases that takes advantage of the
fact that default parameters are evaluated at function definition
time:
def foo(bar, baz, matcher=re.compile(r'...')):
...
text = matcher.sub(r'...', text)
...
Sure.. but you also gave a
1 - 100 of 207 matches
Mail list logo