Re: end of print = lower productivity ?

2008-11-25 Thread George Sakkis
On Nov 25, 5:03 pm, Paul Rubin wrote: > [EMAIL PROTECTED] writes: > > > BUT you now can do > > > >>> p = print > > > >>> p("f") > > All right. Let's talk about that. > > > When I write "print", it is both effortless and instantaneous : my > > hands do not move, a wave goe

Re: Python surpasses Perl in popularity?

2008-11-25 Thread Jorgen Grahn
On Mon, 24 Nov 2008 20:25:51 -0500, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: > Quoting Xah Lee <[EMAIL PROTECTED]>: > >> herald: Python surpasses Perl in popularity! >> >> According to >> ?TIOBE Programming Community Index for November 2008? at >> http://www.tiobe.com/content/paperinfo/tpci/in

Re: segfault calling SSE enabled library from ctypes

2008-11-25 Thread Olivier Grisel
Replying to myself: haypo found the origin of the problem. Apparently this problem stems from a GCC bug [1] (that should be fixed on x86 as of version 4.4). The bug is that GCC does not always ensure the stack to be 16 bytes aligned hence the "__m128 myvector" local variable in the previous code

Re: Reg Expression - Get position of >

2008-11-25 Thread r
On Nov 25, 4:33 pm, Jorgen Grahn <[EMAIL PROTECTED]> wrote: > On Tue, 25 Nov 2008 12:41:53 -0800 (PST), r <[EMAIL PROTECTED]> wrote: > > On Nov 25, 10:36 am, M_H <[EMAIL PROTECTED]> wrote: > >> Hey, > > >> I need the position of the last char > > > >> Let's say I have a string > >> mystr =  

Re: Python surpasses Perl in popularity?

2008-11-25 Thread Roy Smith
In article <[EMAIL PROTECTED]>, Jorgen Grahn <[EMAIL PROTECTED]> wrote: > Hard to take a popularity index seriously when Logo is at #19 and > Bourne shell at #32 ... and then they suggest that their readers can > use it "to make a strategic decision about what programming language > should be ad

checking for mis-spelled variable names / function names

2008-11-25 Thread News123
Hi, Let's imagine following code def specialfunc(): print "very special function" name= getuserinput() if name == 'one_name_out_of_a_million': print "Hey your name '%s' is really rare" % namee specialfunk() my python script could survive thousands of runs before falling

Re: checking for mis-spelled variable names / function names

2008-11-25 Thread Chris Rebert
On Tue, Nov 25, 2008 at 3:16 PM, News123 <[EMAIL PROTECTED]> wrote: > Hi, > > Let's imagine following code > > def specialfunc(): >print "very special function" > > name= getuserinput() > if name == 'one_name_out_of_a_million': >print "Hey your name '%s' is really rare" % namee >

PyMei - Python Media Interface

2008-11-25 Thread Jørgen P. Tjernø
Hi! python-list users: I'm not a subscriber, so please send all replies off-list as well! (CC or To me) This is self-advertisement; I've just publised my first "official" python+pygame project, and I'd love it if people looked at it. I've recently published my inhouse Python Media Center ap

Python Script to search by Date

2008-11-25 Thread gamersunit
What I'm trying to do is decompress a bunch of files depending on the date/time specified. So, we have full backups created every Sunday and transaction backups every hour afterwards. I have everything compressed at an hourly basis. Now, what I'm trying to create is a way to specify a date and t

Thread limit and thread stack size

2008-11-25 Thread blair . bethwaite
Hi All, We've been debugging a distributed app that uses a database server to accept connections and then queries from remote agents. Once a connection is established it is passed off to a thread, along with a local db connection from a pool, to handle the IO. We get to a point that seems to be a

Re: checking for mis-spelled variable names / function names

2008-11-25 Thread John Machin
On Nov 26, 10:16 am, News123 <[EMAIL PROTECTED]> wrote: > Hi, > > Let's imagine following code > > def specialfunc(): >         print "very special function" > > name= getuserinput() > if name == 'one_name_out_of_a_million': >         print "Hey your name '%s' is really rare" % namee >         spec

Re: Python Script to search by Date

2008-11-25 Thread Albert Hopkins
On Tue, 2008-11-25 at 16:10 -0800, [EMAIL PROTECTED] wrote: > What I'm trying to do is decompress a bunch of files depending on the > date/time specified. > > So, we have full backups created every Sunday and transaction backups > every hour afterwards. > > I have everything compressed at an hour

Re: How to get a directory file descriptor?

2008-11-25 Thread alex23
On Nov 26, 12:31 am, "D'Arcy J.M. Cain" <[EMAIL PROTECTED]> wrote: > Is this what you want? > > ofiles = [open(x) for x in os.listdir(os.getcwd())] 'open' returns a "file object", whereas the OP is after "file descriptors", which are returned by 'os.open'. -- http://mail.python.org/mailman/listin

Re: end of print = lower productivity ?

2008-11-25 Thread alex23
On Nov 26, 1:52 am, [EMAIL PROTECTED] wrote: > I hope there was a missing smiley in that post.  If a couple extra parens > destroys your debugging productivity I suspect you need a fresh approach to > the task. I'm always inclined to suggest 6 months working in a role that requires hard manual lab

Re: recommended __future__ imports for 2.5?

2008-11-25 Thread greg
Dennis Lee Bieber wrote: I'm still waiting to hear that from __past__ import division Well, *I'm* waiting for the time machine technology to be declassified, so we'll be able to do from __future__ import * and get all the features that are ever going to be added to Python!

Re: Instance attributes vs method arguments

2008-11-25 Thread John O'Hagan
On Tue, 25 Nov 2008, Rafe wrote: > On Nov 25, 5:48 pm, John O'Hagan <[EMAIL PROTECTED]> wrote: > > On Tue, 25 Nov 2008, Marc 'BlackJack' Rintsch wrote: > > > On Tue, 25 Nov 2008 07:27:41 +, John O'Hagan wrote: > > > > Is it better to do this: > > > > > > > > class Class_a(): > > > >       def _

Reflectiong capabilityof Python

2008-11-25 Thread goatold
Can Python create object by name? Like clsName = "ClassA" aObj = createObjectByName(clsName) -- http://mail.python.org/mailman/listinfo/python-list

Re: Instance attributes vs method arguments

2008-11-25 Thread George Sakkis
On Nov 25, 8:49 pm, John O'Hagan <[EMAIL PROTECTED]> wrote: > is there an > difference in efficiency (for large enough number of methods and arguments) > between > > a) passing all arguments to __init__() and accessing them via self within > individual methods: > > class = Class(all_class_args) >

Re: Python 3.0 - is this true?

2008-11-25 Thread Aahz
In article <[EMAIL PROTECTED]>, Duncan Grisby <[EMAIL PROTECTED]> wrote: >In article <[EMAIL PROTECTED]>, Aahz <[EMAIL PROTECTED]> wrote: >>In article <[EMAIL PROTECTED]>, >>Duncan Grisby <[EMAIL PROTECTED]> wrote: >>> >>>For my application, Python 3's comparison behaviour is a backwards >>>step.

Re: Reflectiong capabilityof Python

2008-11-25 Thread MRAB
[EMAIL PROTECTED] wrote: Can Python create object by name? Like clsName = "ClassA" aObj = createObjectByName(clsName) > >>> # Create the class. >>> class MyClass: pass >>> # The class is in the globals() dict. >>> globals()["MyClass"] >>> # And also the locals() dict. >>> locals()["MyC

Re: Instance attributes vs method arguments

2008-11-25 Thread Ben Finney
John O'Hagan <[EMAIL PROTECTED]> writes: > insofar as one is only interested in accessing methods, is there an > difference in efficiency (for large enough number of methods and > arguments) between > > a) passing all arguments to __init__() and accessing them via self > within individual methods

Re: Instance attributes vs method arguments

2008-11-25 Thread Steven D'Aprano
On Tue, 25 Nov 2008 10:21:18 +0100, M.-A. Lemburg wrote: > It is always good practice to provide default values for instance > variables in the class definition, both to enhance readability and to > allow adding documentation regarding the variables, e.g. > > class Class_a: > ># Foo bar >

Re: Python 3.0 - is this true?

2008-11-25 Thread Steven D'Aprano
On Mon, 24 Nov 2008 17:33:50 +, Tim Rowe wrote: > 2008/11/24 Aahz <[EMAIL PROTECTED]>: > >> (I'll agree that from some perspectives the new behavior of None is a >> wart but I think that in the end I agree with people who say that >> preventing None from being sorted except intentionally will

Re: Python 3.0 - is this true?

2008-11-25 Thread Steven D'Aprano
On Mon, 24 Nov 2008 10:42:41 +, Duncan Grisby wrote: > Again, this is just an example. As I say, in the real application, the > data has come from a dynamically-typed database. There's no easy way to > coerce all the items to the same type, because the application doesn't > know up-front what

Re: Python surpasses Perl in popularity?

2008-11-25 Thread david . lyon
Quoting John Machin <[EMAIL PROTECTED]>: pyExcelerator is abandonware. Check out xlwt (a fork of pyExcelerator) at http://pypi.python.org/pypi/xlwt Thanks John. That is very helpful. I will move to that product.. -- http://mail.python.org/mailman/listinfo/python-list

Re: Python surpasses Perl in popularity?

2008-11-25 Thread david . lyon
Quoting Lawrence D'Oliveiro <[EMAIL PROTECTED]>: Perl is the FORTRAN of scripting languages. Python is in some ways like Pascal. Java is like COBOL. C? Who knows... Your memory goes way back... haha -- http://mail.python.org/mailman/listinfo/python-list

Re: How to get a directory file descriptor?

2008-11-25 Thread Cong Ma
alex23 wrote: > On Nov 26, 12:31 am, "D'Arcy J.M. Cain" <[EMAIL PROTECTED]> wrote: >> Is this what you want? >> >> ofiles = [open(x) for x in os.listdir(os.getcwd())] > > 'open' returns a "file object", whereas the OP is after "file > descriptors", which are returned by 'os.open'. > > -- > http:/

Re: Instance attributes vs method arguments

2008-11-25 Thread John O'Hagan
On Wed, 26 Nov 2008, Ben Finney wrote: > John O'Hagan <[EMAIL PROTECTED]> writes: > > insofar as one is only interested in accessing methods, is there an > > difference in efficiency (for large enough number of methods and > > arguments) between > > > > a) passing all arguments to __init__() and ac

Re: How to get a directory file descriptor?

2008-11-25 Thread alex23
On Nov 26, 1:34 pm, Cong Ma <[EMAIL PROTECTED]> wrote: > So if I can't seem to get directory file descriptors, the only way to use > os.fchdir() in Python is to embed Python in C code? This doesn't work for you? import os dirfd = os.open("directory-name", os.O_DIRECTORY) os.fchdir(dirfd) Are you

Re: Reflectiong capabilityof Python

2008-11-25 Thread Rafe
On Nov 26, 9:18 am, [EMAIL PROTECTED] wrote: > Can Python create object by name? Like > clsName = "ClassA" > aObj = createObjectByName(clsName) if you are talking about creating an objcet dynamically and naming the CLASS name at runtime, use: >>> obj = type("ClassA", object, {}) # The base class i

Re: How to get a directory file descriptor?

2008-11-25 Thread greg
alex23 wrote: import os dirfd = os.open("directory-name", os.O_DIRECTORY) os.fchdir(dirfd) os.O_DIRECTORY must be fairly new -- it doesn't exist in my 2.5 installation. But os.O_RDONLY seems to work just as well for this purpose. -- Greg -- http://mail.python.org/mailman/listinfo/python-list

Re: How to get a directory file descriptor?

2008-11-25 Thread alex23
On Nov 26, 3:26 pm, greg <[EMAIL PROTECTED]> wrote: > os.O_DIRECTORY must be fairly new -- it doesn't exist > in my 2.5 installation. But os.O_RDONLY seems to work > just as well for this purpose. Which OS are you using? Python 2.5.2 (r252:60911, Jul 31 2008, 17:28:52) [GCC 4.2.3 (Ubuntu 4.2.3-2u

what's so difficult about namespace?

2008-11-25 Thread Xah Lee
comp.lang.lisp,comp.lang.functional,comp.lang.perl.misc,comp.lang.python,comp.lang.java.programmer 2008-11-25 Recently, Steve Yegge implemented Javascript in Emacs lisp, and compared the 2 languages. http://steve-yegge.blogspot.com/ http://code.google.com/p/ejacs/ One of his point is about emac

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

2008-11-25 Thread Barak, Ron
Hi Pythonistas, I read diaz's comments with interest, but - in my current configuration, I'm unable to use pdb. I'm developing on cygwin and use wxPython. Consequently, I cannot use native cygwin Python, but my Python is actually the Windows XP Python (i.e., /cygdrive/c/Python25/python.exe). T

Re: what's so difficult about namespace?

2008-11-25 Thread Gene
On Nov 26, 1:29 am, Xah Lee <[EMAIL PROTECTED]> wrote: > comp.lang.lisp,comp.lang.functional,comp.lang.perl.misc,comp.lang.python,co­mp.lang.java.programmer > > 2008-11-25 > > Recently, Steve Yegge implemented Javascript in Emacs lisp, and > compared the 2 languages. > > http://steve-yegge.blogspot

Re: what's so difficult about namespace?

2008-11-25 Thread Glenn Linderman
On approximately 11/25/2008 11:01 PM, came the following characters from the keyboard of Gene: On Nov 26, 1:29 am, Xah Lee <[EMAIL PROTECTED]> wrote: comp.lang.lisp,comp.lang.functional,comp.lang.perl.misc,comp.lang.python,co­mp.lang.java.programmer 2008-11-25 Recently, Steve Yegge implemen

<    1   2