gt; 9
Something like:
myList = [1, 2, 3]
for i, j in enumerate(myList):
if i == len(myList)-1:
print j*j
else:
print j
Cheers,
Andreas Tawn
Lead Technical Artist
Ubisoft Reflections
--
http://mail.python.org/mailman/listinfo/python-list
b', 'a', 'd']
>
> Does anyone know what reversed() is actually doing?
>
> --
> Steven.
Without knowing the internals, it seems reversed() does exactly the
same as the following class:
class Reversed(object):
def __init__(self,seq):
self.seq = seq
self.i = len(seq)
def __iter__(self):
return self
def next(self):
self.i -= 1
if self.i < 0:
raise StopIteration
else:
return self.seq[self.i]
so it doesn't copy anything, just book-keeping of indexes. I guess one
would call this kind of object a (special) "view" of the sequence.
Cheers,
Andreas
--
http://mail.python.org/mailman/listinfo/python-list
intuitive if reversed() had
been implemented like this,
def Reversed(seq):
for i in xrange(len(seq)-1,-1,-1):
yield seq[i]
so that the length of the sequence is determined when the iteration
starts, not when the iterator is created?
The unfortunate naming may also have added to the confu
On Oct 19, 1:49 pm, Duncan Booth <[EMAIL PROTECTED]> wrote:
> Andreas Kraemer <[EMAIL PROTECTED]> wrote:
> >> The only other behaviours I would regard as intuitive for iteration over
> >> a mutating sequence would be to throw an exception either for mutating
>
On Oct 18, 4:39 pm, "[EMAIL PROTECTED]" <[EMAIL PROTECTED]> wrote:
> Hi,
> Does any one know whare I can find some code to phrase a rss feeds?
> Thank you,
> Ted
Try http://feedparser.org/
--
http://mail.python.org/mailman/listinfo/python-list
r suggests on ELF-based
systems this should only be used if absolutely unavoidable, IIRC). NB: There
is a project on SF which claimes to provide this feature on Windows, but I
haven't tried and it limits your choice of tools (http://edll.sf.net/).
cheers,
aa
--
Andreas Ames | Programm
raries dlopened will not
> see any of the symbols in my module?
Have you already checked the output of LD_DEBUG=all or sth. like that?
cheers,
aa
--
Andreas Ames | Programmer | Comergo GmbH |
Voice: +49 711 13586 7789 | ames AT avaya DOT com
--
http://mail.python.org/mailman/listinfo/python-list
Hey,
Can someone plz make a function for that takes a array, and then search
in it for duplicates, if it finds 2 or more items thats the same string
then delete all except 1.
Short: it deletes all duplicates in a array
thanks
--
_.____ __
Tim Golden wrote:
> [EMAIL PROTECTED] wrote:
>
>> is it possible to parse a pdf file in python? for starters, i would
>> like to count the number of pages in a pdf file. i see there is a
>> project called ReportLab, but it seems to be a pdf generator... i
>> can't tell if i would be able to pars
> On Dec 5, 6:00 am, "Andreas Tawn" <[EMAIL PROTECTED]> wrote:
> > I'm trying to integrate the timeout function from
> herehttp://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/47
> 3878into a
> > long running automation script and the following code
&
> > On Dec 5, 6:00 am, "Andreas Tawn" <[EMAIL PROTECTED]> wrote:
> > > I'm trying to integrate the timeout function from
> > herehttp://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/47
> > 3878into a
> > > long running automation scri
I'm trying to integrate the timeout function from here
http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/473878 into a
long running automation script and the following code causes IDLE after
20 or 30 iterations in countTest.
This is in 2.5, XP and there's no traceback.
Could someone point m
> I once made a small app that used threads on IDLE.
>
> There was a strange error when using 'print' & threads. When
> what I printed filled the entire screen, instead of moving
> all the text up, IDLE just hanged. Try running your code from
> the shell instead, to see if the problem is in IDL
dependencies? Is there any information
available about how exactly the startup works? What is being read/loaded
in which order etc?
3) General advice about deploying embedded Python. Pointers to web
sites, general experience (good or bad) etc. are all very welcome.
Thanks,
- Andreas
--
http://mail.python.org/mailman/listinfo/python-list
aded
>> in which order etc?
>
> Set PYTHONVERBOSE environment variable to have Python output a lot of
> information about what it is doing at startup.
Thanks I'll do that.
Cheers,
- Andreas
--
http://mail.python.org/mailman/listinfo/python-list
> Hi All.
>
> I have a list which is a line from a file:
> ['\x003\x008\x001\x004\x007\x005\x00.\x005\x000\x002\x005\x009
> \x009\x00',
> '\x002\x001\x003\x006\x002\x002\x00.\x001\x007\x004\x002\x008\
> x002\x00']
>
> This should be in the format:
> ['381475.502599', '213622.174282']
>
> I've tr
ll.
>
> That is beyond BS. The more recent gcc releases optimize as
> well as any
> commercial compiler. GCC 4 may even optimize better than MSVC.
Not to talk of standard compliance (msvc-c99 anyone?).
cheers,
aa
--
Andreas Ames | Programmer | Comergo GmbH |
Voice:
s to be willing to reliably
support a mingw-python
No. 2 could be a show-stopper.
There remains one technical issue that isn't a killer but would
be inconvenient, IMHO: Can pywin32 be made working with a
mingw-python (I'm quite sure it can't be made building on it)?
I&
ll. If it does, one shouldn't use it with _any_
compiler other than the one used to build pywin32. Even a mix of
different ms-compilers would be dangerous, IMHO.
cheers,
aa
--
Andreas Ames | Programmer | Comergo GmbH |
Voice: +49 69 7505 3213 | ames AT avaya . com
--
http://mail.python.org/mailman/listinfo/python-list
Hi all,
I'm trying to implement a Python equivalent of a C# method that encrypts
a string.
My Python attempt is in the attached file, but does not return the same
value as the C# method (see below).
Any hints?
Thanks,
Andreas
The C# method:
public static string Encrypt(string decr
on because you haven't acquired the GIL before calling
pyCallEventCallback. You can do so by using PyEval_SaveThread and friends.
You have to make sure to call PyEval_InitThreads somewhere, e.g. when embedding
from within the interpreter initialisation boilerplate, when extending for
inst
the original plaintext value.
As for padding, the C# method uses characters '\x01' to '\x07' for padding.
If there are 3 padding characters needed (eg with a password of 5
chars), then three '\x03' chars will be used.
Similarly, a 2-ch
>> I'm still using Python 2.4. In my code, I want to encrypt a password
>> and at another point decrypt it. What is the standard way of doing
>> encryption in python? Is it the Pycrypto module?
>
>Usually, one doesn't store clear-text passwords. Instead, use a
>hash-algorithm like md5 or crypt (
Hi all,
I have the following problem:
There are strings describing a UTC time, e.g. " 2008-01-15 22:32:30"
and a string reflecting the time
zone e.g. "-05:00".
What is an elegant way of getting the local time (considering DST -
daylight saving time) with that data?
The date is not important, just
>Sebastian Bassi wrote:
>> I know there is one site with wikimedia software installed, that is
>> made for comparing the syntax of several computer languages (Python
>> included). But don't remember the URL. Anyone knows this site?
>
>http://99-bottles-of-beer.net/
>
>is one such site, though I don
[snip]
>> What is the square root function in python?
>
> There's one in the math module. Use the one in gmpy if you have it.
Or raise to the power 1/power
>>> 9**(1.0/2)
3.0
Also works for cube root, quad root etc.
>>> 27**(1.0/3)
3.0
>>> 81**(1.0/4)
3.0
>>> 243**(1.0/5)
3.0
Cheers,
Drea
-
On Sun, 25 Jan 2009 09:23:35 -0800 (PST) Kottiyath
wrote:
> Hi,
> I am creating a class called people - subclasses men, women, children
> etc.
> I want to count the number of people at any time.
> So, I created code like the following:
>
> class a(object):
> counter = 0
> def __new__(cls
On Sun, 25 Jan 2009 23:51:41 +0100 "Diez B. Roggisch"
wrote:
> gert schrieb:
> > {'test': 'test'}
> > {"test": "test"}
> >
> > It can not be that hard to support both notation can it ?
>
> It's not hard, but it's not standard-conform.
>
OK, playing the devil's advocate here: Doesn't practicali
On Sun, 25 Jan 2009 19:04:44 -0500 Steve Holden
wrote:
> Andreas Waldenburger wrote:
> > On Sun, 25 Jan 2009 23:51:41 +0100 "Diez B. Roggisch"
> > wrote:
> >
> >> gert schrieb:
> >>> {'test': 'test'}
> >>>
On Sat, 24 Jan 2009 23:53:17 + MRAB
wrote:
> Terry Reedy wrote:
> > For a Python 'program', see http://xkcd.com/534/
> >
> It doesn't follow PEP 8!
So Randall can just forget about getting xkcd in the Standard Library.
Let this be an example to all of you!
/W
--
My real email address is
On Mon, 26 Jan 2009 02:37:37 + Mark Wooding
wrote:
> > This looks OK, although I'd suggest using "cls.counter += 1" instead
> > of "a.counter += 1" in the __new__() method. Just seems clearer to
> > me, esp. when you think about subclassing.
>
> I'm not sure about clarity, but that would be
On 26 Jan 2009 14:51:33 GMT Marc 'BlackJack' Rintsch
wrote:
> On Mon, 26 Jan 2009 12:22:18 +, Sion Arrowsmith wrote:
>
> > content = a.readlines()
> >
> > (Just because we can now write "for line in file" doesn't mean that
> > readlines() is *totally* redundant.)
>
> But ``content = list(a
On Mon, 26 Jan 2009 22:01:21 +0530 Anjanesh Lekshminarayanan
wrote:
> Is there a way to return an iterable object ?
>
> class twoTimes:
> def __init__(self, n):
> self.__n = n
>
> def getNext():
> self.__n *= 2
> return self.__n
>
>
Rename getNext() to next() a
On Tue, 27 Jan 2009 00:05:53 +0530 Anjanesh Lekshminarayanan
wrote:
> > You can also replace the whole class with a function thusly:
> >
> >def two_times(n):
> >for k in itertools.count(1):
> >yield n * (2**k)
> >
> > This function is then called a generator (because it ge
On 26 Jan 2009 22:12:43 GMT Marc 'BlackJack' Rintsch
wrote:
> On Mon, 26 Jan 2009 16:10:11 +0100, Andreas Waldenburger wrote:
>
> > On 26 Jan 2009 14:51:33 GMT Marc 'BlackJack' Rintsch
> > wrote:
> >
> >> On Mon, 26 Jan 2009 12:22:
> I had a task in a book to pick 5 items from a list of 26 ensuring the
items are not repeated
>
>
> import random
> list = ['a','b','c','d','e','f','g','h','i','j','k','l','m',
>'n','o','p','q','r','s','t','u','v','w','x','y','z']
> word = ' '
> a = random.choice(list)
> list.remove(a)
> b
On Sat, 31 Jan 2009 13:27:02 -0500 Pat wrote:
> Tobiah wrote:
> > Just out of curiosity, why was len() made to
> > be it's own function? I often find myself
> > typing things like my_list.len before I
> > catch myself.
> >
> > Thanks,
> >
> > Toby
>
> I'm surprised that no one responded to th
On Sat, 31 Jan 2009 09:11:03 +0100 Laszlo Nagy
wrote:
> Python is not a pure object oriented language, because it has other
> programming tools, for example functions.
I'm not sure about the first part of the sentence, but Python's
functions are objects. Check it in the interpreter: attributes,
>#open file and read last names
>filename = input('name file')
>file = open(filename, 'r')
>names_list = file.readlines()
>file.close()
>#open a file for saving passwords
>outfile_name = input('Save passwords')
>outfile = open(outfile_name, 'a')
>
>
>#create a password for each name in list
>import
I've found something in the spirit of the following (in the epydoc
sources, if you care):
if True:
print "outer if"
for t in range(2):
if True:
print "for if"
else:
print "phantom else"
For the life of me I can't place the "else". Which if clause does it
be
On Sat, 7 Feb 2009 15:21:22 +0100 Andreas Waldenburger
wrote:
> outer if
> For if
> For if
> Phantom else
>
Geez, I'm a moron. This is obviously not the output from the snippet.
But if you fix the capitalization, it is. Sorry for that.
/W
--
My real email address is con
On Sun, 08 Feb 2009 01:28:00 +1100 Steven D'Aprano
wrote:
> Andreas Waldenburger wrote:
>
> > It seems that there is a for...else construct. Replacing the inner
> > if with pass seems to confirm this. The else clause is still
> > executed.
>
> Yes, there i
On Sun, 08 Feb 2009 07:54:13 -0500 Pat wrote:
> Terry Reedy wrote:
> > Pat wrote:
> >> Andreas Waldenburger wrote:
> >>> On Sat, 31 Jan 2009 13:27:02 -0500 Pat wrote:
> >>>
> >>>> Tobiah wrote:
> >>>>> Just out of c
o even though they're using separate OS
threads, and
even though different Ruby threads might run on different cores, the
speed of
your program (at least the Ruby part) is limited to the speed of a
single
core.
-
Please don't mix threads and parallel processing on more then one CPU
co
Eric S. Johansson wrote:
> Andreas Roehler wrote:
>> with python-mode.el from
>>
>> http://sourceforge.net/projects/python-mode/
>
> I think there's something wrong with the site because it tells me it's version
> 1.0 from year 2005.
You are right, so
Hi all,
we all know about the zip builtin that combines several iterables into
a list of tuples.
I often find myself doing the reverse, splitting a list of tuples into
several lists, each corresponding to a certain element of each tuple
(e.g. matplotlib/pyplot needs those, rather than lists of po
On Tue, 02 Dec 2008 21:12:19 +0100 Stefan Behnel <[EMAIL PROTECTED]>
wrote:
> Andreas Waldenburger wrote:
> > [snip]
> > This is of course trivial to do via iteration or listcomps, BUT, I
> > was wondering if there is a function I don't know about that does
>
On Tue, 02 Dec 2008 18:16:13 -0800 Bryan Olson
<[EMAIL PROTECTED]> wrote:
> zip as its own inverse might be even easier to comprehend if we call
> zip by its more traditional name, "transpose".
>
Sounds like a Py4k change to me.
/W
--
My real email address is constructed by swapping the domain
On Wed, 3 Dec 2008 02:11:51 -0800 (PST) alex23 <[EMAIL PROTECTED]>
wrote:
> On Dec 3, 6:51 pm, Andreas Waldenburger <[EMAIL PROTECTED]> wrote:
> > On Tue, 02 Dec 2008 18:16:13 -0800 Bryan Olson
> > > zip as its own inverse might be even easier to comprehend if
On Wed, 3 Dec 2008 07:08:52 -0800 (PST) Janto Dreijer
<[EMAIL PROTECTED]> wrote:
> I'd like to point out that since your where thinking in terms of
> matplotlib, you might actually find numpy's own transpose useful,
> instead of using zip(*seq) :)
>
This was, of course, to be expected. :)
Whenev
On Wed, 03 Dec 2008 20:38:44 -0500 Lew <[EMAIL PROTECTED]> wrote:
> Xah Lee wrote:
> > enough babble ...
>
> Good point. Plonk. Guun dun!
>
I vaguely remember you plonking the guy before. Did you unplonk him in
the meantime? Or was that just a figure of speech?
teasingly yours,
/W
--
My r
On 04 Dec 2008 15:53:21 GMT Steven D'Aprano
<[EMAIL PROTECTED]> wrote:
> Hendrik, I think your PC's clock is wrong. You seem to be posting
> from the future.
So? Maybe he is. What's your problem?
/W
--
My real email address is constructed by swapping the domain with the
recipient (local part)
On Thu, 4 Dec 2008 06:40:02 +0200 "Hendrik van Rooyen"
<[EMAIL PROTECTED]> wrote:
> "Andreas Waldenburger" <[EMAIL PROTECTED]>
>
> > On 04 Dec 2008 15:53:21 GMT Steven D'Aprano
> > <[EMAIL PROTECTED]> wrote:
> >
> > >
On Thu, 4 Dec 2008 10:44:33 -0600 "Chris Mellon" <[EMAIL PROTECTED]>
wrote:
> Aside from the cultural indoctrination, though (and that may be a real
> and strong force when dealing with math software, and I don't want to
> discount it in general, just for purposes of this discussion) why is
> it m
On Thu, 4 Dec 2008 09:30:52 -0800 "Daniel Fetchinson"
<[EMAIL PROTECTED]> wrote:
> >> As you have probably guessed: nothing changed here.
> >> Also see:http://www.python.org/dev/peps/pep-0666/
> >
> > What? Do you mean it's possible to mix tabs and spaces still? Why?
>
> Why not?
>
+1
--
My r
On Thu, 4 Dec 2008 11:52:38 -0600 [EMAIL PROTECTED] wrote:
>
> >>> As you have probably guessed: nothing changed here.
> >>> Also see:http://www.python.org/dev/peps/pep-0666/
> >>
> >> What? Do you mean it's possible to mix tabs and spaces still?
> >> Why?
>
> Daniel> Wh
On 04 Dec 2008 22:29:41 GMT Steven D'Aprano
<[EMAIL PROTECTED]> wrote:
> Thank goodness we don't have to program in verbose, explicit English!
Then you'll HATE Inform 7:
http://en.wikipedia.org/wiki/Inform_7#Example_game_2
:)
/W
--
My real email address is constructed by swapping the domain wi
On Thu, 4 Dec 2008 15:49:46 -0600 [EMAIL PROTECTED] wrote:
>
> Andreas> Whenever has it been a pythonic ideal to "not allow"
> Andreas> stuff? You get warnings. Everything else is up to you.
>
> It's more than warnings. With properly crafted combi
On Thu, 4 Dec 2008 16:17:20 -0800 "Warren DeLano" <[EMAIL PROTECTED]>
wrote:
> Thank so much for the suggestions Ben. Sorry that I am personally
> unable to live up to your high standards, but it is nevertheless an
> honor to partipicate in such a helpful and mutually respectful
> community maili
On Fri, 5 Dec 2008 07:46:02 -0800 (PST) [EMAIL PROTECTED] wrote:
> Andreas Waldenburger:
> > My point is: If you mix tabs and spaces in a way that breaks code,
> > you'll find out pretty easily, because your program will not work.
>
> - Most newbies don't know tha
On Fri, 5 Dec 2008 12:16:47 -0800 (PST) "Fernando H. Sanches"
<[EMAIL PROTECTED]> wrote:
> On Dec 4, 5:45 pm, Andreas Waldenburger <[EMAIL PROTECTED]> wrote:
> > On Thu, 4 Dec 2008 11:52:38 -0600 [EMAIL PROTECTED] wrote:
> > [snip]
> > Whenever has it
On Sat, 06 Dec 2008 20:28:17 +1300 Lawrence D'Oliveiro
<[EMAIL PROTECTED]> wrote:
> Does that make any sense to you, or should I start drawing simple
> diagrams?
People, please! Is some civility too much to ask?
/W
--
My real email address is constructed by swapping the domain with the
recipie
On 6 Dec 2008 09:18:20 GMT Marc 'BlackJack' Rintsch <[EMAIL PROTECTED]>
wrote:
> On Sat, 06 Dec 2008 09:56:12 +0100, Antoine De Groote wrote:
>
> [snip reference to "preferably only one way to do it"]
>
> The reason why I'm against that change too. It adds a second,
> alternative way to expres
On Sat, 6 Dec 2008 04:02:54 -0800 (PST) [EMAIL PROTECTED] wrote:
> class C:
> def $method(arg):
> $value = arg
>
> (Note there's no point after $, it's not currently possible).
> Ruby uses @ and @@ for similar purposes.
> I agree that the code looks worse, but also shorter to read an
On Sat, 6 Dec 2008 13:32:58 +0100 Andreas Waldenburger
<[EMAIL PROTECTED]> wrote:
> On Sat, 6 Dec 2008 04:02:54 -0800 (PST) [EMAIL PROTECTED]
> suggested:
>
>
> > class C:
> > def $method(arg):
> > $value = arg
> >
> > [snip]
On Sat, 6 Dec 2008 14:39:34 -0800 (PST) "Russ P."
<[EMAIL PROTECTED]> wrote:
> I don't know much about Perl, but my understanding is that a dollar
> sign must be used every time a variable is dereferenced, as in bash or
> other shell languages. What we are proposing here is something
> entirely di
On Sun, 07 Dec 2008 02:49:27 -0500 acerimusdux
<[EMAIL PROTECTED]> wrote:
> I'm not sure though whether allowing both syntaxes would make things
> more or less confusing. It might actually be helpful in some respects
> for newcomers to realize that self.method(arg) is somewhat the same
> as meth
On Sat, 6 Dec 2008 23:21:04 -0800 (PST) Lie <[EMAIL PROTECTED]> wrote:
> I think we have to test this on newbies. [snip]
>
Now that's talking like a programmer!
Ideas on how such a survey could be conducted? Anyone?
> If this dead horse is revived because of that reason, then I'd go with
> cha
On Sun, 07 Dec 2008 19:13:18 +0100 Bruno Desthuilliers
<[EMAIL PROTECTED]> wrote:
> > and friendlier to newbies.
>
> I'd rather say "more acceptable to java-brainwashed developpers".
Why would you rather be unfriendly and seed ambivalence? I do see the
fun in a little Python snobbism, but ... c
This is a little puzzling.
Using ipython:
[EMAIL PROTECTED] Logstuff]$ ipython
Python 2.5.2 (r252:60911, Sep 30 2008, 15:41:38)
Type "copyright", "credits" or "license" for more information.
[snip ipython help message]
In [1]: import re
This works fine. But with the
On Sun, 7 Dec 2008 11:22:23 -0800 (PST) walterbyrd
<[EMAIL PROTECTED]> wrote:
> IMO: breaking backward compatibility is a big deal, and should only be
> done when it is seriously needed.
>
Plze. Python 3 is shipping now, and so is 2.x, where x > 5. Python
2 is going to be around for quite som
On Sun, 7 Dec 2008 20:35:53 +0100 Andreas Waldenburger
<[EMAIL PROTECTED]> wrote:
> On Sun, 7 Dec 2008 11:22:23 -0800 (PST) walterbyrd
> <[EMAIL PROTECTED]> wrote:
>
> > At best, I am a casual python user, so it's likely that I am missing
> > something.
>
On Sun, 07 Dec 2008 20:36:58 +0100 "Diez B. Roggisch"
<[EMAIL PROTECTED]> wrote:
> Andreas Waldenburger schrieb:
> > This is a little puzzling.
> >
> >
> > Using ipython:
> >
> > [EMAIL PROTECTED] Logstuff]$ ipython
> > P
Just found this in the re module's docs:
m = re.match(r"(?P\w+) (?P\w+)", "Malcom
Reynolds")
Does this represent an attempt to phase out the gratuitous Monty Python
references in favor of gratuitous Firefly references? Because if so,
I'm all for it.
Anyways, stuff like that really makes
On Sun, 7 Dec 2008 12:13:37 -0800 (PST) "Russ P."
<[EMAIL PROTECTED]> wrote:
> I have a 12-year-old son who spends too much time playing Xbox live
> and watching silly YouTube videos. I would like to try to get him
> interested in programming. Is anyone aware of a good book or website
> that addre
On Sun, 07 Dec 2008 20:56:40 GMT I V <[EMAIL PROTECTED]> wrote:
> So, if we want Python to the programming language of choice for
> Lacanian psychoanalysts, perhaps we should adopt the symbol "$" (or
> even, with Python 3's support for unicode identifiers, S followed by
> U+0388) instead of "self."
Xah Lee wrote:
> in programing elisp in emacs, i can press “Ctrl+h f” to lookup the doc
> for the function under cursor.
>
> is there such facility when coding in perl, python, php?
>
> (i'm interested in particular python. In perl, i can work around with
> “perldoc -f functionName”, and in php
On Thu, 11 Dec 2008 05:40:45 + Paul Rudin <[EMAIL PROTECTED]>
wrote:
> "Dotan Cohen" <[EMAIL PROTECTED]> writes:
>
> > 2008/12/10 <[EMAIL PROTECTED]>:
> >> Ruby:
> >>
> >> def norm a
> >> s = Math.sqrt(a.map{|x|x*x}.inject{|x,y|x+y})
> >> a.map{|x| x/s}
> >> end
> >
> > If someone doesn't
On Thu, 11 Dec 2008 10:21:55 -0800 (PST) walterbyrd
wrote:
> On Dec 7, 12:35 pm, Andreas Waldenburger wrote:
>
> > Plze. Python 3 is shipping now, and so is 2.x, where x > 5.
> > Python 2 is going to be around for quite some time. What is
> > everybody's pro
ey'll do. There have flown quite a bit of Python version since
the time that it was announced that
Parrot will have a Python frontend.
Andreas
--
http://mail.python.org/mailman/listinfo/python-list
bucket2.sort(data)
>
> How to write a test script which will outputs execution time for
> bucket2.sort(data) ?
Well:
import time
starttime = time.time()
endtime = time.time()
print "Whatever does, it took %5.3fs to do." % (endtime - starttime)
Alternativly take a
ssible in competitive speeds. But you sometime need a developer
that can wield the tool with a certain experience, and not a stupid
rookie that whines that his tool does not make his O(n**n) algorithm
automatically blazing fast.
Andreas
>
> > By the way... I know of a very slow Python
On 02 Jan 2009 12:45:36 GMT Steven D'Aprano
wrote:
> You've just earned a plonking for the next month. Do try to have at
> least half a clue by February.
I will state again that there seems to have been a slight change of
tone in clp lately.
How about we Python guys work a bit harder on not cal
On Fri, 02 Jan 2009 19:55:43 +0100 Markus Brueckner
wrote:
> g = ( ((e[0],None,e[1]) if len(e)==2 else (e[0],e[1],e[2])) for e in
> L)
If this isn't proof of Python's versatility, I don't know what is. In
one line it can mimic both Lisp and Perl. Sweet.
:)
/W
--
My real email address is const
On Fri, 2 Jan 2009 14:36:04 -0800 (PST) vk wrote:
> There needs to be a "user_io" or "sanitize" module in the standard
> library to take care of this stuff.
> [snip example]
>
Great idea! +1
> ... but there isn't, as far as I know.
Well, get to it, then. ;)
/W
--
My real email address is co
On Fri, 2 Jan 2009 16:16:10 -0800 (PST) vk wrote:
> > If there were, I would expect it to conform with PEP 8 (get those
> > ugly camelCase names outta there :-)
>
> haha, please forgive me.
> I'll try and think of some more creative names.
FYI: The names themselves aren't he problem at all. T
On Fri, 2 Jan 2009 16:44:11 -0800 (PST) r wrote:
> On Jan 2, 6:26 pm, Andreas Waldenburger wrote:
> > On Fri, 2 Jan 2009 16:16:10 -0800 (PST) vk wrote:
> >
> > > > If there were, I would expect it to conform with PEP 8 (get
> > > > those ugly camelCase
> Does anyone know how to properly kick off a script using Windows
> Scheduled Task? The script calls other python modules within itself.
> HERE'S THE CATCH:
> I am used to running the script directly from the command window and
> the print() is very handy for us to debug and monitor. When running
Hi!
(Python 2.2.3 if this is relevant :-)
I have a list of objects with, lets say, the attributes "ID", "x" and
"y". Now I want to find the index of list element with ID=10.
Of course I can loop through the list manually, but is there a
construct like
list.find (10, key='ID')
? Thanks for your
ions, why it shouldn't it be a long term
win?
Anyway you should tell, which python-mode and which Emacs you use if any.
Andreas Röhler
--
http://mail.python.org/mailman/listinfo/python-list
Eric S. Johansson wrote:
> Andreas Roehler wrote:
>
>> IMO Jeremiah Dodds is right. With all the time spent on this discussion, you
>> could write the needed function in elisp probably. BTW your request seems
>> reasonable. Other python programmers may use it too.
>
&g
>Can someone suggest a easy method to do the inverse of dict(zip(x,y))
>to get two lists x and y?
>
>So, if x and y are two lists, it is easier to make a dictionary using
>d = dict(zip(x,y)), but if I have d of the form, d = {x1:y1,
>x2:y2, ...}, what is there any trick to get lists x = [x1, x2, ..
>>>So, if x and y are two lists, it is easier to make a dictionary using
>>>d = dict(zip(x,y)), but if I have d of the form, d = {x1:y1,
>>>x2:y2, ...}, what is there any trick to get lists x = [x1, x2, ...]
>>>and y = [y1, y2, ...]
>>>
>>>Cheers,
>>>Chaitanya.
>>
>> x = d.keys()
>> y = d.values()
> > 2009/3/17 :
> >> Could anyone suggest whether there is any Python to Perl code convertors?
> >> I found one on the net viz. Perthon. But it wasn't really helping out.
> >
> I am just a beginner learning both the languages. Wondered if I can have some
> comparative understanding of both.
On 11 Apr., 22:14, ergconce...@googlemail.com wrote:
> Hi,
> I have a list looking like
>
> [ 0.84971586, 0.05786009, 0.9645675, 0.84971586, 0.05786009,
> 0.9645675, 0.84971586, 0.05786009, 0.9645675, 0.84971586,
> 0.05786009, 0.9645675]
>
> and I would like to break this list into subsets
On 12 Apr., 02:31, "Mark Tolonen" wrote:
> "Andreas" wrote in message
>
> news:f953c845-3660-4bb5-8ba7-00b93989c...@b1g2000vbc.googlegroups.com...
>
> > Hello,
>
> > I'd like to create a regex that captures any unicode character, but
> >
On 12 Apr., 02:31, "Mark Tolonen" wrote:
> "Andreas" wrote in message
>
> news:f953c845-3660-4bb5-8ba7-00b93989c...@b1g2000vbc.googlegroups.com...
>
> > Hello,
>
> > I'd like to create a regex that captures any unicode character, but
> >
quot;O!" for a type object HOWTO put the type into the function
from
above
mfg
Andreas Otto
--
http://mail.python.org/mailman/listinfo/python-list
Hi,
I want to make a language binding for an existing C library
http://libmsgque.sourceforge.net
is this possible ?
--
http://mail.python.org/mailman/listinfo/python-list
Yes, you are right ...
I read more and found the doc about this ...
the problem I have is something more tricky ...
I allready have an extension written for java
and the easyest thing would be use this as template
and replace the java specific calls with python calls ...
but the pyt
301 - 400 of 692 matches
Mail list logo