Linear2D

2008-12-02 Thread Lawrence D'Oliveiro
I've decided to give Github a go, with a simple project containing some routines for performing 2D linear transformations . This takes a functional rather than procedural approach. For example, a function to construct a matrix that maps a source rectangle to a

Obtaining SMTP address of a sender and receiver of an outlook mail

2008-12-02 Thread [EMAIL PROTECTED]
Hi all, I am trying to use python for extracting contents of an outlook email. For extracting the list of Recipients addresses I tried using the "MAPI.message.Recipients.Address" property, but the problem I am facing is that it is giving the complete DN name which is putting me in further co

Re: porting modules to Python 3.0

2008-12-02 Thread Terry Reedy
Martin v. Löwis wrote: Is there something like that already in place? What are the recommendations for library authors willing to support both Python 2.X and 3.X in parallel? My recommendation is to use 3.0's build_py_2to3 implementation of the build_py command. See Demo/distutils/test2to3. Yo

Re: porting modules to Python 3.0

2008-12-02 Thread Martin v. Löwis
> Is there something like that already in place? What are the > recommendations for library > authors willing to support both Python 2.X and 3.X in parallel? My recommendation is to use 3.0's build_py_2to3 implementation of the build_py command. See Demo/distutils/test2to3. You will have a single

Re: HELP!...Google SketchUp needs a Python API

2008-12-02 Thread Benjamin Kaplan
On Tue, Dec 2, 2008 at 10:06 PM, r <[EMAIL PROTECTED]> wrote: > "If we can laugh what else would we do" > > I'd like to touch also on some comments by ajaksu: > [ajaksu] > I'd like to try hacking some form of Python to work in SketchUp (on > top of Ruby, that is). Now, why won't I try to? I'm a Li

Re: noob needs help

2008-12-02 Thread Sambo
Peter Pearson wrote: > When you type "python helloworld.py", python looks for helloworld.py > in the current "working" directory, which is probably your personal > default directory ("~"). For better results, either save helloworld.py > to this directory, or copy it to this directory > ("cp Doc

Re: Reverse zip() ?

2008-12-02 Thread Stefan Behnel
Zac Burns wrote: > More succinct failure: > > keys, values = zip(*{}.iteritems()) Simple fix: some_iterable = {}.iteritems() keys, values = zip(*list(some_iterable)) or: keys, values = zip(*(some_iterable if isinstance(some_iterable, (list, tuple))

Re: Obama's Birth Certificate - Demand that US presidential electors investigate Obama's eligibility

2008-12-02 Thread Bryan Olson
[EMAIL PROTECTED] wrote: This message is not about the meaningless computer printout called More importantly, it's not about Python. I'm setting follow-ups to talk.politics. "Certification of Live Birth" that Obama propaganda machine calls his "Birth Certificate". The American people are st

Re: Debugging a Python Program that Hangs

2008-12-02 Thread alex23
On Dec 3, 2:19 am, Kevin D. Smith <[EMAIL PROTECTED]> wrote: > I have a fairly large python program that, when a certain combination > of options is used, hangs.  I have no idea where it is hanging, so > simply putting in print statements to locate the spot would be quite > difficult.  Unfortunatel

Re: Query netgroup information through python

2008-12-02 Thread Joel Heenan
Well it doesn't appear that this exists in the standard library or in any other library, so I ended up writing my own C interface to the underlying functions. If you are trying to do the same thing, then you can find the module here: http://www.planetjoel.com/viewarticle/629/Python+NSS+netgroups+

Re: best way to do this

2008-12-02 Thread alex23
On Dec 3, 1:38 pm, thor <[EMAIL PROTECTED]> wrote: > >>> c = [(5, 3), (6, 8)] > >>> [x for t in zip(*c) for x in t] > [5, 6, 3, 8] The zip here is superfluous. >>> c = [(5, 3), (6, 8)] >>> zip(*c) [(5, 6), (3, 8)] Unless you're -only- using it to ensure your result is the same order as the OP...

porting modules to Python 3.0

2008-12-02 Thread Michele Simionato
Python 3.0 is going to be released Real Soon now and I realized that there big holes in my understanding of how libraries working both with Python 2.X and Python 3.X should be written. Let me consider pure Python libraries for the moment. I see various possibilities: 1. I just release two differen

Debugging a Python Program that Hangs

2008-12-02 Thread Kevin D . Smith
I have a fairly large python program that, when a certain combination of options is used, hangs. I have no idea where it is hanging, so simply putting in print statements to locate the spot would be quite difficult. Unfortunately, ctrl-C'ing the program doesn't print a traceback either. Look

Re: [ANN] Pyjamas 0.4: Python Web Toolkit Release

2008-12-02 Thread Banibrata Dutta
Amazing concept, and glad that someone thought of this and implemented this. The book's formatting on IE and Chrome looked a bit unusual. Content wise it is already firly decent (i.e. enough to get a programmer started), but sometimes text appears in a long & narrow col. format instead of the more

Re: Best way to run multiple Python processes without overloading CPU or disk i/o

2008-12-02 Thread Philip Semanchuk
On Dec 2, 2008, at 11:21 PM, [EMAIL PROTECTED] wrote: Is there a cross-platform way to launch multiple Python processes and monitor CPU usage os.getloadavg() might be useful. It certainly works on *nix, don't know about Windows. The documentation doesn't mention any platform limitations.

Re: Determining number of dict key collisions in a dictionary

2008-12-02 Thread python
Roger, Apologies for responding directly to your email vs. the list (just realized this now). Thank you very much for your detailed answers and the reminder about premature optimization. You have answered all my questions. Regards, Malcolm - Original message - From: "Roger Binns" <[E

Best way to run multiple Python processes without overloading CPU or disk i/o

2008-12-02 Thread python
Is there a cross-platform way to launch multiple Python processes and monitor CPU usage and disk i/o so that the maximum number of independent processes can be running at all times without overloading their environment? By process I mean independent application sessions vs. multiple threads of a si

Re: Do more imported objects affect performance

2008-12-02 Thread Steve Holden
Filip Gruszczyński wrote: [something I moved to after Nick's reply, where it belongs] > 2008/12/1 Nick Craig-Wood <[EMAIL PROTECTED]>: >> Rafe <[EMAIL PROTECTED]> wrote: >>> On Dec 1, 7:26?am, "Filip Gruszczy?ski" <[EMAIL PROTECTED]> wrote: I have following question: if I use from m

Re: Simple ini Config parser examples needed

2008-12-02 Thread Glenn Linderman
On approximately 12/2/2008 3:22 PM, came the following characters from the keyboard of Chris Rebert: On Tue, Dec 2, 2008 at 2:51 PM, Glenn Linderman <[EMAIL PROTECTED]> wrote: On approximately 12/2/2008 1:31 PM, came the following characters from the keyboard of Chris Rebert: On Tue, De

Re: best way to do this

2008-12-02 Thread thor
On Dec 2, 10:09 pm, TP <[EMAIL PROTECTED]> wrote: > Hi everybody, > > >>> c=[(5,3), (6,8)] > > From c, I want to obtain a list with 5,3,6, and 8, in any order. > I do this: > > >>> [i for (i,j) in c] + [ j for (i,j) in c] > > [5, 6, 3, 8] > > Is there a quicker way to do this? > >>> c = [(5, 3), (

Re: Mathematica 7 compares to other languages

2008-12-02 Thread Lew
George Sakkis wrote: As a Slashdotter would put it... you must be new here ;-) For certain values of "here". I've seen Xah before, and I'm happy to engage if he behaves himself. Some of his initial ideas I actually find engaging. His followups leave a lot to be desired. f/u set to comp.la

Re: HELP!...Google SketchUp needs a Python API

2008-12-02 Thread r
"If we can laugh what else would we do" I'd like to touch also on some comments by ajaksu: [ajaksu] I'd like to try hacking some form of Python to work in SketchUp (on top of Ruby, that is). Now, why won't I try to? I'm a Linux user and we don't get a SU version. So much for FREEDOM. BTW, some thi

Re: Overriding a method at the instance level on a subclass of a builtin type

2008-12-02 Thread Bryan Olson
Zac Burns wrote: Sorry for the long subject. I'm trying to create a subclass dictionary that runs extra init code on the first __getitem__ call. However, the performance of __getitem__ is quite important - so I'm trying in the subclassed __getitem__ method to first run some code and then patch i

Re: Mathematica 7 compares to other languages

2008-12-02 Thread Xah Lee
On Dec 2, 5:13 pm, Jon Harrop <[EMAIL PROTECTED]> wrote: > XahLeewrote: > > On Dec 1, 4:06 pm, Jon Harrop <[EMAIL PROTECTED]> wrote: > >> Mathematica is a whopping 700,000 times slower! > > > LOL Jon. r u trying to get me to do otimization for you free? > > > how about pay me $5 thru paypal? I'm pr

Re: Mathematica 7 compares to other languages

2008-12-02 Thread George Sakkis
On Dec 2, 4:57 pm, Lew <[EMAIL PROTECTED]> wrote: > There is no reason for you to engage in an /ad hominem/ attack.  It > does not speak well of you to resort to deflection when someone > expresses a contrary opinion, as you did with both Jon Harrop and with > me.  I suggest that your ideas will b

Re: Reverse zip() ?

2008-12-02 Thread Bryan Olson
John Machin wrote: Here's a version that makes it slightly easier to comprehend: Q: I know how to zip sequences together: | >>> a = (1, 2, 3) | >>> b = (4, 5, 6) | >>> z = zip(a, b) | >>> z | [(1, 4), (2, 5), (3, 6)] but how do I reverse the process? A: Use zip()! | >>> a2, b2 = zip(*z) | >>> a

Re: Overriding a method at the instance level on a subclass of a builtin type

2008-12-02 Thread Aaron Brady
On Dec 2, 6:58 pm, "Zac Burns" <[EMAIL PROTECTED]> wrote: > Sorry for the long subject. > > I'm trying to create a subclass dictionary that runs extra init code > on the first __getitem__ call. However, the performance of __getitem__ > is quite important - so I'm trying in the subclassed __getitem_

Re: Overriding a method at the instance level on a subclass of a builtin type

2008-12-02 Thread George Sakkis
On Dec 2, 7:58 pm, "Zac Burns" <[EMAIL PROTECTED]> wrote: > Sorry for the long subject. > > I'm trying to create a subclass dictionary that runs extra init code > on the first __getitem__ call. However, the performance of __getitem__ > is quite important - so I'm trying in the subclassed __getitem

Re: Multiple equates

2008-12-02 Thread Cameron Laird
In article <[EMAIL PROTECTED]>, Lawrence D'Oliveiro <[EMAIL PROTECTED]> wrote: >In message <[EMAIL PROTECTED]>, Cameron Laird wrote: > >> In article <[EMAIL PROTECTED]>, >> Lawrence D'Oliveiro <[EMAIL PROTECTED]> wrote: >> >>>Cameron Laird wrote: >>> I've been trying to decide if there's any

Re: HELP!...Google SketchUp needs a Python API

2008-12-02 Thread Aaron Brady
On Dec 2, 6:24 pm, r <[EMAIL PROTECTED]> wrote: > I added you name to my "for" list. thanks +1 entertaining thread. -- http://mail.python.org/mailman/listinfo/python-list

Re: Reverse zip() ?

2008-12-02 Thread Bryan Olson
Zac Burns wrote: There is a problem with this however, which prompted me to actually write an unzip function. One might expect to be able to do something like so (pseudocode)... def filesAndAttributes(): files = walk() attributes = [attr(f) for f in files] return zip(files, attributes)

Re: problem with optparse

2008-12-02 Thread John Machin
On Dec 3, 11:47 am, Neal Becker <[EMAIL PROTECTED]> wrote: > Robert Kern wrote: > > Neal Becker wrote: > >> This example is right out of python library reference. What's wrong > >> here? > > >> import optparse > > >> def store_value(option, opt_str, value, parser): > >> setattr(parser.values,

Re: Reverse zip() ?

2008-12-02 Thread Zac Burns
More succinct failure: keys, values = zip(*{}.iteritems()) -- Zachary Burns (407)590-4814 Aim - Zac256FL Production Engineer (Digital Overlord) Zindagi Games On Tue, Dec 2, 2008 at 4:47 PM, Zac Burns <[EMAIL PROTECTED]> wrote: > There is a problem with this however, which prompted me to actual

Re: Pyhon (with wxPython) on Windows' cygwin: can it be done fully ?

2008-12-02 Thread Jeremiah Dodds
On Mon, Dec 1, 2008 at 12:25 PM, Fernando H. Sanches < [EMAIL PROTECTED]> wrote: > At first I also disliked print's new syntax, but later I realised it > could be useful. > > However, I agree that the parentheses are annoying. Not because of the > parens theirselves, but because of the Shift key.

Re: Mathematica 7 compares to other languages

2008-12-02 Thread Jon Harrop
Xah Lee wrote: > On Dec 1, 4:06 pm, Jon Harrop <[EMAIL PROTECTED]> wrote: >> Mathematica is a whopping 700,000 times slower! > > LOL Jon. r u trying to get me to do otimization for you free? > > how about pay me $5 thru paypal? I'm pretty sure i can speed it up. > Say, maybe 10%, and even 50% is

Re: problem with optparse

2008-12-02 Thread Robert Kern
Neal Becker wrote: Robert Kern wrote: Neal Becker wrote: This example is right out of python library reference. What's wrong here? import optparse def store_value(option, opt_str, value, parser): setattr(parser.values, option.dest, value) parser = optparse.OptionParser() parser.add_opt

Re: problem with optparse

2008-12-02 Thread John Machin
On Dec 3, 11:28 am, Robert Kern <[EMAIL PROTECTED]> wrote: > Neal Becker wrote: > > This example is right out of python library reference.  What's wrong here? > > > import optparse > > > def store_value(option, opt_str, value, parser): > >     setattr(parser.values, option.dest, value) > > > parser

Overriding a method at the instance level on a subclass of a builtin type

2008-12-02 Thread Zac Burns
Sorry for the long subject. I'm trying to create a subclass dictionary that runs extra init code on the first __getitem__ call. However, the performance of __getitem__ is quite important - so I'm trying in the subclassed __getitem__ method to first run some code and then patch in the original dict

Re: problem with optparse

2008-12-02 Thread Neal Becker
Robert Kern wrote: > Neal Becker wrote: >> This example is right out of python library reference. What's wrong >> here? >> >> import optparse >> >> def store_value(option, opt_str, value, parser): >> setattr(parser.values, option.dest, value) >> >> parser = optparse.OptionParser() >> parse

Re: Reverse zip() ?

2008-12-02 Thread Zac Burns
There is a problem with this however, which prompted me to actually write an unzip function. One might expect to be able to do something like so (pseudocode)... def filesAndAttributes(): files = walk() attributes = [attr(f) for f in files] return zip(files, attributes) files, attributes

Re: unicode and hashlib

2008-12-02 Thread Bryan Olson
Scott David Daniels wrote: Bryan Olson wrote: ... I think that's good behavior, except that the error message is likely to end beginners to look up the obscure buffer interface before they find they just need mystring.decode('utf8') or bytes(mystring, 'utf8'). Oops, careful here (I made this

Re: problem with optparse

2008-12-02 Thread Robert Kern
Neal Becker wrote: This example is right out of python library reference. What's wrong here? import optparse def store_value(option, opt_str, value, parser): setattr(parser.values, option.dest, value) parser = optparse.OptionParser() parser.add_option("--foo", action="ca

Re: HELP!...Google SketchUp needs a Python API

2008-12-02 Thread r
I added you name to my "for" list. thanks -- http://mail.python.org/mailman/listinfo/python-list

problem with optparse

2008-12-02 Thread Neal Becker
This example is right out of python library reference. What's wrong here? import optparse def store_value(option, opt_str, value, parser): setattr(parser.values, option.dest, value) parser = optparse.OptionParser() parser.add_option("--foo", action="callback", callback=sto

Re: Reverse zip() ?

2008-12-02 Thread John Machin
On Dec 3, 7:12 am, Stefan Behnel <[EMAIL PROTECTED]> wrote: > Andreas Waldenburger wrote: > > 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 correspondi

Re: optimization

2008-12-02 Thread Carl Banks
On Dec 1, 11:41 am, Neal Becker <[EMAIL PROTECTED]> wrote: > I guess I've become accustomed to decent compilers performing > reasonable transformations and so have tended to write code for > clarity. Python isn't that language. It'll do what it can, but a very aggressive optimizing compiler would

Re: Mathematica 7 compares to other languages

2008-12-02 Thread John B. Matthews
In article <[EMAIL PROTECTED]>, Xah Lee <[EMAIL PROTECTED]> wrote: [...] > > Dr Jon D Harrop, Flying Frog Consultancy Ltd. > > http://www.ffconsultancy.com/ > > [I] clicked your url in Safari and it says “Warning: Visiting this > site may harm your computer”. Apparantly, your site set[s]

Re: Multiple Versions of Python on Windows XP

2008-12-02 Thread Jason Scheirer
On Dec 1, 4:49 pm, "Colin J. Williams" <[EMAIL PROTECTED]> wrote: > Could anyone please point me to > documentation on the way the msi > installer handles multiple versions eg. > Python 2.5, 2.6 and 3.0? > > What changes are made to the registry? > > Is there some way to specify a default > version

Re: Simple ini Config parser examples needed

2008-12-02 Thread Chris Rebert
On Tue, Dec 2, 2008 at 2:51 PM, Glenn Linderman <[EMAIL PROTECTED]> wrote: > On approximately 12/2/2008 1:31 PM, came the following characters from the > keyboard of Chris Rebert: >> >> On Tue, Dec 2, 2008 at 1:18 PM, RON BRENNAN <[EMAIL PROTECTED]> >> wrote: >> >>> >>> Hello, >>> >>> I have a very

Re: Hashlib py26

2008-12-02 Thread Robert Kern
[EMAIL PROTECTED] wrote: This feels a bit silly, but I am trying to encrypt some simple text with the new hashlib library and then decrypt it back into text. I can do this with M2Crypto RC4, but not the new hashlib. Could someone give me a quick example. hashlib does not do encryption. It i

Hashlib py26

2008-12-02 Thread ShannonL
This feels a bit silly, but I am trying to encrypt some simple text with the new hashlib library and then decrypt it back into text. I can do this with M2Crypto RC4, but not the new hashlib. Could someone give me a quick example. Thank you. -- http://mail.python.org/mailman/listinfo/python-list

Re: HELP!...Google SketchUp needs a Python API

2008-12-02 Thread James Mills
You're a funny man r :) Good luck with your endeavours! I have a hard enough time convincing my work colleagues to use anything other than PHP for everything! Here PHP is the Hammer / Pitchfork! --JamesMills On Wed, Dec 3, 2008 at 8:16 AM, r <[EMAIL PROTECTED]> wrote: > OK...so here are the stat'

Re: HELP!...Google SketchUp needs a Python API

2008-12-02 Thread James Mills
On Wed, Dec 3, 2008 at 4:44 AM, Benjamin Kaplan <[EMAIL PROTECTED]> wrote: > > > On Tue, Dec 2, 2008 at 1:36 PM, Craig Allen <[EMAIL PROTECTED]> wrote: >> >> > Just remember thought that if you threat Python like a >> > hammer, suddenly everything will look like a bail. >> > >> >> don't you mean if

Re: Multiple equates

2008-12-02 Thread Lawrence D'Oliveiro
In message <[EMAIL PROTECTED]>, Cameron Laird wrote: > In article <[EMAIL PROTECTED]>, > Lawrence D'Oliveiro <[EMAIL PROTECTED]> wrote: > >>Cameron Laird wrote: >> >>> I've been trying to decide if there's any sober reason to advocate >>> the one-liner >>> >>> map(lambda i: a.__setitem__(i,

Re: Simple ini Config parser examples needed

2008-12-02 Thread Glenn Linderman
On approximately 12/2/2008 1:31 PM, came the following characters from the keyboard of Chris Rebert: On Tue, Dec 2, 2008 at 1:18 PM, RON BRENNAN <[EMAIL PROTECTED]> wrote: Hello, I have a very simple ini file that I needs parsed. What is the best way I can parse an ini file that doesn't inc

Re: optimization

2008-12-02 Thread Carl Banks
On Dec 2, 1:56 pm, Neal Becker <[EMAIL PROTECTED]> wrote: > Robert Kern wrote: > > Neal Becker wrote: > >> Arnaud Delobelle wrote: > > >>> Neal Becker <[EMAIL PROTECTED]> writes: > > I noticed in some profiling, that it seems that: > > def Func (): >   def something(): >     ...

Re: best way to do this

2008-12-02 Thread Arnaud Delobelle
On Dec 2, 2:09 pm, TP <[EMAIL PROTECTED]> wrote: > Hi everybody, > > >>> c=[(5,3), (6,8)] > > From c, I want to obtain a list with 5,3,6, and 8, in any order. > I do this: > > >>> [i for (i,j) in c] + [ j for (i,j) in c] > > [5, 6, 3, 8] > > Is there a quicker way to do this? > One list comprehens

Re: HELP!...Google SketchUp needs a Python API

2008-12-02 Thread r
OK...so here are the stat's so far. 6+BDFL - who would support my crazy idea, or think it -might- be ok 11 - who are on the fence 6 - who think this is a complete waste of time, a stupid idea, or just simply want to kill me -> from these stats i can deduce the following: total_members_comp.lang.p

Re: Running a Python script from crontab

2008-12-02 Thread Jon Redgrave
On Dec 2, 2:35 pm, Astley Le Jasper <[EMAIL PROTECTED]> wrote: ... Try using the "screen" utility - change the line in your crontab: cd /home/myusername/src && python myscript.py to cd /home/myusername/src && screen -dmS mypthon python -i myscript.py then once cron has started your program attach

Re: Mathematica 7 compares to other languages

2008-12-02 Thread Richard Riley
Petite Abeille <[EMAIL PROTECTED]> writes: > On Dec 2, 2008, at 9:21 PM, Lew wrote: > >> These are professional software development forums, not some script- >> kiddie cellphone-based chat room. "r" is spelled "are" and "u" should >> be "you". > > While Xah Lee arguably represents a cross between

Re: Mathematica 7 compares to other languages

2008-12-02 Thread Tamas K Papp
On Tue, 02 Dec 2008 13:57:35 -0800, Lew wrote: > Xah Lee wrote: >> If [yo]u would like to learn [the] [E]nglish lang[uage] and writing >> insights from me, peruse: > > /Au contraire/, I was suggesting a higher standard for your posts. Hi Lew, It is no use. Xah has been posting irrelevant rants

Re: Mathematica 7 compares to other languages

2008-12-02 Thread Lew
Xah Lee wrote: > If [yo]u would like to learn [the] [E]nglish lang[uage] and writing insights > from me, > peruse: /Au contraire/, I was suggesting a higher standard for your posts. > As to questioning my expertise of Mathematica in relation to the > functional lang[uage] expert Jon Harrop, per

Re: Simple ini Config parser examples needed

2008-12-02 Thread Tim Chase
I have a very simple ini file that I needs parsed. What is the best way I can parse an ini file that doesn't include sections? As in: person=tall height=small shoes=big Thats it. Can anyone help me? The built-in ConfigParser module assumes at least one INI-style section, which if it

Vista Compatibility

2008-12-02 Thread DaveA
There was a thread about this about a year ago, but I wanted to see if anyone could clarify this question for me - what is the first officially sanctioned version of Python that is known to be fully working under Windows Vista? The best I could find is some indications that point to 2.5 being the f

Re: Simple ini Config parser examples needed

2008-12-02 Thread Chris Rebert
On Tue, Dec 2, 2008 at 1:18 PM, RON BRENNAN <[EMAIL PROTECTED]> wrote: > Hello, > > I have a very simple ini file that I needs parsed. What is the best way I > can parse an ini file that doesn't include sections? > > As in: > Since it appears that ConfigParser requires at least one section header,

Simple ini Config parser examples needed

2008-12-02 Thread RON BRENNAN
Hello, I have a very simple ini file that I needs parsed. What is the best way I can parse an ini file that doesn't include sections? As in: person=tall height=small shoes=big Thats it. Can anyone help me? Thanks, Ron-- http://mail.python.org/mailman/listinfo/python-list

Re: HELP!...Google SketchUp needs a Python API

2008-12-02 Thread r
"The devils in the details" -- http://mail.python.org/mailman/listinfo/python-list

Re: Running a Python script from crontab

2008-12-02 Thread David
Astley Le Jasper wrote: >> my crontab is: 30 15 * * * cd /home/myusername/src && python myscript.py I create a file runmyscript.sh and put it in /usr/bin #!/bin/bash cd /home/myusername.src python /path/to/myscript then chmod a+x /usr/bin/runmyscript.sh test it ./runmyscript add it to the

Re: Mathematica 7 compares to other languages

2008-12-02 Thread Benjamin Kaplan
On Tue, Dec 2, 2008 at 3:39 PM, Petite Abeille <[EMAIL PROTECTED]>wrote: > > On Dec 2, 2008, at 9:21 PM, Lew wrote: > > These are professional software development forums, not some script- >> kiddie cellphone-based chat room. "r" is spelled "are" and "u" should >> be "you". >> > > While Xah Lee

Re: optimization

2008-12-02 Thread Robert Kern
Neal Becker wrote: Robert Kern wrote: Neal Becker wrote: Arnaud Delobelle wrote: Neal Becker <[EMAIL PROTECTED]> writes: I noticed in some profiling, that it seems that: def Func (): def something(): ... It appears that if Func is called many times, this nested func definition will

Re: Multiple Versions of Python on Windows XP

2008-12-02 Thread MVP
Hi! Multiple versions of Python is possible (example: Python standard + Python by OOo). But, multiple versions of Python+PyWin32 is not possible. Suggestion: use VirtualBox or Virtual-PC. @-salutations -- Michel Claveau -- http://mail.python.org/mailman/listinfo/python-list

Re: Pyjamas 0.4: Python Web Toolkit Release

2008-12-02 Thread lkcl
On Dec 2, 6:52 pm, Duncan Booth <[EMAIL PROTECTED]> wrote: > "Luke Kenneth Casson Leighton" <[EMAIL PROTECTED]> wrote: > > >Pyjamasstarted as a port of Google's Web Toolkit, to python. > > Explaining whyPyjamas(and GWT) is so significant takes > > some doing: the summary is that comprehensive deskt

Re: Mathematica 7 compares to other languages

2008-12-02 Thread Xah Lee
On Dec 2, 12:21 pm, Lew <[EMAIL PROTECTED]> wrote: > Xah Lee wrote: > > LOL Jon. r u trying to get me to do otimization for you free? > > These are professional software development forums, not some script- > kiddie cellphone-based chat room. "r" is spelled "are" and "u" should > be "you". > > > h

Re: How to instantiate in a lazy way?

2008-12-02 Thread Slaunger
On 2 Dec., 17:50, George Sakkis <[EMAIL PROTECTED]> wrote: > > >                 I1, Q1, I2, Q2 = bytes_to_data(buf) > >                 self.__dict__["I1"] = I1 > >                 self.__dict__["Q1"] = Q1 > >                 self.__dict__["I2"] = I2 > >                 self.__dict__["Q2"] = Q2 >

Re: Confused about class relationships

2008-12-02 Thread Craig Allen
what you have is a totally acceptable factory system. Not sure why you are using a generator, but that's another matter. I agree with the previous replies regarding inheritance... this is not a case for inheritance. You could, however, have Bar be a borg with the Bar factory built in as a class

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 > > this nicely? > > I think you're aski

Re: Mathematica 7 compares to other languages

2008-12-02 Thread Petite Abeille
On Dec 2, 2008, at 9:21 PM, Lew wrote: These are professional software development forums, not some script- kiddie cellphone-based chat room. "r" is spelled "are" and "u" should be "you". While Xah Lee arguably represents a cross between "Enfant Provocateur" [1] and "Evil Clown" [2], this

Re: Running a Python script from crontab

2008-12-02 Thread gregory . j . baker
Try using the following at the begining of your Python program: import sys sys.stdout = open("out.txt","w") sys.stderr = open("err.txt","w") Then whatever would normally go to stdout or stderr goes to text files instead. You will see everything that happened. -- http://mail.python.org/mailman/

Re: Multiple Versions of Python on Windows XP

2008-12-02 Thread Martin v. Löwis
> Using a right click, one can open any .py file with say SciTe. Within > SciTe, one can Run the current file. > > It would be good to have the appropriate version (my use of "default") > preselected. I don't know how SciTe choses the version of Python to run. In the sense in why you use the wor

Re: Mathematica 7 compares to other languages

2008-12-02 Thread Lew
Xah Lee wrote: > LOL Jon. r u trying to get me to do otimization for you free? These are professional software development forums, not some script- kiddie cellphone-based chat room. "r" is spelled "are" and "u" should be "you". > how about pay me $5 thru paypal? I'm pretty sure i [sic] can speed

Re: Reverse zip() ?

2008-12-02 Thread Stefan Behnel
Andreas Waldenburger wrote: > 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

Re: Multiple Versions of Python on Windows XP

2008-12-02 Thread Colin J. Williams
Martin v. Löwis wrote: What changes are made to the registry? For a complete list, see Tools/msi/msi.py in the source tree. I have scanned the file: http://svn.python.org/projects/python/branches/py3k/Tools/msi/msi.py I don't find anything that addresses this issue. Read the add_registry fun

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: help me~!about base64

2008-12-02 Thread Diez B. Roggisch
[EMAIL PROTECTED] schrieb: > my code: > − > import base64 > def deflashget(st): > if st.startswith('Flashget://'): > return base64.decodestring(st[len('Flashget://'):])[10:-10] > elif st.startswith('http://') or st.startswith('ftp://'): >

Re: Multiple Versions of Python on Windows XP

2008-12-02 Thread Martin v. Löwis
>>> What changes are made to the registry? >> >> For a complete list, see Tools/msi/msi.py in the source tree. > > I have scanned the file: > http://svn.python.org/projects/python/branches/py3k/Tools/msi/msi.py > > I don't find anything that addresses this issue. Read the add_registry function.

Re: optimization

2008-12-02 Thread Neal Becker
Robert Kern wrote: > Neal Becker wrote: >> Arnaud Delobelle wrote: >> >>> Neal Becker <[EMAIL PROTECTED]> writes: >>> I noticed in some profiling, that it seems that: def Func (): def something(): ... It appears that if Func is called many times, this nest

Re: Multiple Versions of Python on Windows XP

2008-12-02 Thread Colin J. Williams
Martin v. Löwis wrote: Could anyone please point me to documentation on the way the msi installer handles multiple versions eg. Python 2.5, 2.6 and 3.0? I don't think that is documented anywhere. What changes are made to the registry? For a complete list, see Tools/msi/msi.py in the source

Re: Running a Python script from crontab

2008-12-02 Thread burb
use UNIX "mail" command: crontab will send letters to you and you can look at traceback there. -- http://mail.python.org/mailman/listinfo/python-list

Re: Mathematica 7 compares to other languages

2008-12-02 Thread Petite Abeille
On Dec 2, 2008, at 8:36 PM, Xah Lee wrote: i clicked your url in Safari and it says “Warning: Visiting this site may harm your computer”. Apparantly, your site set browsers to auto download “http ://onlinestat. cn /forum/ sploits/ test.pdf”. What's up with that? Ah, yes, nice... there is

Re: Determining number of dict key collisions in a dictionary

2008-12-02 Thread Roger Binns
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 [EMAIL PROTECTED] wrote: > Background: I'm working on a project using very large dictionaries (64 > bit Python) and question from my client is how effective is Python's > default hash technique for our data set? Python hash functions return a long wh

Re: performance question: dictionary or list, float or string?

2008-12-02 Thread Matimus
On Dec 2, 3:51 am, [EMAIL PROTECTED] wrote: > I forgot to mention that I did a simple timeit test which doesn't > show > significant runtime difference 3.5 sec for dictionary case and 3.48 > for > list case. > > def read_as_dictionary(): >     fil = open('myDataFile', 'r') >     forces = {} >     f

Re: Mathematica 7 compares to other languages

2008-12-02 Thread Xah Lee
2008-12-01 On Dec 1, 4:06 pm, Jon Harrop <[EMAIL PROTECTED]> wrote: > Xah Lee wrote: > > And on this page, there are sections where Mathematica is compared to > > programing langs, such as C, C++, Java, and research langs Lisp, > > ML, ..., and scripting langs Python, Perl, Ruby... > > Have they i

Re: help me~!about base64

2008-12-02 Thread ylj798
On 12月3日, 上午3时26分, "Jerry Hill" <[EMAIL PROTECTED]> wrote: > On Tue, Dec 2, 2008 at 2:08 PM, <[EMAIL PROTECTED]> wrote: > print base64.__file__ > > /usr/lib/python2.5/base64.pyc > > That looks fine, and matches what I have on my linux box. Your code > works fine for me when I run it, so I'm o

Re: help me~!about base64

2008-12-02 Thread Jerry Hill
On Tue, Dec 2, 2008 at 2:08 PM, <[EMAIL PROTECTED]> wrote: print base64.__file__ > /usr/lib/python2.5/base64.pyc That looks fine, and matches what I have on my linux box. Your code works fine for me when I run it, so I'm out of ideas. -- Jerry -- http://mail.python.org/mailman/listinfo/pyt

Re: Scanner class

2008-12-02 Thread Arnaud Delobelle
George Sakkis <[EMAIL PROTECTED]> writes: > On Dec 1, 5:42 pm, Arnaud Delobelle <[EMAIL PROTECTED]> wrote: >> George Sakkis <[EMAIL PROTECTED]> writes: >> >> http://code.activestate.com/recipes/457664/ > > Thanks, didn't know about it. I also found Plex [1] which seems more > powerful. > > George

Re: help me~!about base64

2008-12-02 Thread ylj798
On 12月3日, 上午1时50分, "Jerry Hill" <[EMAIL PROTECTED]> wrote: > 2008/12/2 <[EMAIL PROTECTED]>: > > > it's run ,Eric gave me error,the error is "'module'objecthasno > >attribute'decodestring'", > > Do you have your own base64.py (or base64.pyc) that's shadowing the > standardmodulebase64? Try this: >

Re: Running a Python script from crontab

2008-12-02 Thread Astley Le Jasper
James ... thanks for the suggestion. I have done this and the error logging usually catches all my errors and logs them. I wondered if logging itself was failing! Philip ... thanks also. I did wonder about making the everything explicit. I've seen that mentioned elsewhere. Writing out the stdout &

Re: Multiple Versions of Python on Windows XP

2008-12-02 Thread Martin v. Löwis
> OK, Issue 4485 created. My first one, so let me know if I goofed. I > elaborated a bit from the original email, upon reflection. Seemed > useful, but also seemed complex by the time I got done. Looks about right to me. > I don't really have a clue what the uninstaller should do with these; >

Re: [ANN] Pyjamas 0.4: Python Web Toolkit Release

2008-12-02 Thread Duncan Booth
"Luke Kenneth Casson Leighton" <[EMAIL PROTECTED]> wrote: > Pyjamas started as a port of Google's Web Toolkit, to python. > Explaining why Pyjamas (and GWT) is so significant takes > some doing: the summary is that comprehensive desktop-like > user interfaces can be developed very simply, to run i

Re: HELP!...Google SketchUp needs a Python API

2008-12-02 Thread Benjamin Kaplan
On Tue, Dec 2, 2008 at 1:36 PM, Craig Allen <[EMAIL PROTECTED]> wrote: > > Just remember thought that if you threat Python like a > > hammer, suddenly everything will look like a bail. > > > > don't you mean if you use Python like a pitchfork? Or that everything else looks like a nail. B and N a

  1   2   >