Re: end of print = lower productivity ?

2008-12-01 Thread Lawrence D'Oliveiro
In message <[EMAIL PROTECTED]>, [EMAIL PROTECTED] wrote: > Now the print statement disappeared, and I have to write print("f") > instead. These parentheses not only take time to write, they also make > me think twice about using print for debugging purposes. Trouble is, print defaulted to printin

Re: Emacs vs. Eclipse vs. Vim

2008-12-01 Thread Lawrence D'Oliveiro
In message <[EMAIL PROTECTED]>, Roy Smith wrote: > Likewise for the source control (CVS, SVN, P4, etc) integrations [in > emacs]. Discovered that by accident today. Had a conflicted update in Subversion, fixed it up, saved the file, switched to a terminal window, typed "svn status", and lo and be

Re: pydoc enforcement.

2008-12-01 Thread Rafe
On Dec 1, 7:27 am, "[EMAIL PROTECTED]" <[EMAIL PROTECTED]> wrote: > I've been thinking about implementing (although no idea yet *HOW*) the > following features/extension for the python compile stage and would be > interested in any thoughts/comments/flames etc. > > Basically I'm interested adding a

Re: Emacs vs. Eclipse vs. Vim

2008-12-01 Thread Richard Riley
Roy Smith <[EMAIL PROTECTED]> writes: > Clay Hobbs <[EMAIL PROTECTED]> wrote: >> The first real text editor I used was Vim, which I actually started >> using about a year ago. I've looked at Emacs and it just looks >> confusing. > > I've been using emacs for so many years (um let's see, it's got

Re: Do more imported objects affect performance

2008-12-01 Thread Rafe
On Dec 1, 7:26 am, "Filip Gruszczyński" <[EMAIL PROTECTED]> wrote: > I have following question: if I use > > from module import * > > instead > > from module import Class > > am I affecting performance of my program? I believe, that all those > names must be stored somewhere, when they are imported

Re: Mathematica 7 compares to other languages

2008-12-01 Thread Almar Klein
I did some image processing in Mathematica once. It allocated 2GB of memory to do display a normal size image. The professor (not of my university) who gave the course I was following then, was a big Mathematica fan. He also used lots of sentences containing "quite striking", "highly efficient", "e

Re: tkinter question

2008-12-01 Thread [EMAIL PROTECTED]
On Oct 26, 7:02 am, "Chuckk Hubbard" <[EMAIL PROTECTED]> wrote: > Hello. > How about this?  I changed the if statements so the coordinates are > always updated, but only changed if within the right limits, otherwise > updated to the existing value.  Now if you drag outside the limits of > one dimen

Re: tkinter question

2008-12-01 Thread [EMAIL PROTECTED]
On Oct 26, 7:02 am, "Chuckk Hubbard" <[EMAIL PROTECTED]> wrote: > Hello. > How about this?  I changed the if statements so the coordinates are > always updated, but only changed if within the right limits, otherwise > updated to the existing value.  Now if you drag outside the limits of > one dimen

Re: pydoc enforcement.

2008-12-01 Thread Marc 'BlackJack' Rintsch
On Sun, 30 Nov 2008 16:27:07 -0800, [EMAIL PROTECTED] wrote: > Basically I'm interested adding a check to see if: > 1) pydoc's are written for every function/method. Pylint warns for missing docstrings. > 2) There are entries for each parameter, defined by some predetermined syntax.

Re: Python surpasses Perl in popularity?

2008-12-01 Thread Casper H . S . Dik
Stephane CHAZELAS <[EMAIL PROTECTED]> writes: >It's true it was vague and misleading, >/bin is not the standard place to look for "sh" as far as the >"POSIX" standard is concerned. That doesn't mean that standard >commands (POSIX or not) cannot be found in /bin. But /bin/sh has >been made a non-s

Re: Project structure - Best practices

2008-12-01 Thread Rafe
On Nov 30, 11:43 pm, "Filip Gruszczyński" <[EMAIL PROTECTED]> wrote: > This is first time that I am building python application that is > larger than a single module and I would like to do it right. I google > it a bit, finding some stuff about not using src directory (which I > have seen so many t

Re: noob needs help

2008-12-01 Thread Rafe
On Dec 1, 12:50 am, toveysnake <[EMAIL PROTECTED]> wrote: > I decided that I want to learn python, and have no previous > programming experience. I was reading the guide A byte of python and > got to the part where you create and run the program helloworld.py I > used kate to create this program an

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

2008-12-01 Thread BlueBird
Alessio Pace 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 the Java world where I would have used the Maven build tool > to create an "assembly with dependencies" of all it

Re: Emacs vs. Eclipse vs. Vim

2008-12-01 Thread Duncan Booth
Roy Smith <[EMAIL PROTECTED]> wrote: > Clay Hobbs <[EMAIL PROTECTED]> wrote: >> The first real text editor I used was Vim, which I actually started >> using about a year ago. I've looked at Emacs and it just looks >> confusing. > > I've been using emacs for so many years (um let's see, it's got

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

2008-12-01 Thread cptnwillard
Don't feed the troll. -- http://mail.python.org/mailman/listinfo/python-list

Re: Python surpasses Perl in popularity?

2008-12-01 Thread Andre Majorel
On 2008-11-30, Stephane Chazelas <[EMAIL PROTECTED]> wrote: > 2008-11-30, 06:11(+00), Tam Ha: >> Stephane CHAZELAS wrote: >>> There's a common confusion in this in the nature of /bin/sh. >>> There's no standard (neither POSIX nor Unix) that specifies that >>> /bin/sh should be any variant of the Bo

Re: Mathematica 7 compares to other languages

2008-12-01 Thread budden
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. It does not allow to track the source as SLIME does. This feature a

Re: Best way to dynamically get an attribute from a module from within the same module

2008-12-01 Thread Rafe
> 3) using the bare name: > whatever > 1) and 2) are useful when the desired name is variable, not a constant like > "whatever". I thought that went without saying. > > I have been using #1 for two reasons. First, I will never run this > > module directly, so __name__ will always be the module

Re: Is there any library that can convert RGB colors to ANSI colors?

2008-12-01 Thread Peter Otten
ZelluX wrote: > Convert RGB colors to the closest ANSI colors. For example, given RGB > color FF, it should print [31m. from functools import partial def to_rgb(color): return (color >> 16) & 0xFF, (color >> 8) & 0xFF, color & 0xFF target_colors = { 0x00: "\33[30m", 0xFF

What about a decorator module version 3.0?

2008-12-01 Thread Michele Simionato
I am thinking about releasing a new version of the decorator module, completely rewritten from scratch. The new implementation takes half the lines of the original one and it is much more general, so I like it more. However, there is an issue of compatibility with the past and I am asking here for

Re: distinct fcntl flags for stdin and stdout

2008-12-01 Thread Nick Craig-Wood
mbuna <[EMAIL PROTECTED]> wrote: > Hello, > when I set non blocking flag with fcntl on sys.stdin, then sys.stdout > turns into non blocking mode too. Is it normal behaviour? How can I > turn stdin into non blocking mode but not stdout? Thanks. > > This is a quick program that shows the (my?)

Re: Do more imported objects affect performance

2008-12-01 Thread Nick Craig-Wood
Rafe <[EMAIL PROTECTED]> wrote: > On Dec 1, 7:26?am, "Filip Gruszczy?ski" <[EMAIL PROTECTED]> wrote: > > I have following question: if I use > > > > from module import * > > > > instead > > > > from module import Class > > > > am I affecting performance of my program? I believe, that all those > >

Re: What about a decorator module version 3.0?

2008-12-01 Thread Eduardo O. Padoan
On Mon, Dec 1, 2008 at 9:16 AM, Michele Simionato <[EMAIL PROTECTED]> wrote: > I am thinking about releasing a new version of the decorator module, > [...] Just FYI, the module being discussed here is http://www.phyast.pitt.edu/~micheles/python/documentation.html I dont use it myself, but given h

Re: Best way to dynamically get an attribute from a module from within the same module

2008-12-01 Thread Jeremy Sanders
Rafe wrote: > I guess, in the end, I'd use getattr() because it feels more pythonic, > and more basic. I got pretty deep in to learning python before I had > to learn what the globals() dict could do for me. Why not store your individual classes inside another class or keep them in a dict? That w

Re: Python surpasses Perl in popularity?

2008-12-01 Thread Stephane Chazelas
2008-12-01, 08:51(+00), Casper H.S Dik: > Stephane CHAZELAS <[EMAIL PROTECTED]> writes: > >>It's true it was vague and misleading, > >>/bin is not the standard place to look for "sh" as far as the >>"POSIX" standard is concerned. That doesn't mean that standard >>commands (POSIX or not) cannot be

finding the difference between the two version of the python program...

2008-12-01 Thread Piyush Anonymous
is there a tool which, given two version of programs, finds the difference like set of classes added, deleted and modified? assuming the python program is written in oops way. -- http://mail.python.org/mailman/listinfo/python-list

Re: Emacs vs. Eclipse vs. Vim

2008-12-01 Thread Nick Craig-Wood
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? IMHO I'd want these features * Keyboard macros * Regular expression search and replace * Integration with

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

2008-12-01 Thread Mikko Viitamäki
On Sun, Nov 30, 2008 at 2:22 PM, 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 the Java world where I would have used the Maven build tool >

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

2008-12-01 Thread Alessio Pace
On 1 Dic, 10:37, BlueBird <[EMAIL PROTECTED]> wrote: > Alessio Pace 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 the Java world where I would have used the Maven bui

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

2008-12-01 Thread Alessio Pace
On 1 Dic, 10:37, BlueBird <[EMAIL PROTECTED]> wrote: > Alessio Pace 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 the Java world where I would have used the Maven bui

How to instantiate in a lazy way?

2008-12-01 Thread Slaunger
Hi comp.lang.python, I am a novice Python programmer working on a project where I deal with large binary files (>50 GB each) consisting of a series of variable sized data packets. Each packet consists of a small header with size and other information and a much large payload containing the actual

Re: Emacs vs. Eclipse vs. Vim

2008-12-01 Thread Roy Smith
In article <[EMAIL PROTECTED]>, Richard Riley <[EMAIL PROTECTED]> wrote: > Roy Smith <[EMAIL PROTECTED]> writes: > > > Clay Hobbs <[EMAIL PROTECTED]> wrote: > >> The first real text editor I used was Vim, which I actually started > >> using about a year ago. I've looked at Emacs and it just loo

SQLObject 0.9.8

2008-12-01 Thread Oleg Broytmann
Hello! I'm pleased to announce version 0.9.8, a minor bug fix release of SQLObject. What is SQLObject = SQLObject is an object-relational mapper. Your database tables are described as classes, and rows are instances of those classes. SQLObject is meant to be easy to use and qu

SQLObject 0.10.3

2008-12-01 Thread Oleg Broytmann
Hello! I'm pleased to announce version 0.10.3, a minor bugfix release of 0.10 branch of SQLObject. What is SQLObject = SQLObject is an object-relational mapper. Your database tables are described as classes, and rows are instances of those classes. SQLObject is meant to be eas

Re: Emacs vs. Eclipse vs. Vim

2008-12-01 Thread Roy Smith
In article <[EMAIL PROTECTED]>, Nick Craig-Wood <[EMAIL PROTECTED]> wrote: > * Syntax colouring (not essential) I never used to use syntax coloring, until somebody turned me on to it a couple of years ago. I was griping on a company mailing list that some previous code monkey had commented

Re: unicode and hashlib

2008-12-01 Thread Bryan Olson
Jeff H wrote: [...] So once I have character strings transformed internally to unicode objects, I should encode them in 'utf-8' before attempting to do things that guess at the proper way to encode them for further processing.(i.e. hashlib) It looks like hashlib in Python 3 will not even attemp

Python introspection and namespace weird question

2008-12-01 Thread Rayene Ben Rayana
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 access to its name pointers ? Thanks in advance, Rayene -- http://mail.python.org/mailman/list

Re: How to instantiate in a lazy way?

2008-12-01 Thread Slaunger
Slaunger wrote: > > class PayloadOnDemand(object): >     """ >     Behaves as a PayloadInstant object, but instantiation is faster >     as only the position of the payload in the file is stored > initially in the object. >     Only when acessing the initially non-existing data attribute >    

Re: Emacs vs. Eclipse vs. Vim

2008-12-01 Thread Richard Riley
Roy Smith <[EMAIL PROTECTED]> writes: > In article <[EMAIL PROTECTED]>, > Richard Riley <[EMAIL PROTECTED]> wrote: > >> Roy Smith <[EMAIL PROTECTED]> writes: >> >> > Clay Hobbs <[EMAIL PROTECTED]> wrote: >> >> The first real text editor I used was Vim, which I actually started >> >> using about

Re: pydoc enforcement.

2008-12-01 Thread Richard Riley
Marc 'BlackJack' Rintsch <[EMAIL PROTECTED]> writes: > On Sun, 30 Nov 2008 16:27:07 -0800, [EMAIL PROTECTED] wrote: > >> Basically I'm interested adding a check to see if: >> 1) pydoc's are written for every function/method. > > Pylint warns for missing docstrings. > >> 2) There are entries fo

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

2008-12-01 Thread Richard Riley
[EMAIL PROTECTED] writes: > Don't feed the troll. > Yet you did and made the previous post visible to me. If you don't want people to feed the troll, do not do it yourself. -- http://mail.python.org/mailman/listinfo/python-list

Re: Do more imported objects affect performance

2008-12-01 Thread Filip Gruszczyński
I see. Thanks for a really good explanation, I like to know, how to do things in the proper way :) 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 >> > >

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

2008-12-01 Thread Mike Driscoll
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 the Java world where I would have used the Maven build tool > to create an

11001, 'getaddrinfo failed' : Error in httplib but not in urllib2

2008-12-01 Thread RajNewbie
Hi all, I am trying to connect to localhost via httplib, but it fails. To check whether it is a firewall problem etc, I tried to connect via urllib2, but it went through fine. Could some one help me out on this? I cannot use urllib2 in the program because I have to send files via post t

Re: Emacs vs. Eclipse vs. Vim

2008-12-01 Thread Slaunger
On 29 Nov., 21:44, 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: 11001, 'getaddrinfo failed' : Error in httplib but not in urllib2

2008-12-01 Thread Tim Golden
RajNewbie wrote: Hi all, I am trying to connect to localhost via httplib, but it fails. To check whether it is a firewall problem etc, I tried to connect via urllib2, but it went through fine. Could some one help me out on this? I cannot use urllib2 in the program because I have to

setuptools - library dependencies

2008-12-01 Thread redbaron
I try to write setup.py which compiles C Extenstion (A). The problem is the fact, that my C Extension depends on another C lib (B). I've digged it setuptools sources a bit and found "libraries" option for setuptools.setup. Now it compile B library at build_clib stage and A Extenstion at build_ext

Re: finding the difference between the two version of the python program...

2008-12-01 Thread Tino Wildenhain
Hi, Piyush Anonymous wrote: is there a tool which, given two version of programs, finds the difference like set of classes added, deleted and modified? assuming the python program is written in oops way. diff for example can do this. There is also an difflib in python which you can use to ro

Re: How to instantiate in a lazy way?

2008-12-01 Thread Nick Craig-Wood
Slaunger <[EMAIL PROTECTED]> wrote: > Slaunger wrote: > > > > class PayloadOnDemand(object): > > ? ? """ > > ? ? Behaves as a PayloadInstant object, but instantiation is faster > > ? ? as only the position of the payload in the file is stored > > initially in the object. > > ? ? Only when aces

Re: 11001, 'getaddrinfo failed' : Error in httplib but not in urllib2

2008-12-01 Thread RajNewbie
On Dec 1, 7:43 pm, Tim Golden <[EMAIL PROTECTED]> wrote: > RajNewbie wrote: > > Hi all, > >     I am trying to connect to localhost via httplib, but it fails. > >     To check whether it is a firewall problem etc, I tried to connect > > via urllib2, but it went through fine. > >      Could some one

Re: Two attributes! Why?

2008-12-01 Thread Emanuele D'Arrigo
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 functions don't do any n

Re: end of print = lower productivity ?

2008-12-01 Thread Tim Chase
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 page 6, after many other popular text-editors have been mentioned

Re: Project structure - Best practices

2008-12-01 Thread Aahz
In article <[EMAIL PROTECTED]>, Rafe <[EMAIL PROTECTED]> wrote: > >...and I completely agree. I always use the standard import form >unless absolutely necessary. However, I use 'as' to shorten the path >to the last module. For example: import app.foo.bar as bar instance = bar.Class() Wh

Re: pydoc enforcement.

2008-12-01 Thread J. Cliff Dyer
On Sun, 2008-11-30 at 16:27 -0800, [EMAIL PROTECTED] wrote: > I've been thinking about implementing (although no idea yet *HOW*) the > following features/extension for the python compile stage and would be > interested in any thoughts/comments/flames etc. > > Basically I'm interested adding a che

Re: Python surpasses Perl in popularity?

2008-12-01 Thread Stephane Chazelas
2008-12-1, 10:16(+00), Andre Majorel: [...] >> Tru64: >> /bin/sh can behave either as a Bourne shell or a POSIX shell >> (ksh88) depending on the environment > > How does it decide ? argv[0] ? isatty (STDIN_FILENO) ? That was answered in another article with a quote of the sh man page on Tru64

Re: double import protection - how to ?

2008-12-01 Thread Helmut Jarausch
Peter Otten wrote: Helmut Jarausch wrote: Peter Otten wrote: Helmut Jarausch wrote: Then it's a problem with a problem with a webserver written in Python (Karrigell-3.0) and probably related to multi-threading (the statements in my module get definitely executed more than once). Maybe you

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

2008-12-01 Thread J. Cliff Dyer
On Sat, 2008-11-29 at 13:31 -0800, Lie wrote: > pdb and logging is too much for beginners, which most likely does not > yet understand the workings of the debugger and logger (and pdb's many > quirks). Don't forget that we're all beginners once. Python's learning > curve shouldn't raise with time,

Re: How to instantiate in a lazy way?

2008-12-01 Thread Slaunger
On 1 Dec., 16:30, Nick Craig-Wood <[EMAIL PROTECTED]> wrote: > > I wouldn't use __getattr__ unless you've got lots of attributes to > overload.  __getattr__ is a recipe for getting yourself into trouble > in my experience ;-) > > Just do it like this... > > class PayloadOnDemand(object): >       de

Import of egg packages installed with easy_install

2008-12-01 Thread Alexey Vlasov
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-install.pth -rw-r--r-- 1 134573 Nov 29

python 2.5.2 or Python 2.6 compilation problem on AIX 5.3

2008-12-01 Thread [EMAIL PROTECTED]
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 -O3 -Wall - Wstrict-prototype

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

2008-12-01 Thread Fernando H. Sanches
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. Why programmers stilll can't have special keyboards with parens keys that doesn't need pre

Re: HTML File Parsing

2008-12-01 Thread worldgnat
On Oct 28, 3:18 pm, Stefan Behnel <[EMAIL PROTECTED]> wrote: > Felipe De Bene wrote: > > I'm having problems parsing an HTML file with the following syntax : > > > > >     User ID > >     Name > BGCOLOR='#c0c0c0'>Date > > and so on > > > whenever I feed the parser with such file I get the erro

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

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: 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

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

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

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

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: 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: 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: 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: 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: 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

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 --

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

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

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

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: 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: 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: 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: 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: 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: 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: 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: 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

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: 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

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: 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

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: 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

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

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: 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

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 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(*

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: 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

  1   2   >