Hello guys,
I'm trying to learn python by making some small programs that could be
useful for some bigger propouses. In fact, i've made a small "check
latest-modified" for webpages and it's working great.
The next step I would like to do is to check if I have new e-mails (I
don't wanna read it fr
Boris Borcic a écrit :
> Hello Bruno,
>
> Bruno Desthuilliers wrote:
>
>> Boris Borcic wrote:
>>
Do you have any ideas?
>>>
>>>
>>> you could use a recursive generator, like
>>>
>>> def genAllChildren(self) :
>>> for child in self.children :
>>> yield child
>>> for childc
Nick Vatamaniuc a écrit :
(please don't top-post - corrected)
>
> Bruno Desthuilliers wrote:
>
(snip)
>>A few observations and questions :
>>- you should avoid tests on concrete types as much as possible - at
>>least use isinstance
>
> Good point about isinstance. Here is a good explanation w
Bruno Desthuilliers wrote:
> "Irrelevant" may not be the best expression of my thought here - it's
> just that Carl's assertion is kind of a tautology and doesn't add
> anything to the discussion. If Python had been designed as statically
> typed (with declarative typing), the rules would be differ
Bruno Desthuilliers wrote:
> There are less risk of a typo with "if a:" than with "if len(a) > 0".
So, it's more important to protect against typos than subtle bugs?
Carl Banks
--
http://mail.python.org/mailman/listinfo/python-list
Diez B. Roggisch wrote:
> will make the devices world readable. While I haven't thought about any
> security implications that might have (and am not especially
> knowledgeable in such things to be honest), I'm convinced it is way less
> likely to introduce any exploitable holes than suid root w
Grant Edwards <[EMAIL PROTECTED]> writes:
[...]
> > Often normal send() and recv() semantics have been mistaught.
> > An alert alien, looking at other common APIs in isolation,
> > might reasonably wonder whether there is some sort of
> > still_ok_to_use() sort of check as part of TCP. As it hap
Carl Banks a écrit :
> Bruno Desthuilliers wrote:
>
>>There are less risk of a typo with "if a:" than with "if len(a) > 0".
>
>
> So, it's more important to protect against typos than subtle bugs?
>
People making smart points are really annoying... !-)
wrt/ to the "subtle bug" point, MHO is t
Frank Millman wrote:
> I use something called 'srvany' -
>http://support.microsoft.com/kb/q137890/
I am familiar with srvany. Seems like it is a whole bunch easier than
the PyWin32 stuff.
I'll write a wrapper script that can be used like this:
createservice.py -myservicename -myservicepath
or
Bruno Desthuilliers wrote:
> Carl Banks a écrit :
> > Bruno Desthuilliers wrote:
> >
> >>There are less risk of a typo with "if a:" than with "if len(a) > 0".
> >
> >
> > So, it's more important to protect against typos than subtle bugs?
> >
>
> People making smart points are really annoying... !-
There's always the new 'with' statement in Python 2.5. So instead of
> f = open('foo', 'r')
> try:
>for line in f:
> print line
> finally:
>f.close()
>
...you do:
with open('foo','r') as f:
for line in f:
print line
It's at least a little bit cleaner, and it will clos
"Carl Banks" <[EMAIL PROTECTED]> writes:
> Well, I certainly can agree with that, except for the last point. :) I
> certainly wouldn't want to keep that unfortunate behavior around just I
> have something to use as an argument using len to test emptiness.
On the other hand, having this behavior
>> Hm didn't I leave ctypes in there? I added calldll because it
>> had a really nice can opener.
Oh, I have no idea (didn't download). I just sort of assumed if you had
included calldll you probably hadn't included ctypes.
Skip
--
http://mail.python.org/mailman/listinfo/python-li
John> This is recursive. Unlikely of course, but if the file contained a
John> large number of empty lines, might this not cause the recursion
John> limit to be exceeded?
Sure, but I was lazy. ;-)
Skip
--
http://mail.python.org/mailman/listinfo/python-list
Whoops, missed the second part.
John> Is there any reason to prefer this approach to Daniel's, apart
John> from being stuck with an older (pre-yield) version of Python?
No, it's just what I came up with off the top of my head.
John> A file given to csv.reader is supposed to be opened
"Patrick Maupin" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
>
> Carl Banks wrote:
>> def process_values(lst):
>> if not lst:
>> return
>> do_expensive_initialization_step()
>> for item in lst:
>> do_something_with(item)
>>
Jorge Godoy wrote:
> "Carl Banks" <[EMAIL PROTECTED]> writes:
>
> > Well, I certainly can agree with that, except for the last point. :) I
> > certainly wouldn't want to keep that unfortunate behavior around just I
> > have something to use as an argument using len to test emptiness.
>
> On the o
someone has made a "virtual appliance" specialized for python web
development. it has a huge list of included software.
if you're interested, see:
http://www.vmware.com/vmtn/appliances/directory/289
--
http://mail.python.org/mailman/listinfo/python-list
Bruno Desthuilliers wrote:
> Boris Borcic a écrit :
> > Hello Bruno,
> >
> > Bruno Desthuilliers wrote:
> >
> >> Boris Borcic wrote:
> >>
> Do you have any ideas?
> >>>
> >>>
> >>> you could use a recursive generator, like
> >>>
> >>> def genAllChildren(self) :
> >>> for child in self.chil
Duncan Booth wrote:
> Are you really sure that the browser isn't making guesses about what you
> meant and correcting the error for you? Does what remains in the address
> bar when the page is retrieved really match *exactly* what you copied and
> pasted?
Thank you for that pointer. The answer i
tac-tics wrote:
> Simon Forman wrote:
> > To me, and perhaps others, "T =
> > set(xrange(0, 1, 23))" and "n in T" are somewhat easier to read
> > and write than "not n % 23 and 0 <= n < 1", YMMV.
>
> Eh? How is the first easier to read than the second?? You have a nested
> function call in
Michael J. Fromberger ha scritto:
> Consider the following class hierarchy in Python:
>
> Is there a better (i.e., more elegant) way to handle the case marked
> (**) above?
>
> Curious,
> -M
>
> --
> Michael J. Fromberger | Lecturer, Dept. of Computer Science
> http://www.dartmouth.e
Matheus,
There is libgmail @ http://libgmail.sourceforge.net/
Here is the excerpt from their page.
"""
The following code logs into an account, retrieves a list of threads,
displays information about them and displays the source of the
individual messages.
"""
import libgmail
ga = libgmail.GmailAcc
In message <[EMAIL PROTECTED]>, Chris Spencer wrote:
> I've been looking for a method of transparent, scalable, and
> human-readable object persistence...
Don't do object persistence. What is an object? It's a combination of code
and data. Code structure is internal to your program--it has no bus
Hi All,
Not being able to figure out how are partial classes coded in Python.
Example: Suppose I have a code generator which generates part of a
business class, where as the custome part is to be written by me. In
ruby (or C#), I divide the code into two source files. Like this:
GeneratedPerson.
Joachim Durchholz wrote:
> Marshall schrieb:
> > Chris Smith wrote:
> >> Joachim Durchholz <[EMAIL PROTECTED]> wrote:
> >> I *think* I understand Marshall here. When you are saying "assignment",
> >> you mean assignment to values of attributes within tuples of the cell.
> >> When Marshall is sayin
Michael J. Fromberger wrote:
>
> Is there a better (i.e., more elegant) way to handle the case marked
> (**) above?
>
You have to call super in each method __init__, if you don't, the call
chain break before the end:
class A (object):
def __init__(self):
super(A, self).__init__()
Sanjay wrote:
> Not being able to figure out how are partial classes coded in Python.
Hi Sanjay,
To the best of my knowledge, Python currently has no support for
partial classes.
However, BOO (http://boo.codehaus.org/) - which is a Python-like
language for the .NET CLI)- _does_ support partial c
Were you looking for more specific
features?
Parallel Processing.
Grant,
It looks like
I have a lot more studying to do, all of the information that I have seems to be
screwed up. I will look at event
loops in Python to see if that answers my question.
I was just looking a
Sanjay wrote:
> Hi All,
>
> Not being able to figure out how are partial classes coded in Python.
>
> Example: Suppose I have a code generator which generates part of a
> business class, where as the custome part is to be written by me. In
> ruby (or C#), I divide the code into two source files. L
201 - 230 of 230 matches
Mail list logo