Re: comtypes 0.6.2 released

2010-01-18 Thread Thomas Heller
Am 16.01.2010 17:22, schrieb Thomas Heller: I'm happy to announce the 0.6.2 comtypes release: http://sourceforge.net/projects/comtypes/ I forgot to mention what comtypes is, sorry for that: comtypes **comtypes** is a lightweight Python COM package, based on the ctypes FFI library,

execnet-1.0.3: safer ssh-interpreter termination

2010-01-18 Thread holger krekel
execnet is a small and stable pure-python library for working with local or remote clusters of Python interpreters, with ease. It supports seamless instantiation of remote interpreters through the 'ssh' command line binary. The 1.0.3 release is a minor backward compatible release with these

Re: More version woes

2010-01-18 Thread Steven D'Aprano
On Sun, 17 Jan 2010 23:15:28 -0800, Jive Dadson wrote: Sorry. That deprecation warning has nothing to do with the slowness. It does torque my jaw, however. Komodo costs money, and Python 2.6 broke it. @#^!!! (Again.) So, the new question is, does anyone know how to make Komodo 3.5 run at

Re: More version woes

2010-01-18 Thread Jive Dadson
Steven D'Aprano wrote: On Sun, 17 Jan 2010 23:15:28 -0800, Jive Dadson wrote: Sorry. That deprecation warning has nothing to do with the slowness. It does torque my jaw, however. Komodo costs money, and Python 2.6 broke it. @#^!!! (Again.) So, the new question is, does anyone know how to

Re: C-API: Get scope in function

2010-01-18 Thread moerchendiser2k3
Perfect, this helped me a lot, thx! :) -- http://mail.python.org/mailman/listinfo/python-list

Re: How to install local module other than in site-packages?

2010-01-18 Thread Jive Dadson
Thankee. I had just figgered that out. I wrote everything up in a message titled The answer, but I accidentally created a new thread with it. I'll post it in this thread. -- http://mail.python.org/mailman/listinfo/python-list

Re: More version woes

2010-01-18 Thread Steven D'Aprano
On Mon, 18 Jan 2010 00:08:35 -0800, Jive Dadson wrote: I suspect that they'll probably tell you that since the latest version of Komodo is 5.2, and you're using 3.5, you should stop using a version that is over four years old and almost certainly not supported. Yep. They want $295, and

Re: enhancing 'list'

2010-01-18 Thread Peter Otten
samwyse wrote: Lately, I've slinging around a lot of lists, and there are some simple things I'd like to do that just aren't there. s.count(x[, cmp[, key]]) - return number of i‘s for which s[i] == x. 'cmp' specifies a custom comparison function of two arguments, as in '.sort'. 'key'

LAST CALL FOR PAPERS: TOOLS EUROPE 2010

2010-01-18 Thread Lorenzo Bettini
== LAST CALL FOR PAPERS (Deadline: January 22, 2010) TOOLS EUROPE 2010 48th International Conference Objects, Models,

ctypes: nested structures and pointers

2010-01-18 Thread Gabriele Modena
Hi all, I am trying to learn ctypes and I am facing some problems In wrapping two nested structs. --- begin C code struct dev_callbacks;// Prototype the callback struct typedef struct { const struct dev_callbacks* pdc; char acName[DEVICE_NAME_LENGTH]; chip_type ct;

Generic Python Benchmark suite?

2010-01-18 Thread Anand Vaidya
Is there a generic python benchmark suite in active development? I am looking forward to comparing some code on various python implementations (primarily CPython 2.x, CPython 3.x, UnladenSwallow, Psyco). I am happy with something that gives me a relative number eg: ULS is 30% faster than CPy2.x

Re: substitution

2010-01-18 Thread superpollo
superpollo ha scritto: hi. what is the most pythonic way to substitute substrings? eg: i want to apply: foo -- bar baz -- quux quuux -- foo so that: fooxxxbazyyyquuux -- barxxxquuxyyyfoo bye i explain better: say the subs are: quuux -- foo foo -- bar baz -- quux then i cannot apply

substitution

2010-01-18 Thread superpollo
hi. what is the most pythonic way to substitute substrings? eg: i want to apply: foo -- bar baz -- quux quuux -- foo so that: fooxxxbazyyyquuux -- barxxxquuxyyyfoo bye -- http://mail.python.org/mailman/listinfo/python-list

Re: More version woes

2010-01-18 Thread Diez B. Roggisch
Yep. They want $295, and I cannot justify that for personal use. I'll be looking for a cheaper one. There are bazillion discussions in this NG about IDEs and editors. GIYF. Diez -- http://mail.python.org/mailman/listinfo/python-list

Re: Generic Python Benchmark suite?

2010-01-18 Thread Stefan Behnel
Anand Vaidya, 18.01.2010 10:58: Is there a generic python benchmark suite in active development? [...] PS: I think a benchmark should cover file / network, database I/O, data structures (dict, list etc), object creation/manipulation, numbers, measure looping inefficiencies, effects of

Re: substitution

2010-01-18 Thread Peter Otten
superpollo wrote: superpollo ha scritto: hi. what is the most pythonic way to substitute substrings? eg: i want to apply: foo -- bar baz -- quux quuux -- foo so that: fooxxxbazyyyquuux -- barxxxquuxyyyfoo bye i explain better: say the subs are: quuux -- foo foo --

Re: maintain 2 versions of python on my computer

2010-01-18 Thread Gertjan Klein
Duncan Booth wrote: @(C:\Python26\Python -x %~f0 %* || pause) goto:EOF import sys print sys.version # raise RuntimeError # uncomment to trigger the 'pause' That is nice! This should probably be in the documentation, here:

Re: The answer

2010-01-18 Thread Dave Angel
Jive Dadson wrote: div class=moz-text-flowed style=font-family: -moz-fixedalex23 wrote: Actually, if you're using Python 2.6+/3.x, you can effectively skip steps 1-5, as these versions now support user site-packages. Rather than create a Module folder and modify your PYTHONPATH, add (if

Re: Is python not good enough?

2010-01-18 Thread Phlip
On Jan 12, 7:09 am, ikuta liu ikut...@gmail.com wrote: Go language try to merge low level, hight level and browser language. Go uses := for assignment. This means, to appease the self-righteous indignation of the math professor who would claim = should mean equality... ...you gotta type a

Re: substitution

2010-01-18 Thread Steven D'Aprano
On Mon, 18 Jan 2010 11:15:37 +0100, superpollo wrote: hi. what is the most pythonic way to substitute substrings? eg: i want to apply: foo -- bar baz -- quux quuux -- foo so that: fooxxxbazyyyquuux -- barxxxquuxyyyfoo For simple cases, just use replace: s =

Re: Is python not good enough?

2010-01-18 Thread Tim Chase
Phlip wrote: On Jan 12, 7:09 am, ikuta liu ikut...@gmail.com wrote: Go language try to merge low level, hight level and browser language. Go uses := for assignment. This means, to appease the self-righteous indignation of the math professor who would claim = should mean equality... ...you

Re: enhancing 'list'

2010-01-18 Thread samwyse
On Jan 18, 1:56 am, Terry Reedy tjre...@udel.edu wrote: On 1/17/2010 5:37 PM, samwyse wrote: Consider this a wish list.  I know I'm unlikely to get any of these in time for for my birthday, but still I felt the need to toss it out and see what happens. Lately, I've slinging around a

Re: enhancing 'list'

2010-01-18 Thread samwyse
On Jan 18, 3:06 am, Peter Otten __pete...@web.de wrote: samwyse wrote: Lately, I've slinging around a lot of lists, and there are some simple things I'd like to do that just aren't there. s.count(x[, cmp[, key]]) - return number of i‘s for which s[i] == x.  'cmp' specifies a custom

Re: enhancing 'list'

2010-01-18 Thread samwyse
On Jan 17, 11:30 pm, Asun Friere afri...@yahoo.co.uk wrote: On Jan 18, 9:37 am, samwyse samw...@gmail.com wrote: Consider this a wish list.  I know I'm unlikely to get any of these in time for for my birthday, but still I felt the need to toss it out and see what happens. Lately, I've

Re: enhancing 'list'

2010-01-18 Thread Peter Otten
samwyse wrote: On Jan 18, 3:06 am, Peter Otten __pete...@web.de wrote: samwyse wrote: Lately, I've slinging around a lot of lists, and there are some simple things I'd like to do that just aren't there. s.count(x[, cmp[, key]]) - return number of i‘s for which s[i] == x. 'cmp'

Re: The answer

2010-01-18 Thread samwyse
On Jan 17, 8:30 pm, Jive Dadson notonthe...@noisp.com wrote: Okay, with your help I've figured it out.  Instructions are below, but read the caveat by Ben Fenny in this thread.  All this stuff is good for one default version of Python only.  The PYTHONPATH described below, for example, cannot

Re: substitution

2010-01-18 Thread Anthra Norell
superpollo wrote: hi. what is the most pythonic way to substitute substrings? eg: i want to apply: foo -- bar baz -- quux quuux -- foo so that: fooxxxbazyyyquuux -- barxxxquuxyyyfoo bye Try the code below the dotted line. It does any number of substitutions and handles overlaps

Re: substitution

2010-01-18 Thread Iain King
On Jan 18, 10:21 am, superpollo ute...@esempio.net wrote: superpollo ha scritto: hi. what is the most pythonic way to substitute substrings? eg: i want to apply: foo -- bar baz -- quux quuux -- foo so that: fooxxxbazyyyquuux -- barxxxquuxyyyfoo bye i explain better:

Re: enhancing 'list'

2010-01-18 Thread samwyse
On Jan 18, 6:20 am, Peter Otten __pete...@web.de wrote: Note that the cmp() builtin and the cmp parameter for list.sort() are gone in Python 3. I've got Python 3 installed, and am using it for most new development. In this case case, however, I'm writing for the Google App Engine, which is

Re: enhancing 'list'

2010-01-18 Thread Stefan Behnel
samwyse, 18.01.2010 13:49: Curiously, no matter how I order my PATH, the wrong version seems to appear first more than half the time! I'm seriously considering renaming all my Python 3 code to use a .py3 file extension. You should be able to start the interpreter as python3.1 to be sure.

Parse a log file

2010-01-18 Thread kak...@gmail.com
Hello to all! I want to parse a log file with the following format for example: TIMESTAMPEOperation FileName Bytes 12/Jan/2010:16:04:59 +0200 EXISTS sample3.3gp 37151 12/Jan/2010:16:04:59 +0200 EXISTSsample3.3gp 37151 12/Jan/2010:16:04:59 +0200

Re: Is python not good enough?

2010-01-18 Thread David Cournapeau
On Mon, Jan 18, 2010 at 8:03 PM, Phlip phlip2...@gmail.com wrote: This means, to appease the self-righteous indignation of the math professor who would claim = should mean equality... Much more likely, this is part of the stated goal of making go very easy to analyse (to build tools and so

Re: rstring vs Rstring

2010-01-18 Thread Colin W.
On 17-Jan-10 18:27 PM, Steven D'Aprano wrote: On Sun, 17 Jan 2010 11:13:48 -0500, Roy Smith wrote: In articlehiv4c6$5l...@theodyn.ncf.ca, Colin W.cjwilliam...@gmail.com wrote: On 17-Jan-10 02:16 AM, Terry Reedy wrote: On 1/17/2010 1:55 AM, Brendan Miller wrote: Is there any difference

Re: Parse a log file

2010-01-18 Thread samwyse
On Jan 18, 6:52 am, kak...@gmail.com kak...@gmail.com wrote: Hello to all! I want to parse a log file with the following format for example:               TIMESTAMPE            Operation     FileName Bytes 12/Jan/2010:16:04:59 +0200   EXISTS       sample3.3gp   37151 12/Jan/2010:16:04:59

Re: substitution

2010-01-18 Thread Iain King
On Jan 18, 12:41 pm, Iain King iaink...@gmail.com wrote: On Jan 18, 10:21 am, superpollo ute...@esempio.net wrote: superpollo ha scritto: hi. what is the most pythonic way to substitute substrings? eg: i want to apply: foo -- bar baz -- quux quuux -- foo so that:

Re: substitution

2010-01-18 Thread Peter Otten
Iain King wrote: Not sure if it's the most pythonic, but I'd probably do it like this: def token_replace(string, subs): subs = dict(subs) tokens = {} for i, sub in enumerate(subs): tokens[sub] = i tokens[i] = sub current =

Re: substitution

2010-01-18 Thread superpollo
it looked simpler when i posted, but i realize that the problem is non trivial. thanks to everybody. i guess that the algorithm would be easier if it was known in advance that the string to substitute must have some specific property, say: 1) they all must start with XYZ 2) they all have

Re: Is python not good enough?

2010-01-18 Thread Anh Hai Trinh
On Jan 18, 6:03 pm, Phlip phlip2...@gmail.com wrote: On Jan 12, 7:09 am, ikuta liu ikut...@gmail.com wrote: Go language try to merge low level, hight level and browser language. Go uses := for assignment. Except that it doesn't. := is a declaration. s := foo is short for var s string =

Re: Changing var names

2010-01-18 Thread Jean-Michel Pichavant
Victor Subervi wrote: On Fri, Jan 15, 2010 at 3:15 PM, Adam Tauno Williams awill...@opengroupware.us mailto:awill...@opengroupware.us wrote: On Fri, 2010-01-15 at 13:27 -0400, Victor Subervi wrote: Hi; Well it took me *less than a day* to fix the following problems: -- bare

Re: Inheriting methods but over-riding docstrings

2010-01-18 Thread Gabriel Genellina
En Sun, 17 Jan 2010 23:23:45 -0300, Steve Holden st...@holdenweb.com escribió: Gabriel Genellina wrote: Methods don't have docstrings; functions do. So one has to clone the function to set a new docstring. On behalf of all methods I would like to say We demand the right to docstrings.

substitution

2010-01-18 Thread Adi Eyal
From: superpollo ute...@esempio.net To: Date: Mon, 18 Jan 2010 11:15:37 +0100 Subject: substitution hi. what is the most pythonic way to substitute substrings? eg: i want to apply: foo -- bar baz -- quux quuux -- foo so that: fooxxxbazyyyquuux -- barxxxquuxyyyfoo bye Using

Re: substitution

2010-01-18 Thread Iain King
On Jan 18, 2:17 pm, Adi Eyal a...@digitaltrowel.com wrote: From: superpollo ute...@esempio.net To: Date: Mon, 18 Jan 2010 11:15:37 +0100 Subject: substitution hi. what is the most pythonic way to substitute substrings? eg: i want to apply: foo -- bar baz -- quux quuux -- foo

python gui ide under linux..like visual studio ;) ?

2010-01-18 Thread ted
Hi at all... Can someone please give me some advice, about a good IDE with control GUI under Linux ? Actually i know QT Creator by Nokia which i can use with Python (but i don't know how). And, a good library for access to database (mysql, sql server, oracle) ? Thank you very much ! bye --

Re: multithreading, performance, again...

2010-01-18 Thread Oktaka Com
On 30 Aralık 2009, 17:44, mk mrk...@gmail.com wrote: Hello everyone, I have figured out (sort of) how to do profiling of multithreaded programs with cProfile, it goes something like this: #!/usr/local/bin/python import cProfile import threading class TestProf(threading.Thread):      

Re: substitution

2010-01-18 Thread Mel
superpollo wrote: hi. what is the most pythonic way to substitute substrings? eg: i want to apply: foo -- bar baz -- quux quuux -- foo so that: fooxxxbazyyyquuux -- barxxxquuxyyyfoo This is simple -- maybe a bit brutal -- and if the strings get long it will be slow: def

Re: basic Class in Python

2010-01-18 Thread bartc
Wolfgang Rohdewald wolfg...@rohdewald.de wrote in message news:mailman.1056.1263771299.28905.python-l...@python.org... On Monday 18 January 2010, BarryJOgorman wrote: TypeError: object._new_() takes no parameters def _init_(self, name, job=None, pay=0): __init__ needs two underscores

Proper display of XMLRPCserver exceptions

2010-01-18 Thread Jean-Michel Pichavant
To all using xmlrpclib, I had trouble getting a proper display of my exceptions occuring on the server. Basically, xmlrpclib only display the exception itself without any traceback, on the client side. Something like Fault 1: type 'exceptions.KeyError':2 Ok then there's a key error, but how

Re: substitution

2010-01-18 Thread Nobody
On Mon, 18 Jan 2010 11:21:54 +0100, superpollo wrote: what is the most pythonic way to substitute substrings? say the subs are: quuux -- foo foo -- bar baz -- quux then i cannot apply the subs in sequence (say, .replace() in a loop), otherwise: fooxxxbazyyyquuux -- fooxxxbazyyyfoo

Re: Is python not good enough?

2010-01-18 Thread Phlip
On Jan 18, 5:59 am, Anh Hai Trinh anh.hai.tr...@gmail.com wrote: Go uses := for assignment. Except that it doesn't. := is a declaration. Ah, and that's why Go is easy for cheap parsers to rip. Tx all! I was formerly too mortified to proceed - now I'm back in the Go camp. They fixed the

Re: Generic Python Benchmark suite?

2010-01-18 Thread Dotan Cohen
What do you suggest? $ man time -- Dotan Cohen http://what-is-what.com http://gibberish.co.il -- http://mail.python.org/mailman/listinfo/python-list

not and is not problem

2010-01-18 Thread superpollo
hi: #!/usr/bin/env python data = seq=123 name , value = data.split(=) print name print value if not name == seq: print DOES NOT PRINT OF COURSE... if name is not seq: print WTF! WHY DOES IT PRINT? help please. bye -- http://mail.python.org/mailman/listinfo/python-list

ANN: shpaml 0.94b

2010-01-18 Thread Steve Howell
Hi everybody, I would like to announce the latest version of shpaml, which is an indentation-based markup language similar to haml, but different. Shpaml allows you to author HTML-like content with an indentation- based syntax that eliminates the need to write and read close tags and angle

Re: not and is not problem

2010-01-18 Thread Stephen Hansen
On Mon, Jan 18, 2010 at 7:43 AM, superpollo ute...@esempio.net wrote: #!/usr/bin/env python data = seq=123 name , value = data.split(=) print name print value if not name == seq: print DOES NOT PRINT OF COURSE... if name is not seq: print WTF! WHY DOES IT PRINT? Because name

Re: not and is not problem

2010-01-18 Thread D'Arcy J.M. Cain
On Mon, 18 Jan 2010 16:43:25 +0100 superpollo ute...@esempio.net wrote: hi: if name is not seq: print WTF! WHY DOES IT PRINT? Perhaps they aren't the same object. Some values are guaranteed to be the same (e.g. True and False) but not all. Try != instead of is not in that experssion.

Re: substitution

2010-01-18 Thread Anthra Norell
Anthra Norell wrote: superpollo wrote: hi. what is the most pythonic way to substitute substrings? eg: i want to apply: foo -- bar baz -- quux quuux -- foo so that: fooxxxbazyyyquuux -- barxxxquuxyyyfoo bye So it goes. The more it matters, the sillier the misatakes. The method __init__

Re: not and is not problem

2010-01-18 Thread Arnaud Delobelle
On 18 Jan, 15:43, superpollo ute...@esempio.net wrote: hi: #!/usr/bin/env python data = seq=123 name , value = data.split(=) print name print value if not name == seq:      print DOES NOT PRINT OF COURSE... if name is not seq:      print WTF! WHY DOES IT PRINT? help please. bye is

What is a list compression in Python?

2010-01-18 Thread Kit
Hello Everyone, I am not sure if I have posted this question in a correct board. Can anyone please teach me: What is a list compression in Python? Would you mind give me some list compression examples? Thanks really appreciate that. Kit -- http://mail.python.org/mailman/listinfo/python-list

Re: not and is not problem

2010-01-18 Thread J
On Mon, Jan 18, 2010 at 10:43, superpollo ute...@esempio.net wrote: hi: #!/usr/bin/env python data = seq=123 name , value = data.split(=) print name print value if not name == seq:    print DOES NOT PRINT OF COURSE... if name is not seq:    print WTF! WHY DOES IT PRINT? is will return

Re: What is a list compression in Python?

2010-01-18 Thread superpollo
Kit ha scritto: Hello Everyone, I am not sure if I have posted this question in a correct board. Can anyone please teach me: What is a list compression in Python? Would you mind give me some list compression examples? Thanks really appreciate that. Kit i think that's compreHENsion...

Re: What is a list compression in Python?

2010-01-18 Thread Simon Brunning
2010/1/18 Kit wkfung.e...@gmail.com: Hello Everyone, I am not sure if I have posted this question in a correct board. Can anyone please teach me: What is a list compression in Python? Perhaps you mean a list comprehension? If so, see

Re: substitution

2010-01-18 Thread Duncan Booth
Adi Eyal a...@digitaltrowel.com wrote: Using regular expressions the answer is short (and sweet) mapping = { foo : bar, baz : quux, quuux : foo } pattern = (%s) % |.join(mapping.keys()) repl = lambda x : mapping.get(x.group(1), x.group(1)) s =

Re: not and is not problem

2010-01-18 Thread Steven D'Aprano
On Mon, 18 Jan 2010 16:43:25 +0100, superpollo wrote: hi: #!/usr/bin/env python data = seq=123 name , value = data.split(=) print name print value if not name == seq: print DOES NOT PRINT OF COURSE... if name is not seq: print WTF! WHY DOES IT PRINT? `is` is not an

Re: What is a list compression in Python?

2010-01-18 Thread Stephen Hansen
On Mon, Jan 18, 2010 at 8:07 AM, Kit wkfung.e...@gmail.com wrote: Hello Everyone, I am not sure if I have posted this question in a correct board. Can anyone please teach me: What is a list compression in Python? Would you mind give me some list compression examples? Do you mean list

Re: substitution

2010-01-18 Thread Anthra Norell
superpollo wrote: hi. what is the most pythonic way to substitute substrings? eg: i want to apply: foo -- bar baz -- quux quuux -- foo so that: fooxxxbazyyyquuux -- barxxxquuxyyyfoo bye Third attempt. Clearly something doesn't work right. My code gets clipped on the way up. I have to

Re: substitution

2010-01-18 Thread Steven D'Aprano
On Mon, 18 Jan 2010 06:23:44 -0800, Iain King wrote: On Jan 18, 2:17 pm, Adi Eyal a...@digitaltrowel.com wrote: [...] Using regular expressions the answer is short (and sweet) mapping = {         foo : bar,         baz : quux,         quuux : foo } pattern = (%s) %

Re: What is a list compression in Python?

2010-01-18 Thread Steven D'Aprano
On Mon, 18 Jan 2010 08:07:41 -0800, Kit wrote: Hello Everyone, I am not sure if I have posted this question in a correct board. Can anyone please teach me: What is a list compression in Python? Google python list comprehension. If Google is broken for you, try Yahoo, or any other search

py.test-1.2.0: junitxml, standalone test scripts, pluginization

2010-01-18 Thread holger krekel
Hi all, i just released some bits related to automated testing with Python: py-1.2.0: py.test core which grew junitxml, standalone-script generation pytest-xdist-1.0: separately installable dist-testing looponfailing plugin pytest-figleaf-1.0: separately installable figleaf-coverage

Re: Arrrrgh! Another module broken

2010-01-18 Thread Grant Edwards
On 2010-01-18, Jive Dadson notonthe...@noisp.com wrote: I just found another module that broke when I went to 2.6. Gnuplot. Apparently one of its routines has a parameter named with. That used to be okay, and now it's not. I remember seeing depreicated warnings about that _years_ ago, and

Re: Is python not good enough?

2010-01-18 Thread Steven D'Aprano
On Mon, 18 Jan 2010 03:03:26 -0800, Phlip wrote: On Jan 12, 7:09 am, ikuta liu ikut...@gmail.com wrote: Go language try to merge low level, hight level and browser language. Go uses := for assignment. This means, to appease the self-righteous indignation of the math professor who would

Re: Is python not good enough?

2010-01-18 Thread Steven D'Aprano
On Mon, 18 Jan 2010 07:37:36 -0800, Phlip wrote: They fixed the hideous redundancy of Java without the ill-defined scope issues of Python Which ill-defined scope issues are you referring to? -- Steven -- http://mail.python.org/mailman/listinfo/python-list

Python decorator syntax limitations

2010-01-18 Thread Jonathan S
Hi all, The following is what I want to do, but this results in a syntax error: @news_page('template.html').lookup(News, 'news_id', 'news') def view(request, group, news): pass What does work is the equivalent old way of doing decorating: def view(request, group, news): pass view =

Re: substitution

2010-01-18 Thread Iain King
On Jan 18, 4:26 pm, Steven D'Aprano st...@remove-this- cybersource.com.au wrote: On Mon, 18 Jan 2010 06:23:44 -0800, Iain King wrote: On Jan 18, 2:17 pm, Adi Eyal a...@digitaltrowel.com wrote: [...] Using regular expressions the answer is short (and sweet) mapping = {         foo : bar,

Re: Python decorator syntax limitations

2010-01-18 Thread Steve Howell
On Jan 18, 8:44 am, Jonathan S jonathan.slend...@gmail.com wrote: Hi all, The following is what I want to do, but this results in a syntax error: @news_page('template.html').lookup(News, 'news_id', 'news') def view(request, group, news):     pass What does work is the equivalent old way

Re: not and is not problem

2010-01-18 Thread Jean-Michel Pichavant
Steven D'Aprano wrote: On Mon, 18 Jan 2010 16:43:25 +0100, superpollo wrote: hi: #!/usr/bin/env python data = seq=123 name , value = data.split(=) print name print value if not name == seq: print DOES NOT PRINT OF COURSE... if name is not seq: print WTF! WHY DOES IT PRINT?

Re: ctypes: nested structures and pointers

2010-01-18 Thread Gabriele Modena
On Mon, Jan 18, 2010 at 10:33 AM, Gabriele Modena gabriele.mod...@gmail.com wrote:  1. what is the correct (pythonic) way to capture the prototype definition of dev_callbacks and the relation between that structure and dev_info?  2. is it correct to wrap connect, transceive and disconnect in

Re: Python decorator syntax limitations

2010-01-18 Thread Lie Ryan
On 01/19/10 03:44, Jonathan S wrote: Any suggestions? I have my reasons for doing this, (news_page is a class, and __call__ is used to wrap the template.) I'm sure this is a limitation in the syntax, but would parenthesis somewhere help? The restriction[1] is put in there since Guido has a

Re: Generic Python Benchmark suite?

2010-01-18 Thread Antoine Pitrou
Le Mon, 18 Jan 2010 11:30:16 +0100, Stefan Behnel a écrit : Anand Vaidya, 18.01.2010 10:58: Is there a generic python benchmark suite in active development? [...] PS: I think a benchmark should cover file / network, database I/O, data structures (dict, list etc), object creation/manipulation,

Re: Python decorator syntax limitations

2010-01-18 Thread Peter Otten
Jonathan S wrote: Hi all, The following is what I want to do, but this results in a syntax error: @news_page('template.html').lookup(News, 'news_id', 'news') def view(request, group, news): pass What does work is the equivalent old way of doing decorating: def

Re: Generic Python Benchmark suite?

2010-01-18 Thread Antoine Pitrou
Le Mon, 18 Jan 2010 01:58:42 -0800, Anand Vaidya a écrit : Is there a generic python benchmark suite in active development? I am looking forward to comparing some code on various python implementations (primarily CPython 2.x, CPython 3.x, UnladenSwallow, Psyco). I am happy with something

using super

2010-01-18 Thread Jean-Michel Pichavant
class SubClass(Base): colour = Red def parrot(self): docstring for Subclass return super(Subclass, self).parrot() I'm not a big fan of super, but I'm still wondering if return super(self.__class__, self).parrot() would have made it. What if Subclass has more than

Re: python gui ide under linux..like visual studio ;) ?

2010-01-18 Thread Antoine Pitrou
Le Mon, 18 Jan 2010 15:32:36 +0100, ted a écrit : And, a good library for access to database (mysql, sql server, oracle) ? If you want something high-level: http://www.sqlalchemy.org/ You won't regret it :) -- http://mail.python.org/mailman/listinfo/python-list

Re: using super

2010-01-18 Thread Duncan Booth
Jean-Michel Pichavant jeanmic...@sequans.com wrote: class SubClass(Base): colour = Red def parrot(self): docstring for Subclass return super(Subclass, self).parrot() I'm not a big fan of super, but I'm still wondering if return super(self.__class__,

Re: Is python not good enough?

2010-01-18 Thread MRAB
Phlip wrote: On Jan 12, 7:09 am, ikuta liu ikut...@gmail.com wrote: Go language try to merge low level, hight level and browser language. Go uses := for assignment. This means, to appease the self-righteous indignation of the math professor who would claim = should mean equality... ...you

Re: Python decorator syntax limitations

2010-01-18 Thread Aahz
In article 4b54998...@dnews.tpgi.com.au, Lie Ryan lie.1...@gmail.com wrote: If you are sure you can put up a convincing argument for lifting this restriction, and you are willing to put some time arguing, you are welcome to start a thread in the python-dev mailing list. Be sure to read about

Re: substitution

2010-01-18 Thread Adi Eyal
From: Steven D'Aprano st...@remove-this-cybersource.com.au To: python-l...@python.org Date: 18 Jan 2010 16:26:48 GMT Subject: Re: substitution On Mon, 18 Jan 2010 06:23:44 -0800, Iain King wrote: On Jan 18, 2:17 pm, Adi Eyal a...@digitaltrowel.com wrote: [...] Using regular expressions

Re: Python decorator syntax limitations

2010-01-18 Thread Arnaud Delobelle
a...@pythoncraft.com (Aahz) writes: In article 4b54998...@dnews.tpgi.com.au, Lie Ryan lie.1...@gmail.com wrote: If you are sure you can put up a convincing argument for lifting this restriction, and you are willing to put some time arguing, you are welcome to start a thread in the python-dev

Re: lightweight encryption of text file

2010-01-18 Thread Aahz
In article mailman.691.1263033916.28905.python-l...@python.org, Daniel Fetchinson fetchin...@googlemail.com wrote: Well, that's sort of true about learning a complex API :) But it's also true that I'm not storing anything really valuable in the file but still wouldn't want to leave it lying

Re: using super

2010-01-18 Thread Jean-Michel Pichavant
Duncan Booth wrote: Jean-Michel Pichavant jeanmic...@sequans.com wrote: class SubClass(Base): colour = Red def parrot(self): docstring for Subclass return super(Subclass, self).parrot() I'm not a big fan of super, but I'm still wondering if return

Unable to install numpy

2010-01-18 Thread vsoler
Hi all, I just download Numpy, and tried to install it using numpy-1.4.0- win32-superpack-python2.6.exe I get an error: Python version 2.6 required, which was not found in the Registry However, I am using Python 2.6 every day. I'm running Windows 7. What can I do? --

Re: Unable to install numpy

2010-01-18 Thread Robert Kern
On 2010-01-18 14:02 PM, vsoler wrote: Hi all, I just download Numpy, and tried to install it using numpy-1.4.0- win32-superpack-python2.6.exe I get an error: Python version 2.6 required, which was not found in the Registry However, I am using Python 2.6 every day. I'm running Windows 7.

Re: using super

2010-01-18 Thread Arnaud Delobelle
Jean-Michel Pichavant jeanmic...@sequans.com writes: [...] Then is there a reason why return super(Subclass, self).parrot() would be prefered over the classic return Base.parrot(self) ? Or is it just a matter of preference ? Using super() calls the next method in the class's Method

Re: force URLencoding script

2010-01-18 Thread João
On Jan 15, 4:46 pm, r0g aioe@technicalbloke.com wrote: João wrote: On Jan 15, 2:38 pm, r0g aioe@technicalbloke.com wrote: João wrote: On Jan 14, 5:58 pm, r0g aioe@technicalbloke.com wrote: João wrote: On Jan 12, 10:07 pm, r0g aioe@technicalbloke.com wrote: João wrote:

Re: force URLencoding script

2010-01-18 Thread João
On Jan 15, 4:46 pm, r0g aioe@technicalbloke.com wrote: João wrote: On Jan 15, 2:38 pm, r0g aioe@technicalbloke.com wrote: João wrote: On Jan 14, 5:58 pm, r0g aioe@technicalbloke.com wrote: João wrote: On Jan 12, 10:07 pm, r0g aioe@technicalbloke.com wrote: João wrote:

Re: Python decorator syntax limitations

2010-01-18 Thread Jonathan S
Thanks a lot, all of you! This was really helpful. (or at least give me the inspiration I needed to finish it.) I'm sure this is a use case where most other options are less readable than the chain of methods in the decorator. In this use case, I had a lot of Django views to which access

Re: python gui ide under linux..like visual studio ;) ?

2010-01-18 Thread Mike Driscoll
On Jan 18, 8:32 am, ted t...@sjksdjk.it wrote: Hi at all... Can someone please give me some advice, about a good IDE with control GUI under Linux ? Actually i know QT Creator by Nokia which i can use with Python (but i don't know how). And, a good library for access to database (mysql, sql

Re: I really need webbrowser.open('file://') to open a web browser

2010-01-18 Thread Timur Tabi
On Sat, Jan 16, 2010 at 3:43 PM, Paul Boddie p...@boddie.org.uk wrote: Generally, the desktop-specific tools should know that a browser is the appropriate application for an HTML file, and testing with both xdg-open, gnome-open and kfmclient openURL seems to open browsers on HTML files (using

form mailer for info + files

2010-01-18 Thread Gregory
There is code all over on how to create a form mailer. I need an example that will show how to upload two files and send them along with form field info. Is it required to overwrite the python cgi.fieldstorage to do this? Working with Python 2.4.3. --

Re: searching and storing large quantities of xml!

2010-01-18 Thread dads
Thanks all, took your advice and have been playing all weekend which has been great fun. ElementTree is awesome. I created a script that organises the xml as they're in year blocks and I didn't realise the required xml is mixed up with other xml. Plus the volumes are much greater than I realised,

Re: Generic Python Benchmark suite?

2010-01-18 Thread Terry Reedy
On 1/18/2010 4:58 AM, Anand Vaidya wrote: Is there a generic python benchmark suite in active development? I am looking forward to comparing some code on various python implementations (primarily CPython 2.x, CPython 3.x, UnladenSwallow, Psyco). You might find this interesting if you have not

Re: Parse a log file

2010-01-18 Thread Tim Chase
kak...@gmail.com wrote: I want to parse a log file with the following format for example: TIMESTAMPEOperation FileName Bytes 12/Jan/2010:16:04:59 +0200 EXISTS sample3.3gp 37151 12/Jan/2010:16:04:59 +0200 EXISTSsample3.3gp 37151

  1   2   3   >