RE: Last iteration?

2007-10-12 Thread Andreas Tawn
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

Re: Strange behaviour with reversed()

2007-10-17 Thread Andreas Kraemer
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

Re: Strange behaviour with reversed()

2007-10-18 Thread Andreas Kraemer
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

Re: Strange behaviour with reversed()

2007-10-19 Thread Andreas Kraemer
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 >

Re: Need scrip to reed rss feeds

2007-10-18 Thread Andreas Kraemer
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

RE: dynamic library loading, missing symbols

2007-01-10 Thread Ames Andreas
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

RE: dynamic library loading, missing symbols

2007-01-11 Thread Ames Andreas
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

Array delete

2007-02-07 Thread Andreas Lysdal
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 -- _.____ __

Re: count pages in a pdf

2007-11-27 Thread Andreas Lobinger
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

RE: Timeout test hangs IDLE

2007-12-05 Thread Andreas Tawn
> 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 &

RE: Timeout test hangs IDLE

2007-12-05 Thread Andreas Tawn
> > 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

Timeout test hangs IDLE

2007-12-05 Thread Andreas Tawn
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

RE: Timeout test hangs IDLE

2007-12-06 Thread Andreas Tawn
> 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

Deploying embedded Python

2007-12-17 Thread Andreas Raab
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

Re: Deploying embedded Python

2007-12-17 Thread Andreas Raab
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

RE: Hexadecimal list conversion

2007-12-20 Thread Andreas Tawn
> 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

RE: MinGW and Python

2006-04-25 Thread Ames Andreas
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:

RE: MinGW and Python

2006-04-28 Thread Ames Andreas
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&

RE: MinGW and Python

2006-04-28 Thread Ames Andreas
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

Python Translation of C# DES Encryption

2006-05-12 Thread Andreas Pauley
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

RE: multi-threaded c++ callback problem

2006-05-12 Thread Ames Andreas
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

Re: Python Translation of C# DES Encryption

2006-05-15 Thread Andreas Pauley
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

RE: Encryption Recommendation

2008-01-28 Thread Andreas Tawn
>> 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 (

Time conversion between UTC and local time

2008-02-08 Thread andreas . profous
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

RE: Web site for comparing languages syntax

2008-02-26 Thread Andreas Tawn
>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

RE: First Program Bug (Newbie)

2008-03-19 Thread Andreas Tawn
[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 -

Re: Counting number of objects

2009-01-25 Thread Andreas Waldenburger
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

Re: v = json.loads("{'test':'test'}")

2009-01-25 Thread Andreas Waldenburger
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

Re: v = json.loads("{'test':'test'}")

2009-01-25 Thread Andreas Waldenburger
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'} > >>>

Re: I'm a python addict !

2009-01-25 Thread Andreas Waldenburger
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

Re: Counting number of objects

2009-01-26 Thread Andreas Waldenburger
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

Re: Newby: how to transform text into lines of text

2009-01-26 Thread Andreas Waldenburger
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

Re: Method returning an Iterable Object

2009-01-26 Thread Andreas Waldenburger
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

Re: Method returning an Iterable Object

2009-01-26 Thread Andreas Waldenburger
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

Re: Newby: how to transform text into lines of text

2009-01-26 Thread Andreas Waldenburger
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:

RE: is there a shorter way to write this

2009-01-29 Thread Andreas Tawn
> 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

Re: len()

2009-01-31 Thread Andreas Waldenburger
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

Re: is python Object oriented??

2009-01-31 Thread Andreas Waldenburger
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,

RE: python 3 error i know the file works in python 2.6

2009-02-05 Thread Andreas Tawn
>#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

"Weird" Indentation? (Or: is there a for...else construct?)

2009-02-07 Thread Andreas Waldenburger
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

Re: "Weird" Indentation? (Or: is there a for...else construct?)

2009-02-07 Thread Andreas Waldenburger
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

Re: "Weird" Indentation? (Or: is there a for...else construct?)

2009-02-07 Thread Andreas Waldenburger
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

Re: len()

2009-02-08 Thread Andreas Waldenburger
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

Re: Will multithreading make python less popular?

2009-02-16 Thread Andreas Kaiser
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

Re: special editor support for indentation needed.

2008-11-27 Thread Andreas Roehler
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

Reverse zip() ?

2008-12-02 Thread Andreas Waldenburger
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

Re: Reverse zip() ?

2008-12-02 Thread Andreas Waldenburger
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 >

Re: Reverse zip() ?

2008-12-03 Thread Andreas Waldenburger
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

Re: Reverse zip() ?

2008-12-03 Thread Andreas Waldenburger
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

Re: Reverse zip() ?

2008-12-03 Thread Andreas Waldenburger
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

Re: Mathematica 7 compares to other languages

2008-12-04 Thread Andreas Waldenburger
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

Re: Please fix your clock [was Re: Multiple equates]

2008-12-04 Thread Andreas Waldenburger
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)

Re: Please fix your clock [was Re: Multiple equates]

2008-12-04 Thread Andreas Waldenburger
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: > > > > >

Re: "as" keyword woes

2008-12-04 Thread Andreas Waldenburger
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

Re: RELEASED Python 3.0 final

2008-12-04 Thread Andreas Waldenburger
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

Re: RELEASED Python 3.0 final

2008-12-04 Thread Andreas Waldenburger
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

Re: "as" keyword woes

2008-12-05 Thread Andreas Waldenburger
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

Re: RELEASED Python 3.0 final

2008-12-05 Thread Andreas Waldenburger
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

Re: To Troll or Not To Troll (aka: "as" keyword woes)

2008-12-05 Thread Andreas Waldenburger
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

Whitespace in Python (3) [was: RELEASED Python 3.0 final]

2008-12-05 Thread Andreas Waldenburger
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

Re: RELEASED Python 3.0 final

2008-12-05 Thread Andreas Waldenburger
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

Re: Don't you just love writing this sort of thing :)

2008-12-06 Thread Andreas Waldenburger
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

Re: Guido's new method definition idea

2008-12-06 Thread Andreas Waldenburger
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

Re: Guido's new method definition idea

2008-12-06 Thread Andreas Waldenburger
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

Re: Guido's new method definition idea

2008-12-06 Thread Andreas Waldenburger
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]

Re: Guido's new method definition idea

2008-12-06 Thread Andreas Waldenburger
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

Re: Guido's new method definition idea

2008-12-07 Thread Andreas Waldenburger
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

Re: Guido's new method definition idea

2008-12-07 Thread Andreas Waldenburger
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

Re: Guido's new method definition idea

2008-12-07 Thread Andreas Waldenburger
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

Importing the re module fails

2008-12-07 Thread Andreas Waldenburger
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

Re: Is 3.0 worth breaking backward compatibility?

2008-12-07 Thread Andreas Waldenburger
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

Re: Is 3.0 worth breaking backward compatibility?

2008-12-07 Thread Andreas Waldenburger
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. >

Re: Importing the re module fails

2008-12-07 Thread Andreas Waldenburger
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

[OT] [sort of] Malcom Reynolds?

2008-12-07 Thread Andreas Waldenburger
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

Re: Python for kids?

2008-12-07 Thread Andreas Waldenburger
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

Re: Guido's new method definition idea

2008-12-07 Thread Andreas Waldenburger
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."

Re: looking up function's doc in emacs

2008-12-11 Thread Andreas Röhler
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

Re: Mathematica 7 compares to other languages

2008-12-11 Thread Andreas Waldenburger
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

Re: Is 3.0 worth breaking backward compatibility?

2008-12-11 Thread Andreas Waldenburger
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

Re: Python is slow

2008-12-12 Thread Andreas Kostyrka
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

Re: execution time

2008-12-14 Thread Andreas Kostyrka
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

Re: Python is slow

2008-12-14 Thread Andreas Kostyrka
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

Re: Why not Ruby?

2009-01-02 Thread Andreas Waldenburger
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

Re: Is there a better algorithm?

2009-01-02 Thread Andreas Waldenburger
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

Re: Noob question: Is all this typecasting normal?

2009-01-02 Thread Andreas Waldenburger
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

Re: Noob question: Is all this typecasting normal?

2009-01-02 Thread Andreas Waldenburger
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

Re: Noob question: Is all this typecasting normal?

2009-01-02 Thread Andreas Waldenburger
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

RE: Kicking off a python script using Windows Scheduled Task

2008-10-15 Thread Andreas Tawn
> 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

"Find" in list of objects

2008-10-23 Thread Andreas Müller
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

Re: special editor support for indentation needed.

2008-11-17 Thread Andreas Roehler
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

Re: special editor support for indentation needed.

2008-11-21 Thread Andreas Roehler
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

RE: Inverse of dict(zip(x,y))

2009-03-04 Thread Andreas Tawn
>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, ..

RE: Inverse of dict(zip(x,y))

2009-03-04 Thread Andreas Tawn
>>>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()

RE: Python to Perl transalators

2009-03-18 Thread Andreas Tawn
> > 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.

Re: absolute newbie: divide a list into sublists (nested lists?) of fixed length

2009-04-11 Thread Andreas Pfrengle
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

Re: Regex similar to "^(?u)\w$", but without digits?

2009-04-12 Thread Andreas Pfrengle
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 > >

Re: Regex similar to "^(?u)\w$", but without digits?

2009-04-12 Thread Andreas Pfrengle
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 > >

Question to python C API

2009-04-15 Thread Andreas Otto
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

Re: Question to python C API

2009-04-15 Thread Andreas Otto
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

Re: Question to python C API

2009-04-16 Thread Andreas Otto
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

<    1   2   3   4   5   6   7   >