Re: Multiple Versions of Python on Windows XP

2008-12-01 Thread Martin v. Löwis
> It would be nice if the ftypes were version specific as created by the > installer; IIRC, I created the above three from the ftype Python.File as > I installed each version. That's a good idea; please submit a wish list item to bugs.python.org. There may be issues (such as people relying on this

Re: Multiple Versions of Python on Windows XP

2008-12-01 Thread Glenn Linderman
On approximately 12/1/2008 11:05 PM, came the following characters from the keyboard of Martin v. Löwis: Is there some way to specify a default version in such a way that it can be changed as necessary? What do you mean by "default version"? There is the version that is associated with th

Re: Multiple Versions of Python on Windows XP

2008-12-01 Thread Martin v. Löwis
> 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 tree. > Is there some

Re: Import of egg packages installed with easy_install

2008-12-01 Thread Alexey Vlasov
Hi Diez. On Mon, Dec 01, 2008 at 08:09:29PM +0100, Diez B. Roggisch wrote: > It's not sufficient to add simply your local site-packages, you must install > it using the module site's addsitedir-function, like this: > > import site > site.addsitedir("/home/username/python/lib/python2.5/site-packa

Re: Creating classes and objects more than once?

2008-12-01 Thread Gabriel Genellina
En Sat, 29 Nov 2008 04:51:59 -0200, Carl Banks <[EMAIL PROTECTED]> escribió: On Nov 28, 11:51 pm, Carl Banks Absolute versus relative imports don't have anything to do with the issue here.  PEP 328 concerns itself with imports relative to the executing module in package space.  It has nothing

Re: What about a decorator module version 3.0?

2008-12-01 Thread Michele Simionato
On Dec 1, 9:18 pm, Terry Reedy <[EMAIL PROTECTED]> wrote: > > Release a final 2.x version with whatever internal changes but with > external api unchanged or at least backward compatible.  Mark items to > be deleted as deprecated.  Keep that available indefinately. > > Then release a 3.0 version wi

Re: Reg: PIL2.4 Error: AttributeError: pixel_access

2008-12-01 Thread Kottiyath
On Dec 1, 11:20 pm, Kottiyath <[EMAIL PROTECTED]> wrote: > Hi all, >     I am facing the following problem in PIL 2.4: > Code: > img = ImageGrab.grab() > img.save("image2.jpg") > > Error: >     img.save("image2.jpg") >   File "C:\Python24\Lib\site-packages\PIL\Image.py", line 1372, in > save >    

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

2008-12-01 Thread r
PS james, Since you are alex23's friend, do the world a favor...PLEASE GET ALEX LAID...before it's too late! -- http://mail.python.org/mailman/listinfo/python-list

Re: Do more imported objects affect performance

2008-12-01 Thread Taskinoor Hasan
On Mon, Dec 1, 2008 at 8:21 PM, Filip Gruszczyński <[EMAIL PROTECTED]>wrote: > I see. Thanks for a really good explanation, I like to know, how to do > things in the proper way :) I always prefer to use import module and then use module.function. The reason is simple. It makes the code more read

Re: Google App Engine Code Challenge - write a tetris playing algorithm

2008-12-01 Thread russ
> > what if you wanted to move a piece to the left or right after its past some > vertical obstruction? > Not _presently_ supporting moving the piece left or right. I've thought about it, and would make things a bit more complicated - just wanted to get something simple "out there", and see how m

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

2008-12-01 Thread r
Ok, so i was wrong about you =) -- http://mail.python.org/mailman/listinfo/python-list

epydoc: How to add new fields as the building fields?

2008-12-01 Thread Cyril . Liu
I can add new field in my docstring with "@newfield*"* tag. but some tag witch I defined would be used in every source files. I do not want to write " @newfield tag ..." in all my docstring. Is there any way to add a building fields to epydoc? thx. -- About Cyril.Liu -

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

2008-12-01 Thread alex23
On Dec 2, 2:18 pm, r <[EMAIL PROTECTED]> wrote: > PS hey...even alex23's post are a little less mean. Either I am > wearing him down or he is beginning to believe :) Yes, my wishing your death by asphyxiation is "less mean" than my original post suggesting you do some work. Your lack of reading c

Re: Emacs vs. Eclipse vs. Vim

2008-12-01 Thread Peter Anderson
Stef asked: / />/ As a fall-back I also use EditPlus (see />/ http://www.editplus.com/index.html ). Its only for Windows /but PyScripter is also only for windows ;-) / and its shareware so you need to pay for it. Its clip library makes it />/ a VERY GOOD text editor. It's a real shame there ar

Re: Google App Engine Code Challenge - write a tetris playing algorithm

2008-12-01 Thread Casey McGinty
Well, I think its a cool idea. I might try it out if I can find some free cycles. And does the game logic assume the pieces come straight down? For example, what if you wanted to move a piece to the left or right after its past some vertical obstruction? For example If you place and upside down 'j

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

2008-12-01 Thread r
alex23, Ok...you don't like my idea...so why keep responding? ajaksu, You insulted me and accused me of trolling, but it looks like your interested. And you also included links. I think your really on board and just can't say it yet *wink*. Thank You Aaron, I agree to disagree with you...although

Re: Loading required libraries for python script from shell just once

2008-12-01 Thread Miki
> Is it possible to load all the modules used by run-test.py in > a pre-execution environment in order to prevent this delay? Only if you have one script the calls "main" (or any other entry point) in the tests. > I considered a rewrite of the shell script into python, but it has too > many depend

Re: Mathematica 7 compares to other languages

2008-12-01 Thread toby
On Dec 1, 5:24 am, budden <[EMAIL PROTECTED]> wrote: > Mathematica is a great language, but: > 1. it is too slow > 2. It is often hard to read > 3. It gives sence to every keystroke. You press escape by occasion and > it goes in a code as a new > symbol, w/o error. Nasty. > 3. I know 5-th version.

Re: Google App Engine Code Challenge - write a tetris playing algorithm

2008-12-01 Thread russ
that's the first feature i'll add.. once the popularity gets over zero! :) On Tue, Dec 2, 2008 at 2:19 PM, Casey McGinty <[EMAIL PROTECTED]>wrote: > On Sun, Nov 30, 2008 at 2:41 PM, russ.au <[EMAIL PROTECTED]> wrote: > >> I've got more features to add, depending on how >> popular it is..

Re: Google App Engine Code Challenge - write a tetris playing algorithm

2008-12-01 Thread Casey McGinty
On Sun, Nov 30, 2008 at 2:41 PM, russ.au <[EMAIL PROTECTED]> wrote: > I've got more features to add, depending on how > popular it is.. > Are you going to create a leader board to track the high scores? -- http://mail.python.org/mailman/listin

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

2008-12-01 Thread James Mills
This is my first post to this particular topic and my good friend alsex32 will know that I tend to steer away from large pointless conversation topics (for obvious reasons). @OP: Listen ... The best way you can support Python is to use Python. The best way you can promote Python is to encourage o

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

2008-12-01 Thread Aaron Brady
On Dec 1, 2:29 pm, r <[EMAIL PROTECTED]> wrote: > Rome is Burning! > Pay particular attention to the second paragraph. > > Narcissistic culture > > Main article: The Culture of Narcissism > Historian and social critic Christopher Lasch described this topic in > his book, "The Culture of Narcissism"

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

2008-12-01 Thread ajaksu
r, you could just calm down, stop your trolling and wait to see if more people like greg are able to see a good idea behind your awful delivery. Seriously, you're talking nonsense to people that have actively promoted, taught, developed with and helped develop Python for years. You're mistaking la

Loading required libraries for python script from shell just once

2008-12-01 Thread raviforlkml
I have a linux-like host running busybox with the python installation mounted over NFS and have the corresponding symlinks setup in /usr/bin and /usr/lib for python to run smoothly. A shell script runs my python script several times, each time with different paramters. E.g. # cat foo.sh # Lot of

Re: Mathematica 7 compares to other languages

2008-12-01 Thread anonymous . c . lisper
On Dec 1, 8:29 pm, Lew <[EMAIL PROTECTED]> wrote: > [EMAIL PROTECTED] wrote: > > A rational human would realize that not too many people peruse this > > newsgroup, > > and that most of them have already seen the wall of text post that you > > generate every time. > > Just out of curiosity, what do

Re: end of print = lower productivity ?

2008-12-01 Thread Terry Reedy
alex23 wrote: On Dec 2, 5:12 am, Alan G Isaac <[EMAIL PROTECTED]> wrote: One obvious cost is that working at the interpreter prompt is now slightly less convenient. Not if you use IPython: IPython 0.8.1 -- An enhanced Interactive Python. ? -> Introduction to IPython's features. %magic

Re: Mathematica 7 compares to other languages

2008-12-01 Thread Lew
Jon Harrop wrote: Xah Lee wrote: (nothing Java-related) Please take this crud out of the Java newsgroup. -- Lew -- http://mail.python.org/mailman/listinfo/python-list

Re: Mathematica 7 compares to other languages

2008-12-01 Thread Stef Mientki
Jon Harrop 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 implemented any of the following features in the latest v

Re: Mathematica 7 compares to other languages

2008-12-01 Thread Lew
[EMAIL PROTECTED] wrote: A rational human would realize that not too many people peruse this newsgroup, and that most of them have already seen the wall of text post that you generate every time. Just out of curiosity, what do you consider "this" newsgroup, given its wide crossposting? -- Le

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

2008-12-01 Thread alex23
On Dec 2, 6:29 am, r <[EMAIL PROTECTED]> wrote: > In such a society of constant competition, there can be no allies, and > little transparency. The threats to acquisitions of social symbols are > so numerous, varied and frequently incomprehensible, that > defensiveness, as well as competitiveness,

Re: end of print = lower productivity ?

2008-12-01 Thread alex23
On Dec 2, 5:12 am, Alan G Isaac <[EMAIL PROTECTED]> wrote: > One obvious cost is that working at the > interpreter prompt is now slightly less > convenient. Not if you use IPython: IPython 0.8.1 -- An enhanced Interactive Python. ? -> Introduction to IPython's features. %magic -> Informati

Re: Mathematica 7 compares to other languages

2008-12-01 Thread bearophileHUGS
Jon Harrop: Is so wide cross-posting positive? > 4. Static type checking.< This is a Python newsgroup, you will find less lovers of static typing here :-) >Overall, Mathematica is a whopping 700,000 times slower!< Your Mathematica code is cute, but surely Mathematica isn't designed for that k

Re: optimization

2008-12-01 Thread Robert Kern
[EMAIL PROTECTED] wrote: Robert Kern: I only expect functions to be defined inside of functions if they are going to use lexical scoping for some reason.< There are other reasons to nest functions. One of them is to represent logical nesting of some functionality. Is that any different than

Re: Mathematica 7 compares to other languages

2008-12-01 Thread bearophileHUGS
Mathematica has some powerful symbolic processing capabilities, for example the integrals, etc. It also contains many powerful algorithms, often written in few lines of code. And its graphic capabilities are good. It also shows some surprising ways to integrate and manipulate data, for example here

Aviate, the Web Deployer

2008-12-01 Thread Amr
Announcing the first public release of Aviate, a cross-platform web deployment tool written in Python. Aviate is designed to make deploying your web applications very easy, while providing you with a rich feature set to make repeated task performed in a snap, and being extensible so you can extend

Re: Checking a string against multiple matches

2008-12-01 Thread alex23
On Dec 2, 5:31 am, Aaron Scott <[EMAIL PROTECTED]> wrote: > I was using .index on the > list, but it would return True for strings that contained the search > string rather than match it exactly, leading to false positives in my > code. Are you sure? That doesn't seem like standard behaviour. >>>

Re: Why doesn't doc has predifined name and location ?

2008-12-01 Thread Colin J. Williams
Chris Rebert wrote: On Mon, Dec 1, 2008 at 1:22 PM, Stef Mientki <[EMAIL PROTECTED]> wrote: hello, I'm very satisfied about the great standardization of doc strings in python. Now in contrast to that, the general documentation of libraries, either in plain text, html, pdf, chm, ... doesn't have

Re: end of print = lower productivity ?

2008-12-01 Thread Lie Ryan
On Mon, 2008-12-01 at 09:46 -0600, Tim Chase wrote: > > For a proof, let's see what Google has to say about this: > > "Windows text editor". Vim is on page 3, near the turning > > point where nobody is talking about text-editor anymore and > > more about text-editor reviews. Even worse is Emacs, on

Multiple Versions of Python on Windows XP

2008-12-01 Thread Colin J. Williams
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 in such a way that it can be changed as necessary? PyScripter uses an opt

Re: optimization

2008-12-01 Thread bearophileHUGS
Robert Kern: >I only expect functions to be defined inside of functions if they are going to >use lexical scoping for some reason.< There are other reasons to nest functions. One of them is to represent logical nesting of some functionality. So you will find some exceptions to your self-created r

Re: unicode and hashlib

2008-12-01 Thread Scott David Daniels
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 mistake once in this thread as

Re: Emacs vs. Eclipse vs. Vim

2008-12-01 Thread Mario Testinori
On Mon, 1 Dec 2008 15:57:17 -0800 (PST), "[EMAIL PROTECTED]" <[EMAIL PROTECTED]> wrote: >On Nov 29, 3:44 pm, Josh <[EMAIL PROTECTED]> wrote: >> If you were a beginning programmer and willing to make an investment in >> steep learning curve for best returns down the road, which would you pick? >> >

Re: optimization

2008-12-01 Thread Robert Kern
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 cause significant overhead. Is this tru

Re: Mathematica 7 compares to other languages

2008-12-01 Thread Jon Harrop
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 implemented any of the following features in the latest version: 1. Redistributa

Re: Emacs vs. Eclipse vs. Vim

2008-12-01 Thread [EMAIL PROTECTED]
On Nov 29, 3:44 pm, Josh <[EMAIL PROTECTED]> wrote: > If you were a beginning programmer and willing to make an investment in > steep learning curve for best returns down the road, which would you pick? > > I know this topic has been smashed around a bit already, but 'learning > curve' always seems

Re: Chmod to a group only

2008-12-01 Thread Martin v. Löwis
>> How to chmod a file to: o-rwx ? (to change only the others mode) > I have tried: > > mode = os.stat(fname).st_mode > os.chmod(fname, mode | stat.S_IRWXO) => Changes to o+rwx Close. Try os.chmod(fname, mode & ~stat.S_IRWXO) Regards, Martin -- http://mail.python.org/mailman/listinfo/python-lis

Re: newbie question: parse a variable inside an RE?

2008-12-01 Thread John Machin
On Dec 2, 8:56 am, "Diez B. Roggisch" <[EMAIL PROTECTED]> wrote: > [EMAIL PROTECTED] schrieb: > > > Hi All, > > > How do I parse a variable inside an RE? > > What is the re.search() syntax when your > > search string is a variable? > > It's easy to parse hardcoded RE's but not > > if you use a vari

Re: Two attributes! Why?

2008-12-01 Thread Steven D'Aprano
On Mon, 01 Dec 2008 07:43:44 -0800, Emanuele D'Arrigo wrote: > On Nov 29, 5:21 am, Steven D'Aprano <[EMAIL PROTECTED] > cybersource.com.au> wrote: >> This is a side-effect of name-mangling. Double-underscore names are >> only mangled when they are referred to directly as attributes, not when >> th

Re: end of print = lower productivity ?

2008-12-01 Thread Steven D'Aprano
On Mon, 01 Dec 2008 09:46:43 -0600, Tim Chase wrote: >> For a proof, let's see what Google has to say about this: "Windows text >> editor". Vim is on page 3, near the turning point where nobody is >> talking about text-editor anymore and more about text-editor reviews. >> Even worse is Emacs, on p

Re: optimization

2008-12-01 Thread Neal Becker
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 cause significant overhead. Is this

Re: Mathematica 7 compares to other languages

2008-12-01 Thread anonymous . c . lisper
On Nov 30, 10:30 pm, Xah Lee <[EMAIL PROTECTED]> wrote: > some stuff You are a bot? I think you failed the Turing test when you posted the same thing 20 times. A rational human would realize that not too many people peruse this newsgroup, and that most of them have already seen the wall of text

Re: Mathematica 7 compares to other languages

2008-12-01 Thread anonymous . c . lisper
On Dec 1, 2:23 am, Xah Lee <[EMAIL PROTECTED]> wrote: > On Nov 30, 7:30 pm, Xah Lee <[EMAIL PROTECTED]> wrote: > >>some stuff Are you a bot? I think you failed the Turing test after the 8th time you posted the exact same thing... I'm completely serious. -- http://mail.python.org/mailman/listinfo

Re: Scanner class

2008-12-01 Thread Arnaud Delobelle
George Sakkis <[EMAIL PROTECTED]> writes: > Is there any stdlib or (more likely) 3rd party module that provides a > similar functionality to the java.util.Scanner class [1] ? If not, > would there be any interest in porting it (with a more Pythonic API of > course) or are there better alternatives

Re: pydoc enforcement.

2008-12-01 Thread Ken Faulkner
Hi Yeah, I was thinking about something at commit time for a VCS... catch is, soo many VCS's out there. And I wasn't thinking of the default action throwing compile errors, but would only do that if a particular flag was given. Still, just an idea. I'm just finding more and more public modules/

Re: Why doesn't doc has predifined name and location ?

2008-12-01 Thread Mike Driscoll
> Sidenote: what Python projects publish their docs in CHM besides > possibly Win32 GUI programs? Doing a quick search in my Python25 directory and all it's sub- folders, all I found was Python25.chm and PyWin32.chm. However, I know wxPython also has a help file in chm format, but it puts it in

Re: optimization

2008-12-01 Thread Arnaud Delobelle
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 cause significant overhead. Is this true? I guess > I've become accustom

Re: newbie question: parse a variable inside an RE?

2008-12-01 Thread Diez B. Roggisch
[EMAIL PROTECTED] schrieb: Hi All, How do I parse a variable inside an RE? What is the re.search() syntax when your search string is a variable? It's easy to parse hardcoded RE's but not if you use a variable. Both are exactly equal in difficulty. Here is my code, input and runtime: $ cat t

Scanner class

2008-12-01 Thread George Sakkis
Is there any stdlib or (more likely) 3rd party module that provides a similar functionality to the java.util.Scanner class [1] ? If not, would there be any interest in porting it (with a more Pythonic API of course) or are there better alternatives ? George [1] http://java.sun.com/j2se/1.5.0/docs

Re: Why doesn't doc has predifined name and location ?

2008-12-01 Thread Duncan Booth
"Chris Rebert" <[EMAIL PROTECTED]> wrote: > Sidenote: what Python projects publish their docs in CHM besides > possibly Win32 GUI programs? Python itself does and, given that chm output is one of the features built in to Sphinx, so can anything which uses reST documentation. -- http://mail.pyth

Re: Why doesn't doc has predifined name and location ?

2008-12-01 Thread Stef Mientki
Chris Rebert wrote: On Mon, Dec 1, 2008 at 1:22 PM, Stef Mientki <[EMAIL PROTECTED]> wrote: hello, I'm very satisfied about the great standardization of doc strings in python. Now in contrast to that, the general documentation of libraries, either in plain text, html, pdf, chm, ... doesn't h

Re: Emacs vs. Eclipse vs. Vim

2008-12-01 Thread Craig Allen
I would never tell someone what editor to use in the same way I wouldn't tell someone what religion to believe in. Which is to say, I would tell my kids or other trusting soul... I used emacs for years, I was eventually convinced to start using nedit, which is quite nice. For an IDE, which I need

Re: Python introspection and namespace weird question

2008-12-01 Thread Chris Rebert
On Mon, Dec 1, 2008 at 12:23 PM, Rayene Ben Rayana <[EMAIL PROTECTED]> wrote: > Thanks Chris, > > Yeah it is kinda meta thing. My app allows to create a scene (a set of GUI > objects). A scene can be saved as a python script. And, it can be loaded > again using execfile(). > > each GUI object has a

Re: Thread always alive

2008-12-01 Thread bdbull
> I am suspecting some kind of a leak on a IO object like a file or socket > descriptor is still open. Are you sure you're closing them all? You mentioned a finally clause so is it possible that your code is throwing an exception before you clean everything up? -- http://mail.python.org/mailma

Re: Why doesn't doc has predifined name and location ?

2008-12-01 Thread Chris Rebert
On Mon, Dec 1, 2008 at 1:22 PM, Stef Mientki <[EMAIL PROTECTED]> wrote: > hello, > > I'm very satisfied about the great standardization of doc strings in python. > Now in contrast to that, > the general documentation of libraries, > either in plain text, html, pdf, chm, ... > doesn't have a standar

Re: Is it safe to modify the dict returned by vars() or locals()

2008-12-01 Thread Peter Otten
Helmut Jarausch wrote: > I am looking for an elegant way to solve the following problem: > > Within a function > > def Foo(**parms) > > I have a list of names, say VList=['A','B','C1'] > and I like to generate abbreviation > _A identical to parms['A'] > > for that I could write > > def Foo(*

Why doesn't doc has predifined name and location ?

2008-12-01 Thread Stef Mientki
hello, I'm very satisfied about the great standardization of doc strings in python. Now in contrast to that, the general documentation of libraries, either in plain text, html, pdf, chm, ... doesn't have a standarized name nor location. Why is that ? thanks, Stef Mientki -- http://mail.python.o

Re: Is it safe to modify the dict returned by vars() or locals()

2008-12-01 Thread Chris Rebert
On Mon, Dec 1, 2008 at 1:01 PM, Helmut Jarausch <[EMAIL PROTECTED]> wrote: > Hi, > > I am looking for an elegant way to solve the following problem: > > Within a function > > def Foo(**parms) > > I have a list of names, say VList=['A','B','C1'] > and I like to generate abbreviation > _A identical

Thread always alive

2008-12-01 Thread esgameserver
Hi, I have thread that the isAlive() method is always returning True even the last finally(..) clause is executed. I am suspecting some kind of a leak on a IO object like a file or socket descriptor is still open. Could this lead to this kind of problem? If yes, how can I debug this issue efficien

Re: newbie question: parse a variable inside an RE?

2008-12-01 Thread Vlastimil Brom
2008/12/1 <[EMAIL PROTECTED]> > Hi All, > > How do I parse a variable inside an RE? > What is the re.search() syntax when your > search string is a variable? > It's easy to parse hardcoded RE's but not > if you use a variable. > > Here is my code, input and runtime: > > $ cat test45.py > #!/usr/bi

Re: Chmod to a group only

2008-12-01 Thread Peter Otten
Kless wrote: > On 1 dic, 18:17, Kless <[EMAIL PROTECTED]> wrote: >> How to chmod a file to: o-rwx ? (to change only the others mode) >> >> os.chmod(fname, ) >> >> I was reading this [1], but the truth is that anything as 'S_IRUSR' >> doesn't help enought. >> >> [1]http://www.python.org/doc/2.5.2/l

Is it safe to modify the dict returned by vars() or locals()

2008-12-01 Thread Helmut Jarausch
Hi, I am looking for an elegant way to solve the following problem: Within a function def Foo(**parms) I have a list of names, say VList=['A','B','C1'] and I like to generate abbreviation _A identical to parms['A'] for that I could write def Foo(**parms) : for N in VList : if N in pa

Re: python 2.5.2 or Python 2.6 compilation problem on AIX 5.3

2008-12-01 Thread [EMAIL PROTECTED]
On Dec 1, 1:06 pm, Terry Reedy <[EMAIL PROTECTED]> wrote: > [EMAIL PROTECTED] wrote: > > Hello: > > I am trying to compile Python 2.5.2 on AIX 5.3 with gcc 4.2.3. I am > > getting following error. (I also tried Python 2.6 with same error) > > > creating build/temp.aix-5.3-2.5/share/tmhsdsd2/tmp/Pyt

Re: Emacs vs. Eclipse vs. Vim

2008-12-01 Thread Ben Finney
Peter Anderson <[EMAIL PROTECTED]> writes: > What I have done is skipped the whole Vim/Emacs obscure editor thing > and opted for PyScripter PyScripter is not obscure, compared to Emacs and Vim? I think I need a new ironometer. -- \ “I went to a garage sale. ‘How much for the garage?’ ‘I

Re: Checking a string against multiple matches

2008-12-01 Thread Jerry Hill
On Mon, Dec 1, 2008 at 3:29 PM, Aaron Scott <[EMAIL PROTECTED]> wrote: > Damn you, Python, and your loose documentation! It never occurred to > me to actually TRY my pseudocode, since I couldn't find anything on > that type of statement. Anyway, feel free to ignore me from now on. I'm not sure whe

newbie question: parse a variable inside an RE?

2008-12-01 Thread joemacbusiness
Hi All, How do I parse a variable inside an RE? What is the re.search() syntax when your search string is a variable? It's easy to parse hardcoded RE's but not if you use a variable. Here is my code, input and runtime: $ cat test45.py #!/usr/bin/python import re resp = raw_input('Selection: ')

Re: end of print = lower productivity ?

2008-12-01 Thread Terry Reedy
Alan G Isaac wrote: I actually trust that the developers had good reasons for this change, but I think it is silly to argue that it is costless. Guido ever argued that. The question is, what is the cost-benefit trade-off? Uniformity of language, flexibility, and removal of the >> hack that

Re: Checking a string against multiple matches

2008-12-01 Thread Aaron Scott
Damn you, Python, and your loose documentation! It never occurred to me to actually TRY my pseudocode, since I couldn't find anything on that type of statement. Anyway, feel free to ignore me from now on. -- http://mail.python.org/mailman/listinfo/python-list

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

2008-12-01 Thread r
Rome is Burning! Pay particular attention to the second paragraph. Narcissistic culture Main article: The Culture of Narcissism Historian and social critic Christopher Lasch described this topic in his book, "The Culture of Narcissism",[3] published in 1979. He defines a narcissistic culture as

Re: Python introspection and namespace weird question

2008-12-01 Thread Rayene Ben Rayana
Thanks Chris, Yeah it is kinda meta thing. My app allows to create a scene (a set of GUI objects). A scene can be saved as a python script. And, it can be loaded again using execfile(). each GUI object has a label. So, in the script scene, declaring an object in a scene file should look like this

Re: Emacs vs. Eclipse vs. Vim

2008-12-01 Thread Stef Mientki
Peter Anderson wrote: What I have done is skipped the whole Vim/Emacs obscure editor thing and opted for PyScripter (see http://mmm-experts.com/Products.aspx?ProductID=4 ). It might not be as complete/complex as these other editors but it is easy to use and just lets me get on with the task of

Re: What about a decorator module version 3.0?

2008-12-01 Thread Terry Reedy
Michele Simionato wrote: What do you people think? I am not a user yet, but my opinion anyway... Release a final 2.x version with whatever internal changes but with external api unchanged or at least backward compatible. Mark items to be deleted as deprecated. Keep that available indefin

Re: Chmod to a group only

2008-12-01 Thread Kless
On 1 dic, 18:17, Kless <[EMAIL PROTECTED]> wrote: > How to chmod a file to: o-rwx ? (to change only the others mode) > > os.chmod(fname, ) > > I was reading this [1], but the truth is that anything as 'S_IRUSR' > doesn't help enought. > > [1]http://www.python.org/doc/2.5.2/lib/os-file-dir.html I h

Re: Two attributes! Why?

2008-12-01 Thread Terry Reedy
Emanuele D'Arrigo wrote: On Nov 29, 5:21 am, Steven D'Aprano <[EMAIL PROTECTED] cybersource.com.au> wrote: This is a side-effect of name-mangling. Double-underscore names are only mangled when they are referred to directly as attributes, not when they are passed to setattr, getattr etc. Those fu

Re: Checking a string against multiple matches

2008-12-01 Thread Peter Otten
Aaron Scott wrote: > I've been trying to read up on this, but I'm not sure what the > simplest way to do it is. > > I have a list of string. I'd like to check to see if any of the > strings in that list matches another string. > > Pseudocode: > > if "two" in ["one", "two", "three", "four"]: >

Re: Checking a string against multiple matches

2008-12-01 Thread Jerry Hill
On Mon, Dec 1, 2008 at 2:31 PM, Aaron Scott <[EMAIL PROTECTED]> wrote: > Pseudocode: > > if "two" in ["one", "two", "three", "four"]: > return True That works, just like you wrote it: >>> "two" in ["one", "two", "three", "four"] True >>> "two" in ["one", "twofer", "three", "four"] False If

Spring Python 0.9.0 is released

2008-12-01 Thread Goldfish
Spring Python, the python version of the Spring Framework, has just released version 0.9.0. This release includes a key update to springpython.security.web module, where authorization has been patched to support CherryPy 3.1. To download the 0.9.0 release, or an archived release, and for access to

Checking a string against multiple matches

2008-12-01 Thread Aaron Scott
I've been trying to read up on this, but I'm not sure what the simplest way to do it is. I have a list of string. I'd like to check to see if any of the strings in that list matches another string. Pseudocode: if "two" in ["one", "two", "three", "four"]: return True Is there any built-in i

Dec 1st Python Meeting Cancellation

2008-12-01 Thread Mike Driscoll
Hi all! Sorry for the very short notice, but the Python Programming group is canceling tonight's meeting due to inclement weather, lack of interest and sickness. We hope to see you at our next meeting, which will be Monday, January 5th, 2009. Happy holidays! Mike Driscoll http://www.pyowa.org --

Re: end of print = lower productivity ?

2008-12-01 Thread Alan G Isaac
I actually trust that the developers had good reasons for this change, but I think it is silly to argue that it is costless. The question is, what is the cost-benefit trade-off? One obvious cost is that working at the interpreter prompt is now slightly less convenient. Just because the cost is

Re: Import of egg packages installed with easy_install

2008-12-01 Thread Diez B. Roggisch
Alexey Vlasov wrote: > Hi. > > There's an already installed with easy_install packet, let's say flup, > to the home catalog: > $ ls -la ~/python/lib/python2.5/site-packages/ > total 176 > drwxr-xr-x 3 4096 Nov 29 18:57 . > drwxr-xr-x 3 4096 Nov 29 18:51 .. > -rw-r--r-- 1 208 Nov 29 18:57 easy-

Re: python 2.5.2 or Python 2.6 compilation problem on AIX 5.3

2008-12-01 Thread Terry Reedy
[EMAIL PROTECTED] wrote: Hello: I am trying to compile Python 2.5.2 on AIX 5.3 with gcc 4.2.3. I am getting following error. (I also tried Python 2.6 with same error) creating build/temp.aix-5.3-2.5/share/tmhsdsd2/tmp/Python-2.5.2/ Modules gcc -pthread -fno-strict-aliasing -DNDEBUG -g -fwrapv -O

Re: optimization

2008-12-01 Thread Terry Reedy
[EMAIL PROTECTED] wrote: Neal> I noticed in some profiling, that it seems that: Neal> def Func (): Neal> def something(): Neal> ... Neal> It appears that if Func is called many times, this nested func Neal> definition will cause significant overhead. Is this true?

Re: Emacs vs. Eclipse vs. Vim

2008-12-01 Thread Peter Anderson
What I have done is skipped the whole Vim/Emacs obscure editor thing and opted for PyScripter (see http://mmm-experts.com/Products.aspx?ProductID=4 ). It might not be as complete/complex as these other editors but it is easy to use and just lets me get on with the task of cutting code. As a f

Re: Python introspection and namespace weird question

2008-12-01 Thread Chris Rebert
On Mon, Dec 1, 2008 at 6:04 AM, Rayene Ben Rayana <[EMAIL PROTECTED]> wrote: > Hello everybody, > > Is there an easy way to do something like this in python ? > red_car = MyVehicleClass() car = red_car car.labels() > ['red_car' , 'car' ] > > In other words, does an instance has acces

Re: Debugging in Python

2008-12-01 Thread Trent Mick
Scott David Daniels wrote: Stef Mientki wrote: I'm not completely satisfied with even the "best" debuggers, most of the good ones are too difficult, so I want to wrap rpdb2 and don't want to miss any great features ;-) I think ActiveState has a free 21-day trial, so you could check it ou

Reg: PIL2.4 Error: AttributeError: pixel_access

2008-12-01 Thread Kottiyath
Hi all, I am facing the following problem in PIL 2.4: Code: img = ImageGrab.grab() img.save("image2.jpg") Error: img.save("image2.jpg") File "C:\Python24\Lib\site-packages\PIL\Image.py", line 1372, in save self.load() File "C:\Python24\Lib\site-packages\PIL\Image.py", line 599, in

Chmod to a group only

2008-12-01 Thread Kless
How to chmod a file to: o-rwx ? (to change only the others mode) os.chmod(fname, ) I was reading this [1], but the truth is that anything as 'S_IRUSR' doesn't help enought. [1] http://www.python.org/doc/2.5.2/lib/os-file-dir.html -- http://mail.python.org/mailman/listinfo/python-list

Re: optimization

2008-12-01 Thread skip
Neal> I noticed in some profiling, that it seems that: Neal> def Func (): Neal> def something(): Neal> ... Neal> It appears that if Func is called many times, this nested func Neal> definition will cause significant overhead. Is this true? I Neal> guess I've b

optimization

2008-12-01 Thread Neal Becker
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 cause significant overhead. Is this true? I guess I've become accustomed to decent compilers performing reasonable transforma

Re: How to distribute a Python app together with its dependencies?

2008-12-01 Thread Alessio Pace
On 1 Dic, 15:21, Mike Driscoll <[EMAIL PROTECTED]> wrote: > On Nov 30, 6:22 am, Alessio Pace <[EMAIL PROTECTED]> wrote: > > > > > Hi, > > > I have to distribute a Python application which relies on an external > > library, and I'm not very fluent in this kind of stuff with Python (I > > come from t

  1   2   >