Re: splitting an XML file on the basis on basis of XML tags

2008-04-03 Thread bijeshn
On Apr 2, 5:37 pm, Chris [EMAIL PROTECTED] wrote: [EMAIL PROTECTED] wrote: Hi all,          i have an XML file with the following structure:: r1 r2-| r3     | r4     | .           | .           |         constitutes one record. .           | .        

Re: Parsing HTML?

2008-04-03 Thread benash
BeautifulSoup does what I need it to. Though, I was hoping to find something that would let me work with the DOM the way JavaScript can work with web browsers' implementations of the DOM. Specifically, I'd like to be able to access the innerHTML element of a DOM element. Python's built-in

Re: Where can I find :

2008-04-03 Thread alex23
On Apr 2, 10:08 pm, [EMAIL PROTECTED] wrote: On Mar 30, 1:22 am, [EMAIL PROTECTED] wrote: [the usual masturbatory castironpi ramble] What? Yeah, that's what pretty much everyone says regarding his posts. Very very little signal amongst that noise. --

Re: splitting an XML file on the basis on basis of XML tags

2008-04-03 Thread Steve Holden
bijeshn wrote: On Apr 2, 5:37 pm, Chris [EMAIL PROTECTED] wrote: [EMAIL PROTECTED] wrote: Hi all, i have an XML file with the following structure:: r1 r2-| r3 | r4 | . | . | constitutes one record. . | .

Re: Manipulate Large Binary Files

2008-04-03 Thread Paul Rubin
Derek Martin [EMAIL PROTECTED] writes: Both are clocking in at the same time (1m 5sec for 2.6Gb), are there any ways I can optimize either solution? Getting 40+ MB/sec through a file system is pretty impressive. Sounds like a RAID? That said, due to normal I/O generally involving

Python for low-level Windows programming

2008-04-03 Thread haxier
Hi all I've some experience with Python in desktop apps, but now I'm looking to code a tool like Kee-Pass[1] which must have access to some low- level primitives in a windows environment: hooks when windows are displayed, automatic form fill, and so on in a variety of scenarios (desktop apps,

Re: Python for low-level Windows programming

2008-04-03 Thread Tim Golden
haxier wrote: I've some experience with Python in desktop apps, but now I'm looking to code a tool like Kee-Pass[1] which must have access to some low- level primitives in a windows environment: hooks when windows are displayed, automatic form fill, and so on in a variety of scenarios

Re: function call - default value collecting arguments

2008-04-03 Thread Primoz Skale
[EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] On 2 avr, 22:32, Primoz Skale [EMAIL PROTECTED] wrote: I also understand (fairly) how to collect arguments. For example, let's define another function: def f(*a): print a This means that f takes any number of optional

Re: Prototype OO

2008-04-03 Thread sam
[EMAIL PROTECTED] napisał(a): So, while I often use Python's lambdas, the imposed limitations is ok to me since I wouldn't use it for anything more complex. Also - as a side note - while the syntax is a bit different, the resulting object is an ordinary function. And people start asking

Re: Prototype OO

2008-04-03 Thread sam
Gabriel Genellina napisał(a): Yes. Funciton is always a piece of code (program) that does something. There is no need for different syntax. Guido has regretted lambda for a long time; it was scheduled for deletion on Python 3000 [2] but finally will stay [3]. Thanks for that info and

Re: Prototype OO

2008-04-03 Thread Diez B. Roggisch
And I say syntax should be the same. These are only opinions, so forgive me for wasting your time. You mean like in JS? function foo(args) {} foo = function(args) {} Somehow the JS-designers also made a compromise to allow to create unnamed and named functions. Could it be that it make

unicode in exception traceback

2008-04-03 Thread WaterWalk
Hello. I just found on Windows when an exception is raised and traceback info is printed on STDERR, all the characters printed are just plain ASCII. Take the unicode character u'\u4e00' for example. If I write: print u'\u4e00' If the system locale is PRC China, then this statement will print

Re: Python in High School

2008-04-03 Thread Bruno Desthuilliers
Jan Claeys a écrit : (snip) I learned about pointers while learning Pascal (and later embedded assembler) using Borland's tools. Later I learned C (and even later C++), and I've always been wondering why those languages were making simple things so complicated... Similar pattern here :

Re: Prototype OO

2008-04-03 Thread Bruno Desthuilliers
sam a écrit : [EMAIL PROTECTED] napisał(a): So, while I often use Python's lambdas, the imposed limitations is ok to me since I wouldn't use it for anything more complex. Also - as a side note - while the syntax is a bit different, the resulting object is an ordinary function. And

Examples using msilib to build windows installers

2008-04-03 Thread imageguy
I have been using InnoSetup to distribute my wxpython app and ir works great, howver, I would like to offer a *.msi installer to customers as an option and this isn't available using Innosetup. It would appear to me that the msilib library included with standard python 2.5 would allow be to do

State of ctypes Support on HP-UX?

2008-04-03 Thread Phil Thompson
Could somebody confirm how well ctypes is supported on HP-UX (for both PA-RISC and Itanium) for both Python v2.4 and v2.5? I don't have access to an HP system and Google doesn't come up with a definitive answer (which may just mean it works fine, but prior experience with HP means I'd like

Re: who said python can't be obsfucated!?

2008-04-03 Thread Bruno Desthuilliers
[EMAIL PROTECTED] a écrit : def s(c):return[]if c==[]else s([_ for _ in c[1:]if _c[0]])+[c[0]] +s([_ for _ in c[1:]if _=c[0]]) Anyone else got some wonders...? Nothing as bad, but: sig=lambda m:'@'.join(['.'.join([w[::-1] for w in p.split('.')]) for p in m.split('@')]) --

Re: What motivates all unpaid volunteers at Pycon?

2008-04-03 Thread Bruno Desthuilliers
[EMAIL PROTECTED] a écrit : On Apr 1, 11:45 am, Ed Leafe [EMAIL PROTECTED] wrote: Assuming that people get nothing back by participating in a community, yes, it would be curious. My experience, though, is that I get a lot more out of it than I could ever contribute. IOW, it's a great example

Re: Prototype OO

2008-04-03 Thread olive
On 3 avr, 10:32, sam [EMAIL PROTECTED] wrote: Bruno Desthuilliers napisa³(a): Ok, I'm going to be a bit harsh, but this time I'll assume it. Sam, you started this thread by asking about prototype vs class based minor syntactic points that, whether you like them or not (and I think I will

Re: Prototype OO

2008-04-03 Thread Bruno Desthuilliers
sam a écrit : Bruno Desthuilliers napisał(a): Ok, I'm going to be a bit harsh, but this time I'll assume it. Sam, you started this thread by asking about prototype vs class based minor syntactic points that, whether you like them or not (and I think I will get back to this discussion

Re: splitting an XML file on the basis on basis of XML tags

2008-04-03 Thread Chris
On Apr 3, 8:51 am, Steve Holden [EMAIL PROTECTED] wrote: bijeshn wrote: On Apr 2, 5:37 pm, Chris [EMAIL PROTECTED] wrote: [EMAIL PROTECTED] wrote: Hi all,          i have an XML file with the following structure:: r1 r2-| r3     | r4     | .           | .           |      

Re: Rationale for read-only property of co_code

2008-04-03 Thread João Neves
On Apr 3, 4:43 am, Scott David Daniels [EMAIL PROTECTED] wrote: Nope: If you change the code in-place, the whole stack's references to where they were running would need to get updated to corresponding locations in the new code. _That_ is a lot of work. Ah, there it is. Now I get it, it

Re: splitting an XML file on the basis on basis of XML tags

2008-04-03 Thread Marco Mariani
Steve Holden wrote: the XML file is almost a TB in size... Good grief. When will people stop abusing XML this way? Not before somebody writes a clever xmlfs for the linux kernel :-/ -- http://mail.python.org/mailman/listinfo/python-list

Re: unicode in exception traceback

2008-04-03 Thread Peter Otten
WaterWalk wrote: Hello. I just found on Windows when an exception is raised and traceback info is printed on STDERR, all the characters printed are just plain ASCII. Take the unicode character u'\u4e00' for example. If I write: print u'\u4e00' If the system locale is PRC China, then

Re: Rationale for read-only property of co_code

2008-04-03 Thread Peter Otten
João Neves wrote: Let me give a very basic example. Say we have these two functions: I suppose you mean def inc(x): return x + 1 ... def dec(x): return x - 1 ... inc(1), dec(1) (2, 0) Examining the compiled bytecodes for these two functions: inc.func_code.co_code

Get all strings matching given RegExp

2008-04-03 Thread Alex9968
Can I get sequence of all strings that can match a given regular expression? For example, for expression '(a|b)|(x|y)' it would be ['ax', 'ay', 'bx', 'by'] It would be useful for example to pass these strings to a search engine not supporting RegExp (therefore adding such support to it). A

Re: splitting an XML file on the basis on basis of XML tags

2008-04-03 Thread Marco Mariani
Marco Mariani wrote: the XML file is almost a TB in size... Good grief. When will people stop abusing XML this way? Not before somebody writes a clever xmlfs for the linux kernel :-/ Ok. I meant it as a joke, but somebody has been there and done that. Twice.

Re: Prototype OO

2008-04-03 Thread sam
Bruno Desthuilliers napisał(a): Ok, I'm going to be a bit harsh, but this time I'll assume it. Sam, you started this thread by asking about prototype vs class based minor syntactic points that, whether you like them or not (and I think I will get back to this discussion after learning

Re: State of ctypes Support on HP-UX?

2008-04-03 Thread Thomas Heller
Phil Thompson schrieb: Could somebody confirm how well ctypes is supported on HP-UX (for both PA-RISC and Itanium) for both Python v2.4 and v2.5? I don't have access to an HP system and Google doesn't come up with a definitive answer (which may just mean it works fine, but prior

Re: Prototype OO

2008-04-03 Thread Marc 'BlackJack' Rintsch
On Thu, 03 Apr 2008 10:07:38 +0200, sam wrote: [EMAIL PROTECTED] napisał(a): So, while I often use Python's lambdas, the imposed limitations is ok to me since I wouldn't use it for anything more complex. Also - as a side note - while the syntax is a bit different, the resulting object

Efficient way of testing for substring being one of a set?

2008-04-03 Thread tinnews
What's the neatest and/or most efficient way of testing if one of a set of strings (contained in a dictionary, list or similar) is a sub-string of a given string? I.e. I have a string delivered into my program and I want to see if any of a set of strings is a substring of the string I have been

Re: Efficient way of testing for substring being one of a set?

2008-04-03 Thread Paul Hankin
On Apr 3, 12:37 pm, [EMAIL PROTECTED] wrote: What's the neatest and/or most efficient way of testing if one of a set of strings (contained in a dictionary, list or similar) is a sub-string of a given string? I.e. I have a string delivered into my program and I want to see if any of a set of

Re: Get all strings matching given RegExp

2008-04-03 Thread Marc Christiansen
Alex9968 [EMAIL PROTECTED] wrote: Can I get sequence of all strings that can match a given regular expression? For example, for expression '(a|b)|(x|y)' it would be ['ax', 'ay', 'bx', 'by'] It would be useful for example to pass these strings to a search engine not supporting RegExp

Re: Efficient way of testing for substring being one of a set?

2008-04-03 Thread tinnews
Paul Hankin [EMAIL PROTECTED] wrote: On Apr 3, 12:37 pm, [EMAIL PROTECTED] wrote: What's the neatest and/or most efficient way of testing if one of a set of strings (contained in a dictionary, list or similar) is a sub-string of a given string? I.e. I have a string delivered into my

Re: Efficient way of testing for substring being one of a set?

2008-04-03 Thread tinnews
Jeff [EMAIL PROTECTED] wrote: def foo(sample, strings): for s in strings: if sample in s: return True return False This was an order of magnitude faster for me than using str.find or str.index. That was finding rare words in the

Re: Efficient way of testing for substring being one of a set?

2008-04-03 Thread George Sakkis
On Apr 3, 8:03 am, Jeff [EMAIL PROTECTED] wrote: def foo(sample, strings): for s in strings: if sample in s: return True return False This was an order of magnitude faster for me than using str.find or str.index. That was finding

Re: Python queue madness

2008-04-03 Thread nnp
Hrm, it sounds likely that I am using something mutable and that is messing things up. I'll look into it. As for providing sample code to recreate the problem, I would find it difficult I think to provide a simple example that accurately reflects what is truly going on so there wouldn't be much

Re: Get all strings matching given RegExp

2008-04-03 Thread Jeff
I don't think there is any built in way. Regular expressions are compiled into an expanded pattern internally, but I don't think that it is anything that would be useful for you to directly access. If you are interested in a lot of work, you could do something with PLY and write an re parser

Re: Efficient way of testing for substring being one of a set?

2008-04-03 Thread Jeff
def foo(sample, strings): for s in strings: if sample in s: return True return False This was an order of magnitude faster for me than using str.find or str.index. That was finding rare words in the entire word-list (w/ duplicates) of War

Re: Prototype OO

2008-04-03 Thread Gabriel Genellina
En Thu, 03 Apr 2008 05:20:48 -0300, sam [EMAIL PROTECTED] escribió: Gabriel Genellina napisał(a): Class methods and instance methods are not just standard functions; instance methods were plain functions before 2.2 and the Class object was in charge of doing the self magic. Now the

Re: Strange MySQL Problem...

2008-04-03 Thread Victor Subervi
Comments in line... On Thu, Apr 3, 2008 at 12:35 AM, John Nagle [EMAIL PROTECTED] wrote: Steve Holden wrote: Define no longer works. Sorry. Throws HTTP 200 error. On Thu, Apr 3, 2008 at 12:35 AM, John Nagle [EMAIL PROTECTED] wrote: John Nagle wrote: works fine? Please check again...

Re: Efficient way of testing for substring being one of a set?

2008-04-03 Thread Ant
On Apr 3, 12:37 pm, [EMAIL PROTECTED] wrote: What's the neatest and/or most efficient way of testing if one of a A different approach: words = [he, sh, bla] name = blah True in (word in name for word in words) True name = bling True in (word in name for word in words) False Perhaps not

Re: who said python can't be obsfucated!?

2008-04-03 Thread Marco Mariani
Bruno Desthuilliers wrote: sig=lambda m:'@'.join(['.'.join([w[::-1] for w in p.split('.')]) for p in m.split('@')]) Pff... you call that a quicksort? From http://www.p-nand-q.com/python/obfuscated_python.html import sys funcs = range(10) def A(_,o): _[3]=_[5]() def B(_,o):

Re: who said python can't be obsfucated!?

2008-04-03 Thread Marco Mariani
Bruno Desthuilliers wrote: sig=lambda m:'@'.join(['.'.join([w[::-1] for w in p.split('.')]) for p in m.split('@')]) Pff... you call that a quicksort? From http://www.p-nand-q.com/python/obfuscated_python.html import sys funcs = range(10) def A(_,o): _[3]=_[5]() def B(_,o):

Re: Efficient way of testing for substring being one of a set?

2008-04-03 Thread Jeff
On Apr 3, 8:19 am, George Sakkis [EMAIL PROTECTED] wrote: On Apr 3, 8:03 am, Jeff [EMAIL PROTECTED] wrote: def foo(sample, strings):         for s in strings:                 if sample in s:                         return True         return False This was an order of magnitude

Re: Efficient way of testing for substring being one of a set?

2008-04-03 Thread Jeff
On Apr 3, 8:44 am, Ant [EMAIL PROTECTED] wrote: On Apr 3, 12:37 pm, [EMAIL PROTECTED] wrote: What's the neatest and/or most efficient way of testing if one of a A different approach: words = [he, sh, bla] name = blah True in (word in name for word in words) True name = bling

Re: object-relational mappers

2008-04-03 Thread Paul Boddie
On 2 Apr, 15:50, Aaron Watters [EMAIL PROTECTED] wrote: [Quoting hdante] Seriously, you'll forget there's a relational database below. (there are even intefaces for relational lists, trees, etc.) My experience with this sort of thing is that it is a bit like morphine. It can feel

A question about creating Maildir mailboxes with mailbox.Maildir

2008-04-03 Thread tinnews
I have mail delivered into Maildirs which live in a directory hierarchy as follows:- /home/isbd/Mail/Li/name of maildir /home/isbd/Mail/In/name of maildir Note that neither /home/isbd/Mail/Li nor /home/isbd/Mail/In are Maildir mailboxes. How do I create a new Maildir mailbox in either

Re: Efficient way of testing for substring being one of a set?

2008-04-03 Thread [EMAIL PROTECTED]
On Apr 3, 1:37 pm, [EMAIL PROTECTED] wrote: What's the neatest and/or most efficient way of testing if one of a set of strings (contained in a dictionary, list or similar) is a sub-string of a given string? [...] You could use the Aho-Corasick algorithm http://en.wikipedia.org/wiki/

Re: Efficient way of testing for substring being one of a set?

2008-04-03 Thread bearophileHUGS
Dennis Benzinger: You could use the Aho-Corasick algorithm http://en.wikipedia.org/wiki/ Aho-Corasick_algorithm. I don't know if there's a Python implementation yet. http://hkn.eecs.berkeley.edu/~dyoo/python/ahocorasick/ Bye, bearophile -- http://mail.python.org/mailman/listinfo/python-list

Re: object-relational mappers

2008-04-03 Thread Tim Golden
Paul Boddie wrote: ... I've come to realise that most object-relational mappers are solving the wrong problems: they pretend that the database is somehow the wrong representation whilst being a fast enough black box for holding persistent data (although I doubt that many people push the

Re: Parsing HTML?

2008-04-03 Thread Paul Boddie
On 3 Apr, 06:59, Benjamin [EMAIL PROTECTED] wrote: I'm trying to parse an HTML file. I want to retrieve all of the text inside a certain tag that I find with XPath. The DOM seems to make this available with the innerHTML element, but I haven't found a way to do it in Python. With libxml2dom

Re: non-terminating regex match

2008-04-03 Thread Gabriel Genellina
En Wed, 02 Apr 2008 13:01:59 -0300, Maurizio Vitale [EMAIL PROTECTED] escribió: The intention is to match C++ identifiers, with or without namespace qualification, with or without arguments (e.g. variables, functions and macros). The following should be accepted: main

Re: State of ctypes Support on HP-UX?

2008-04-03 Thread Phil Thompson
On Thursday 03 April 2008, Thomas Heller wrote: Phil Thompson schrieb: Could somebody confirm how well ctypes is supported on HP-UX (for both PA-RISC and Itanium) for both Python v2.4 and v2.5? I don't have access to an HP system and Google doesn't come up with a definitive answer

Re: who said python can't be obsfucated!?

2008-04-03 Thread Bruno Desthuilliers
Marco Mariani a écrit : Bruno Desthuilliers wrote: sig=lambda m:'@'.join(['.'.join([w[::-1] for w in p.split('.')]) for p in m.split('@')]) Pff... you call that a quicksort? Nope, only somewhat obfuscated Python. And it seems it's at least obfuscated enough for you to believe it

Re: Efficient way of testing for substring being one of a set?

2008-04-03 Thread George Sakkis
On Apr 3, 9:00 am, Jeff [EMAIL PROTECTED] wrote: On Apr 3, 8:44 am, Ant [EMAIL PROTECTED] wrote: On Apr 3, 12:37 pm, [EMAIL PROTECTED] wrote: What's the neatest and/or most efficient way of testing if one of a A different approach: words = [he, sh, bla] name = blah True in

Re: who said python can't be obsfucated!?

2008-04-03 Thread Marco Mariani
Bruno Desthuilliers wrote: Pff... you call that a quicksort? Nope, only somewhat obfuscated Python. And it seems it's at least obfuscated enough for you to believe it could be a quicksort implementation !-) You're right, but I'm past the quine age and don't bother parsing obfuscated code

Re: object-relational mappers

2008-04-03 Thread Marco Mariani
Tim Golden wrote: I've recently used Elixir and found it very useful for a small-scale database with no more than a dozen tables, well-structured and easily understood. I'd certainly use it again for anything like that to save me writing what would amount to boilerplate SQL. But I'd hate to

Re: object-relational mappers

2008-04-03 Thread Tim Golden
Marco Mariani wrote: Tim Golden wrote: I've recently used Elixir and found it very useful for a small-scale database with no more than a dozen tables, well-structured and easily understood. I'd certainly use it again for anything like that to save me writing what would amount to boilerplate

Re: object-relational mappers

2008-04-03 Thread Luis M . González
I have come to the same conclusion. ORMs make easy things easier, but difficult things impossible... The best approach I've seen so far is webpy's (if we are talking of web apps). It isn't an ORM, it is just a way to make the database api easier to use. Queries don't return objects, they return

Re: object-relational mappers

2008-04-03 Thread Jarek Zgoda
Bruno Desthuilliers napisał(a): Now my own experience is that whenever I tried this approach for anything non-trivial, I ended up building an ad-hoc, informally-specified bug-ridden slow implementation of half of SQLAlchemy. Which BTW is not strictly an ORM, but primarily an attempt at a

Re: Get all strings matching given RegExp

2008-04-03 Thread Gabriel Genellina
En Thu, 03 Apr 2008 06:50:52 -0300, Alex9968 [EMAIL PROTECTED] escribió: Can I get sequence of all strings that can match a given regular expression? For example, for expression '(a|b)|(x|y)' it would be ['ax', 'ay', 'bx', 'by'] See this thread:

Re: object-relational mappers

2008-04-03 Thread Bruno Desthuilliers
Luis M. González a écrit : I have come to the same conclusion. ORMs make easy things easier, but difficult things impossible... Not my experience with SQLAlchemy. Ok, I still not had an occasion to test it against stored procedures, but when it comes to complex queries, it did the trick so

Re: How easy is it to install python as non-root user?

2008-04-03 Thread Bruno Desthuilliers
[EMAIL PROTECTED] a écrit : Does python install fairly easily for a non-root user? I have an ssh login account onto a Linux system that currently provides Python 2.4.3 and I'd really like to use some of the improvements in Python 2.5.x. So, if I download the Python-2.5.2.tgz file is it

How easy is it to install python as non-root user?

2008-04-03 Thread tinnews
Does python install fairly easily for a non-root user? I have an ssh login account onto a Linux system that currently provides Python 2.4.3 and I'd really like to use some of the improvements in Python 2.5.x. So, if I download the Python-2.5.2.tgz file is it just the standard:- ./configure

Re: Rationale for read-only property of co_code

2008-04-03 Thread Arnaud Delobelle
On Apr 3, 11:10 am, João Neves [EMAIL PROTECTED] wrote: On Apr 3, 4:43 am, Scott David Daniels [EMAIL PROTECTED] wrote: Nope:  If you change the code in-place, the whole stack's references to where they were running would need to get updated to corresponding locations in the new code.  

Re: object-relational mappers

2008-04-03 Thread Marco Mariani
Bruno Desthuilliers wrote: A simple select query would be db.select('customers') or db.select('customers', name='John'). But you can also resort to plain sql as follows: db.query('select * from customers where name = John'). Simple, effective and doesn't get in your way. Seems nice too

RE: manipulating hex values

2008-04-03 Thread Stephen Cattaneo
Thanks to everyone ( Grant, Cliff, and Gabriel) for responding and helping me. Cheers, Steve -Original Message- From: Grant Edwards [mailto:[EMAIL PROTECTED] Sent: Tuesday, April 01, 2008 7:46 PM To: python-list@python.org Subject: Re: manipulating hex values On 2008-04-01, Stephen

Re: unicode in exception traceback

2008-04-03 Thread WaterWalk
On Apr 3, 5:56 pm, Peter Otten [EMAIL PROTECTED] wrote: WaterWalk wrote: Hello. I just found on Windows when an exception is raised and traceback info is printed on STDERR, all the characters printed are just plain ASCII. Take the unicode character u'\u4e00' for example. If I write:

Re: Strange MySQL Problem...

2008-04-03 Thread Gabriel Genellina
En Thu, 03 Apr 2008 09:43:57 -0300, Victor Subervi [EMAIL PROTECTED] escribió: Steve Holden wrote: Define no longer works. Sorry. Throws HTTP 200 error. HTTP 200 means OK. The same remarks I've posted earlier apply here. Must have missed those. Yes, the code works fine. Repeatedly.

Re: object-relational mappers

2008-04-03 Thread Bruno Desthuilliers
Jarek Zgoda a écrit : Bruno Desthuilliers napisał(a): Now my own experience is that whenever I tried this approach for anything non-trivial, I ended up building an ad-hoc, informally-specified bug-ridden slow implementation of half of SQLAlchemy. Which BTW is not strictly an ORM, but

Re: Nested try...except

2008-04-03 Thread Duncan Booth
Carl Banks [EMAIL PROTECTED] wrote: Perhaps the advent of with blocks will help reduce this error in the future. Indeed, and to encourage its use I think this thread ought to include the 'with statement' form of the function: from __future__ import with_statement from contextlib import

Re: How easy is it to install python as non-root user?

2008-04-03 Thread Matt Nordhoff
[EMAIL PROTECTED] wrote: Does python install fairly easily for a non-root user? I have an ssh login account onto a Linux system that currently provides Python 2.4.3 and I'd really like to use some of the improvements in Python 2.5.x. So, if I download the Python-2.5.2.tgz file is it just

Re: How easy is it to install python as non-root user?

2008-04-03 Thread tinnews
Bruno Desthuilliers [EMAIL PROTECTED] wrote: [EMAIL PROTECTED] a écrit : Does python install fairly easily for a non-root user? I have an ssh login account onto a Linux system that currently provides Python 2.4.3 and I'd really like to use some of the improvements in Python 2.5.x.

Re: object-relational mappers

2008-04-03 Thread Diez B. Roggisch
Bruno Desthuilliers schrieb: Jarek Zgoda a écrit : Bruno Desthuilliers napisał(a): Now my own experience is that whenever I tried this approach for anything non-trivial, I ended up building an ad-hoc, informally-specified bug-ridden slow implementation of half of SQLAlchemy. Which BTW is

Re: Efficient way of testing for substring being one of a set?

2008-04-03 Thread Ant
On Apr 3, 2:27 pm, George Sakkis [EMAIL PROTECTED] wrote: ... It's even prettier in 2.5: any(word in name for word in words) George And arguably the most readable yet! -- http://mail.python.org/mailman/listinfo/python-list

Looking for Agile Python Consulting

2008-04-03 Thread Ed Leafe
This isn't a specific job request, which is why I'm not placing it on the Python Job Board. Rather, I'm in the process of gathering information for an upcoming project, and I need to determine what resources, if any, are available in the Python community. We're in the

mailbox.Maildir(), confusing documentation

2008-04-03 Thread tinnews
Having got my Python 2.5.2 installed I'm trying some things out with the mailbox.Maildir() class. If I do the following:- import maibox mailbox.Maildir(/home/isbd/Mail/Li/pytest) then the pytest Maildir mailbox is created - which is great but isn't documented. If the above creates the

MLE in Python for distributions

2008-04-03 Thread Mike P
Hi All, Can anyone point me towards some code for Maximum Likilehood for distribution in python? Thanks Mike -- http://mail.python.org/mailman/listinfo/python-list

ANN: Leo 4.4.8 rc1 released

2008-04-03 Thread Edward K Ream
Leo 4.4.8 rc1 is now available at: http://sourceforge.net/project/showfiles.php?group_id=3458package_id=29106 This version features a new ipython plugin that provides a two-way bridge between Leo and IPython. See http://webpages.charter.net/edreamleo/IPythonBridge.html Leo is a text editor,

Re: object-relational mappers

2008-04-03 Thread Luis M . González
Yes, webpy's db api can be used in stand-alone scripts if you want. See below: import web db = web.database(dbn='mysql', db='northwind', user='root') x = db.select('employees') ... Another good thing is that, since queries return Storage objects (similar to dictionaries), they are much more

Re: object-relational mappers

2008-04-03 Thread Luis M . González
On 3 abr, 11:06, Bruno Desthuilliers bruno. [EMAIL PROTECTED] wrote: Luis M. González a écrit : I have come to the same conclusion. ORMs make easy things easier, but difficult things impossible... Not my experience with SQLAlchemy. Ok, I still not had an occasion to test it against stored

PyXMPP and GTalk

2008-04-03 Thread Ivan Chernetsky
Hello! Here is the example from PyXMPP package: http://pyxmpp.jajcus.net/trac/browser/trunk/examples/echobot.py And here is output: -- http://mail.python.org/mailman/listinfo/python-list

Re: Directed Graph Traversal

2008-04-03 Thread bukzor
On Apr 2, 8:33 pm, Scott David Daniels [EMAIL PROTECTED] wrote: bukzor wrote: Can someone point me in the direction of a good solution of this? I'm using it to construct a SQL query compiler, Given a directed graph and a list of points in the graph, what is the minimal subgraph that

Application of with statement in py3k. Property defining/redefining.

2008-04-03 Thread Zaur Shibzoukhov
http://szport.blogspot.com/2008/04/application-of-with-statement-in-py3k.html -- http://mail.python.org/mailman/listinfo/python-list

Re: Why prefer != over for Python 3.0?

2008-04-03 Thread D'Arcy J.M. Cain
On Thu, 03 Apr 2008 05:12:28 GMT Tim Roberts [EMAIL PROTECTED] wrote: Yes, indeed. In response to a challenge posted on one of the x86 assembler newsgroups about two years ago, one intrepid Russian programmer produced a generic Sudoku solver in a 65-byte executable. Yes, that's 65 BYTES --

Re: Strange MySQL Problem...

2008-04-03 Thread Victor Subervi
On Thu, Apr 3, 2008 at 9:34 AM, Gabriel Genellina [EMAIL PROTECTED] wrote: En Thu, 03 Apr 2008 09:43:57 -0300, Victor Subervi [EMAIL PROTECTED] escribió: Steve Holden wrote: Define no longer works. Sorry. Throws HTTP 200 error. HTTP 200 means OK. Yes. But there is an error somewhere,

Re: Python in High School

2008-04-03 Thread Stef Mientki
Well I doubt it's the visual environment that makes it more easy, color, shape and position can give some extra information though. I think apriori domain knowledge and flattness of information are of far more importance. The first issue is covered quit well by Robolab / Labview, but the

Re: Python-by-example - new online guide to Python Standard Library

2008-04-03 Thread AK
AK wrote: Hello, I find that I learn easier when I go from specific examples to a more general explanation of function's utility and I made a reference guide that will eventually document all functions, classes and methods in Python's Standard Library. For now, I covered about 20 most

Re: Get all strings matching given RegExp

2008-04-03 Thread Paul McGuire
On Apr 3, 4:50 am, Alex9968 [EMAIL PROTECTED] wrote: Can I get sequence of all strings that can match a given regular expression? For example, for expression '(a|b)|(x|y)' it would be ['ax', 'ay', 'bx', 'by'] Actually, this regex will only match 'a', 'b', 'x', or 'y' (assuming you meant to

Re: Module not found in script that was found in command-line interpreter. Possible Path issue?

2008-04-03 Thread Trent Mick
Jacob Davis wrote: I just installed the MySQLdb module and I have been able to get it to run in my command line interpreter. I am running Mac Leopard, and Python 2.5. I have tested importing and actually connecting and using a MySQL database, although it issues some warning:

Re: Python in High School

2008-04-03 Thread marion
On Apr 1, 1:27 pm, sprad [EMAIL PROTECTED] wrote: I'm a high school computer teacher, and I'm starting a series of programming courses next year (disguised as game development classes to capture more interest). The first year will be a gentle introduction to programming, leading to two more

Re: Strange MySQL Problem...

2008-04-03 Thread Gabriel Genellina
En Thu, 03 Apr 2008 14:03:53 -0300, Victor Subervi [EMAIL PROTECTED] escribió: On Thu, Apr 3, 2008 at 9:34 AM, Gabriel Genellina [EMAIL PROTECTED] wrote: Thank you. I believe you mean by bound, something like this, right? binary(picdata) I am now doing that, if I am not mistaken. No,

Re: splitting an XML file on the basis on basis of XML tags

2008-04-03 Thread Diez B. Roggisch
I abuse it because I can (and because I don't generally work with XML files larger than 20-30meg) :) And the OP never said the XML file for 1TB in size, which makes things different. Even with small xml-files your advice was not very sound. Yes, it's tempting to use regexes to process xml.

Re: Python for low-level Windows programming

2008-04-03 Thread Troels Thomsen
Is this possible without too much pain? I know I can code it with C# or C++ but tha'ts a road to avoid, if possible. Well of course I don't know exactly what you'd need, but the answer's certainly Yes :) Need I mention that it is also easy to write a windows service, using pyservice (i

Re: Manipulate Large Binary Files

2008-04-03 Thread Derek Tracy
On Apr 3, 2008, at 3:03 AM, Paul Rubin http:// phr.cx@NOSPAM.invalid wrote: Derek Martin [EMAIL PROTECTED] writes: Both are clocking in at the same time (1m 5sec for 2.6Gb), are there any ways I can optimize either solution? Getting 40+ MB/sec through a file system is pretty impressive.

Re: Manipulate Large Binary Files

2008-04-03 Thread Derek Tracy
--- Derek Tracy [EMAIL PROTECTED] --- On Apr 3, 2008, at 3:03 AM, Paul Rubin http:// phr.cx@NOSPAM.invalid wrote: Derek Martin [EMAIL PROTECTED] writes: Both are clocking in at the same time (1m 5sec for 2.6Gb), are there any ways I can

Re: State of ctypes Support on HP-UX?

2008-04-03 Thread Thomas Heller
Phil Thompson schrieb: On Thursday 03 April 2008, Thomas Heller wrote: Phil Thompson schrieb: Could somebody confirm how well ctypes is supported on HP-UX (for both PA-RISC and Itanium) for both Python v2.4 and v2.5? I cannot answer your question, but if you want to try it out yourself

Re: Python in High School

2008-04-03 Thread ajaksu
On Apr 2, 5:01 pm, John Henry [EMAIL PROTECTED] wrote: However, once I start teaching him variables, expressions, loops, and what not, I found that (by surprise) he had great difficulties catching on.  Not soon after that, we had to quit. This makes me curious: how much of videogamer are you?

Re: Efficient way of testing for substring being one of a set?

2008-04-03 Thread Pop User
[EMAIL PROTECTED] wrote: Dennis Benzinger: You could use the Aho-Corasick algorithm http://en.wikipedia.org/wiki/ Aho-Corasick_algorithm. I don't know if there's a Python implementation yet. http://hkn.eecs.berkeley.edu/~dyoo/python/ahocorasick/

  1   2   >