then classname.close.__doc__ shows the text.
So, my question is, is there a way to get __doc__ support for
properties, in effect, use the """xxx""" syntax for documenting properties.
Is the preferred way to use """xxx""" or # to doc
the
module in there, but now "import lvk.modulename" doesn't find the module.
Is there a trick to this? Do I have to store my own modules beneath
C:\Python24\Lib? or can I use the organization I've tried just with some
minor fixes to make python locate my modules?
--
Lasse
g to
that definition.
I've tried finding an example in the lib code installed with Python but
can't seem to track down anything that is documented like that.
--
Lasse Vågsæther Karlsen
http://usinglvkblog.blogspot.com/
mailto:[EMAIL PROTECTED]
PGP KeyID: 0x2A42A1C2
--
http://mai
in? I assume that since there is some magic involved in invoking
python.exe here, stdin gets munged on the way.
--
Lasse Vågsæther Karlsen
http://usinglvkblog.blogspot.com/
mailto:[EMAIL PROTECTED]
PGP KeyID: 0x2A42A1C2
--
http://mail.python.org/mailman/listinfo/python-list
Lasse Vågsæther Karlsen wrote:
> I got a loop like this:
Ok, I've found some information. I don't like the answer but it doesn't
seem to be any good way to do this without hacking it one way or the other.
If someone has a brilliant answer that isn't in google y
While Microsoft and other big software vendors might have a roadmap
that ties you very tightly in with their budget, and also changes that
roadmap from time to time which breaks your current software, a lot of
open source projects have no roadmap at all.
This means that a .x.y.2 upgrade might very
Ok, when re-reading my post it seems that I'm saying that Python has no
roadmap. That was not my intent. I meant projects other than Python,
even though the problems I got with 2.4.2 is real, I suspect there's
something in Komodo that is the problem since I can run all my python
programs with 2.4.2
The specific error in your code, is that when cnto == len(ttllst), then
doing ttllst[cnto] will give you that error.
The list is indexed from 0 to len-1, which means that doing
list[len(list)] will give that error.
--
http://mail.python.org/mailman/listinfo/python-list
application, 3 in another and 4-5 in a third), a simple 2-source method
isn't enough but if it's better than what I do for 2 sources then I can
make a wrapper for it, since that's what I do anyway.
--
Lasse Vågsæther Karlsen
http://usinglvkblog.blogspot.com/
mailto:[EMAIL PROT
id something about Idle or Pythonwin, so it might be
what you need. I think the name was something like MSVCRT71.DLL but
don't think I got it 100% right just there... :P
--
Lasse Vågsæther Karlsen
http://usinglvkblog.blogspot.com/
mailto:[EMAIL PROTECTED]
PGP KeyID: 0x2A42A1C2
--
http://mail
Lasse Vågsæther Karlsen wrote:
> striker wrote:
>
>> I just downloaded and installed Python 2.4.2 on a Windows XP machine.
>> Everything I have tried so far has worked except for IDLE. Is there
> Just a thought though, during the installation of Python on one machine
>
Ok, that one looks more sleak than what I came up with.
Couple of things I learn from your solution, please correct me if I
misunderstood something:
1. list containing other lists will sort itself based on first element
on lists inside ?
2. sort(), pop() is not costly operations
Other than that
Thanks, that looks like Mike's solution except that it uses the
built-in heapq module.
While this one contains less code than Mike's solution it seems to lack
the ability to control the comparison operation, which means it won't
work in my case. I need to both be able to sort on an arbitrary field
Lasse Vågsæther Karlsen wrote:
> I need to merge several sources of values into one stream of values. All
> of the sources are sorted already and I need to retrieve the values from
Ok, after working through the various sources and solutions, here's what
I finally ended up
.. an irrational fear of snakes perhaps?
>
Clearly Python is superior because it doesn't need any code at all to do
fractals.
Surely you can see that? :)
I question the timings though, 2+ minutes to execute nothing doesn't
seem very pythonesque.
--
Lasse Vågsæther Karlsen
http://usi
ve to consider fibonacci(50) and fibonacci(idx =
50) as the same call and thus retrieve the second one from the cache.
--
Lasse Vågsæther Karlsen
http://usinglvkblog.blogspot.com/
mailto:[EMAIL PROTECTED]
PGP KeyID: 0x2A42A1C2
--
http://mail.python.org/mailman/listinfo/python-list
return result
# Return wrapper function
return cached_result
--
Lasse Vågsæther Karlsen
http://usinglvkblog.blogspot.com/
mailto:[EMAIL PROTECTED]
PGP KeyID: 0x2A42A1C2
--
http://mail.python.org/mailman/listinfo/python-list
etargspec(fn)[0]
so that can be done by the decorator function.
--
Lasse Vågsæther Karlsen
http://usinglvkblog.blogspot.com/
mailto:[EMAIL PROTECTED]
PGP KeyID: 0x2A42A1C2
--
http://mail.python.org/mailman/listinfo/python-list
Lasse Vågsæther Karlsen wrote:
> Sam Pointon wrote:
>
>> What about not storing args at all? Something like this:
Ok, here's my updated version:
class cache(object):
def __init__(self, timeout=0):
self.timeout = timeout
self.cache = {}
def
ts, which I honestly don't believe I will.
--
Lasse Vågsæther Karlsen
http://usinglvkblog.blogspot.com/
mailto:[EMAIL PROTECTED]
PGP KeyID: 0x2A42A1C2
--
http://mail.python.org/mailman/listinfo/python-list
solution that Mike came up with slightly changed to accomodate tips and
pointers from others in this thread.
--
Lasse Vågsæther Karlsen
http://usinglvkblog.blogspot.com/
mailto:[EMAIL PROTECTED]
PGP KeyID: 0x2A42A1C2
--
http://mail.python.org/mailman/listinfo/python-list
ly. Might be a big difference if I have a lot of sources though as I
bet the overhead in doing a sort of N items gets higher than doing a
manipulation of a heap to place an item in the right spot, but with 4-5
or a few more sources might not make an impact at all.
--
Lasse Vågsæthe
k here in a few days or even hours with
another "task" where you can probably cough up dozens of existing source
code solutions that I could use.
For instance, there's this thing I've heard of called the "wheel".
:)
--
Lasse Vågsæther Karlsen
http://usinglvkblog.blogspot.com/
mailto:[EMAIL PROTECTED]
PGP KeyID: 0x2A42A1C2
--
http://mail.python.org/mailman/listinfo/python-list
t 700 posts with
usenet.
Don't think so matey.
Nice try though.
--
Lasse Vågsæther Karlsen
http://usinglvkblog.blogspot.com/
mailto:[EMAIL PROTECTED]
PGP KeyID: 0x2A42A1C2
--
http://mail.python.org/mailman/listinfo/python-list
Fredrik Lundh wrote:
> Lasse Vågsæther Karlsen wrote:
>
>
>>Don't think so matey.
>
>
> oh, come on. a site run by some random guy in North Carolina has to be
> safer, faster and more reliable than a distributed communication system that
> has been around
Leave Xah Lee alone, he's a troll, he got no interested in doing
anything but to provoke people on usenet.
--
Lasse Vågsæther Karlsen
http://usinglvkblog.blogspot.com/
mailto:[EMAIL PROTECTED]
PGP KeyID: 0x2A42A1C2
--
http://mail.python.org/mailman/listinfo/python-list
ml
and say "richly formatted", whatever that might mean in the future.
But trying to keep your email world into a pure text-based
no-formatting-whatsoever world, that's a fantasy bubble that is bound to
burst, sooner rather than later.
Deal with it.
--
Lasse Vågsæther Karlse
uot;scripting
language" as well :)
In other words, what is the difference between a "scripting language"
and a "programming language".
--
Lasse Vågsæther Karlsen
http://usinglvkblog.blogspot.com/
mailto:[EMAIL PROTECTED]
PGP KeyID: 0x2A42A1C2
--
http://mail.python.org/mailman/listinfo/python-list
ed by themselves
without running it inside that program, and as thus was a way to add
minor functions and things to that program.
Nowadays a lot of the scripting languages have turned programming
languages so I think the difference is small.
--
Lasse Vågsæther Karlsen
http://usinglvkblog.
against captions?
>
> Giving photos captions is a *very* common practice.
Perhaps he has a search engine that can find blue hats in an image and
recognize people?
--
Lasse Vågsæther Karlsen
http://usinglvkblog.blogspot.com/
mailto:[EMAIL PROTECTED]
PGP KeyID: 0x2A42A1C2
--
http://mail.python.org/mailman/listinfo/python-list
items, and use it like this:
s = [k for k in iterable]
if I know beforehand how many items iterable would possibly yield, would
a construct like this be faster and "use" less memory?
s = [0] * len(iterable)
for i in xrange(len(iterable)):
s[i] = iterable.next()
--
Lasse Vågsæther
es[-1][0],
iterables[-2][0]) > 0:
iterables.sort(comparison, key=lambda x: x[0],
reverse=True)
except StopIteration:
iterables.pop(-1)
--
Lasse Vågsæther Karlsen
http://usinglvkblog.blogspot.com/
mailto:[EMAIL PROTECTED]
PGP KeyID: 0x2A42A1C2
--
http://mai
s):
if "cmp" in options: comparison = options["cmp"]
else: comparison = cmp
# rest of function here
and thus ignoring the wrong parameter names?
--
Lasse Vågsæther Karlsen
http://usinglvkblog.blogspot.com/
mailto:[EMAIL PROTECTED]
PGP KeyID: 0x2A42A1C2
--
http://mail.python.org/mailman/listinfo/python-list
Max M wrote:
> Lasse Vågsæther Karlsen wrote:
>
>> I must be missing something but what is the proper way to do a
>> function using such arguments ?
>
>
>> - ability to take an unspecified number of "positional arguments"
>
>
> You should pr
Lasse Vågsæther Karlsen wrote:
>
>
> Another idea for this method would be that in some cases I noticed that
> it was useful to know which source each element would come from as well,
> as well as removing duplicates from the results.
>
The "removing duplicates&quo
George Sakkis wrote:
> "Lasse Vågsæther Karlsen" <[EMAIL PROTECTED]> wrote:
>>I think I'll re-write to use a list instead
>
>
> Actually in most cases you don't need to assume it's a list; any
> iterable is usually good enough. You can always
ot of time.
>
> George
>
Itertools, meh, there's that wheel again :)
Didn't know about this one so thank you :)
--
Lasse Vågsæther Karlsen
http://usinglvkblog.blogspot.com/
mailto:[EMAIL PROTECTED]
PGP KeyID: 0x2A42A1C2
--
http://mail.python.org/mailman/listinfo/python-list
in the sense of limitations, but that crowd probably needs to be limited
in one way or another, like "only 2 rotten fruits per person" or similar.
--
Lasse Vågsæther Karlsen
http://usinglvkblog.blogspot.com/
mailto:[EMAIL PROTECTED]
PGP KeyID: 0x2A42A1C2
--
http://mail.python.org/mailman/listinfo/python-list
second letter, simply because he doesn't know which
one is right yet.
--
Lasse Vågsæther Karlsen
http://usinglvkblog.blogspot.com/
mailto:[EMAIL PROTECTED]
PGP KeyID: 0x2A42A1C2
--
http://mail.python.org/mailman/listinfo/python-list
age syntax is tainted. In
tainted how?
> Perl, a complex construct is invented. In both camps, the basic
invented how?
> mathematics of sorting and its implementation aspects are completely
> belied.
belied how?
It's interesting to note that these "fact posts" of you
Diez B. Roggisch wrote:
> Diez
>
> [1] http://xahlee.org/PageTwo_dir/Personal_dir/mi_pixra.html
Oh man... Talk about ... bummer.
Seriously, who do we call to get someone with a straightjacket to show
up at his home?
--
Lasse Vågsæther Karlsen
http://usinglvkblog.blogspot.com/
mail
Bengt Richter wrote:
> >>> tmp = 0
> >>> def execute():
> ... global tmp, execute
> ... tmp = cellvar = tmp + 1
> ... def execute():
> ... return cellvar
> ... return tmp
On man did this put my head into a sp
boolean variable or similar
for a magic value that means "now is a good time for you to terminate".
--
Lasse Vågsæther Karlsen
http://usinglvkblog.blogspot.com/
mailto:[EMAIL PROTECTED]
PGP KeyID: 0x2A42A1C2
--
http://mail.python.org/mailman/listinfo/python-list
#x27;t be interrupted
- an exception thrown at the wrong time in a finally/except block might
cause more problems than it intends to solve
So until a good implementation exists, there shouldn't be any point in
actually discussing the motives of the programmers who wishes to use the
How about:
list.sort(key=lambda x: x[3])
Does that work?
--
http://mail.python.org/mailman/listinfo/python-list
I have a list of items and a "rule" for ordering them.
Unfortunately, the rule is not complete so it won't define the correct
order for any two items in that list.
In other words, if I pick two random items from the list I may or may
not have a rule that dictates the order of those two items. T
Paul Rubin wrote:
> Lasse Vågsæther Karlsen <[EMAIL PROTECTED]> writes:
>
>>I have a list of items and a "rule" for ordering them.
>>
>>Unfortunately, the rule is not complete so it won't define the correct
>>order for any two items in that li
Lasse Vågsæther Karlsen wrote:
> Paul Rubin wrote:
>
>> Lasse Vågsæther Karlsen <[EMAIL PROTECTED]> writes:
>>
>>> I have a list of items and a "rule" for ordering them.
Ok, managed to implement the algorithm. Might not be the optimal
solution (memor
ure they would be obliged to do so either. However, controlling
what an independant outlet is doing, that's different.
--
Lasse Vågsæther Karlsen
http://usinglvkblog.blogspot.com/
mailto:[EMAIL PROTECTED]
PGP KeyID: 0x2A42A1C2
--
http://mail.python.org/mailman/listinfo/python-list
e law would prohibit
them from doing so.
Otherwise I could set up a shop, call it "Microsoft Porsgrunn" and sell
machines with only Linux installed.
I think Microsoft would be allowed to say "No, you can't do that".
--
Lasse Vågsæther Karlsen
http://usinglvkblog.blogs
> extract money from people and hand it to Microsoft and give those
What, specifically, is the criminal act of which you speak?
--
Lasse Vågsæther Karlsen
http://usinglvkblog.blogspot.com/
mailto:[EMAIL PROTECTED]
PGP KeyID: 0x2A42A1C2
--
http://mail.python.org/mailman/listinfo/python-list
David Schwartz wrote:
> Lasse Vågsæther Karlsen wrote:
>
>
>>I would think that if I set up a shop and wanted to have the word
>>"Microsoft" as part of the shop name, there would be some rules
>>dictating what products I could and could not sell, yes. Wether
David Schwartz wrote:
> Lasse Vågsæther Karlsen wrote:
>
>
>>David Schwartz wrote:
>
>
>>>Burger King won't let you sell Whoppers or buy their burger
>>>patties wholesale no matter what you want to call your store unless
>>>you take the
t; would be more
appropriate. A timeout is usually associated with starting a task and
waiting for it to complete, and continuing if it fails to complete in a
given timeframe, typically also aborting the task at the same time (ie.
executing a database query, connecting to a server, waiting for an
e
own to behave and look through HKEY_CLASSES_ROOT\.ext
to find the details you want.
--
Lasse Vågsæther Karlsen
http://usinglvkblog.blogspot.com/
mailto:[EMAIL PROTECTED]
PGP KeyID: 0x2A42A1C2
--
http://mail.python.org/mailman/listinfo/python-list
egitimate customers)
Nice plan sherlock.
--
Lasse Vågsæther Karlsen
http://usinglvkblog.blogspot.com/
mailto:[EMAIL PROTECTED]
PGP KeyID: 0x2A42A1C2
--
http://mail.python.org/mailman/listinfo/python-list
ght mouse click, select "Open With".
There are several ways to do this using Windows Explorer. I was under
the assumption the OP wanted to know how he could automate it since that
is what you typically want to do with applications you write.
--
Lasse Vågsæther Karlsen
http://usi
Just sit still while the men in white come to pick you up :)
--
Lasse Vågsæther Karlsen
http://usinglvkblog.blogspot.com/
mailto:[EMAIL PROTECTED]
PGP KeyID: 0x2A42A1C2
--
http://mail.python.org/mailman/listinfo/python-list
al people instead of just one.
--
Lasse Vågsæther Karlsen
http://usinglvkblog.blogspot.com/
mailto:[EMAIL PROTECTED]
PGP KeyID: 0x2A42A1C2
--
http://mail.python.org/mailman/listinfo/python-list
; than the file actually have? What
if the encoded data happens to have the magic byte values for something
else?
--
Lasse Vågsæther Karlsen
http://usinglvkblog.blogspot.com/
mailto:[EMAIL PROTECTED]
PGP KeyID: 0x2A42A1C2
--
http://mail.python.org/mailman/listinfo/python-list
60 matches
Mail list logo