Re: namespace dictionaries ok?

2005-10-25 Thread Ron Adam
James Stroud wrote: Oops. Answered before I finished reading the question. James Well, the one bad side effect (or feature depending on the circumstance), is it makes a copy. I wonder if there is a way to modify the dictionary in place with a function to do the same thing instead of

Re: Syntax across languages

2005-10-25 Thread Tim Roberts
[EMAIL PROTECTED] wrote: This post comes from a boring morning, if you are busy ignore this. This post is only for relaxed people. I've found this page, Syntax Across Languages, it contains many errors and omissions, but it's interesting.

Re: Tricky Areas in Python

2005-10-25 Thread Tim Roberts
PyPK [EMAIL PROTECTED] wrote: What possible tricky areas/questions could be asked in Python based Technical Interviews? What's the point of asking tricky questions? Aren't you really more interested in what applications they have worked on and whether they were successful? I don't know. I'm

grep

2005-10-25 Thread David Isaac
What's the standard replacement for the obsolete grep module? Thanks, Alan Isaac -- http://mail.python.org/mailman/listinfo/python-list

Re: calling matlab

2005-10-25 Thread David Isaac
hrh1818 [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] There is a module named pymat avvailable from http://sourceforge.net/projects/pymat that provides a limited set of functions for intertfacing Python to Matlab. I think that pymat was superceded by mlabwrap

pickle

2005-10-25 Thread Shi Mu
I got a sample code and tested it but really can not understand the use of pickle and dump: import pickle f = open(try.txt, w) pickle.dump(3.14, f) pickle.dump([1,2,3,4], f) f.close() -- http://mail.python.org/mailman/listinfo/python-list

Re: namespace dictionaries ok?

2005-10-25 Thread Ron Adam
James Stroud wrote: Here it goes with a little less overhead: py class namespace: ... def __init__(self, adict): ... self.__dict__.update(adict) ... py n = namespace({'bob':1, 'carol':2, 'ted':3, 'alice':4}) py n.bob 1 py n.ted 3 James How about... class

Re: grep

2005-10-25 Thread marduk
On Tue, 2005-10-25 at 06:45 +, David Isaac wrote: What's the standard replacement for the obsolete grep module? AFAIK there never was a grep module. There does, however exist a deprecated regex module: import regex __main__:1: DeprecationWarning: the regex module is deprecated; please use

Re: Microsoft Hatred FAQ

2005-10-25 Thread Antoon Pardon
Op 2005-10-24, David Schwartz schreef [EMAIL PROTECTED]: Antoon Pardon [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] Microsoft had something you need so badly that you could not go into business without it. So they demanded from you that you pay them what their software

Re: pickle

2005-10-25 Thread marduk
On Mon, 2005-10-24 at 23:55 -0700, Shi Mu wrote: I got a sample code and tested it but really can not understand the use of pickle and dump: import pickle f = open(try.txt, w) pickle.dump(3.14, f) pickle.dump([1,2,3,4], f) f.close() The pickle module serializes python objects. You

testing for modules?

2005-10-25 Thread Ed Hotchkiss
i have a generic script that is using several modules on windows and linux boxes. i need to have the scripts test if a module is installed, and then if not - then to install the module. can anyone give me a headsup on how to test for a module, returning something to indicate whether or not it is

Re: namespace dictionaries ok?

2005-10-25 Thread Steven D'Aprano
Simon Burton wrote: Yes! I do this a lot when i have deeply nested function calls a-b-c-d-e and need to pass args to the deep function without changing the middle functions. If you find yourself passing arguments to functions just so they can in turn pass them on to other functions,

Re: Redirect os.system output

2005-10-25 Thread Adriaan Renting
Maybe Pexpect can help you, I think it does what you want, I'm just not sure it works on windows, as I think it uses pty's. Please read it's FAQ about stdio buffer behaviour, I think it's also valid on Windows. pexpect.sourceforge.net Adriaan Renting. jas [EMAIL PROTECTED] 10/24/05 2:33 pm

Re: pickle

2005-10-25 Thread Shi Mu
what does the following code mean? y = pickle.load(file(cnumber.pickle, r)) also, I can not understand f in pickle.dump(x, f) On 10/25/05, marduk [EMAIL PROTECTED] wrote: On Mon, 2005-10-24 at 23:55 -0700, Shi Mu wrote: I got a sample code and tested it but really can not understand the

Re: Microsoft Hatred FAQ

2005-10-25 Thread David Schwartz
Antoon Pardon [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] I think you need to look up extortion in a dictionary. I can walk up to you and say if you want me to mow your lawn, you must pay me $1 every time you smoke a cigarette. So long as you can say no and all that

Hi All - Newby

2005-10-25 Thread Ask
G'day All, Just thought I'd drop in and say hi. I'm new to Python, but old to software development. Python is one of the languages used in my new job, so I've just bought a book, read it, and downloaded Python; It's pretty good isn't it? It's particularly handy being able top run the same

Re: Redirect os.system output

2005-10-25 Thread Paul Dale
You might want to try python expect which gives you a very simple and scriptable interface to a process. http://pexpect.sourceforge.net/ I've been using it on windows to automate a few things. Cheers, Paul jas wrote: Kent, Yes, your example does work. So did os.popen...however, the

Re: Microsoft Hatred FAQ

2005-10-25 Thread Peter T. Breuer
In comp.os.linux.misc Antoon Pardon [EMAIL PROTECTED] wrote: I think you need to look up extortion in a dictionary. I can walk up to you and say if you want me to mow your lawn, you must pay me $1 every time you smoke a cigarette. So long as you can say no and all that happens is that I

Re: namespace dictionaries ok?

2005-10-25 Thread Duncan Booth
Ron Adam wrote: James Stroud wrote: Here it goes with a little less overhead: example snipped But it's not a dictionary anymore so you can't use it in the same places you would use a dictionary. foo(**n) Would raise an error. So I couldn't do: def foo(**kwds):

Re: more than 100 capturing groups in a regex

2005-10-25 Thread Joerg Schuster
Some people, when confronted with a problem, think I know, I'll use regular expressions. Now they have two problems. --Jamie Zawinski Thanks for the citation. If my goal had been to redesign my program, I would not ask questions about regular expressions. I do not have the time to redesign my

Re: Microsoft Hatred FAQ

2005-10-25 Thread Peter T. Breuer
In comp.os.linux.misc David Schwartz [EMAIL PROTECTED] wrote: Yes, but that's the if. I have a monopoly on *me* mowing your lawn. You can, of course, go to someone else to have your lawn mowed. Of course you can't - why would anyone else be available to mow my lawn just because I want it

Re: Microsoft Hatred FAQ

2005-10-25 Thread David Schwartz
Peter T. Breuer [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] Essentially, Microsoft asked for exclusive arrangements. That is, arrangements wherein you could not sell competing products if you wished to sell Microsoft products. That's not even remotely unusual. It

Re: Microsoft Hatred FAQ

2005-10-25 Thread Adriaan Renting
David Schwartz [EMAIL PROTECTED] 10/25/05 6:06 am Do you think it would be immoral if Microsoft said, we will only sell Windows wholesale to dealers who don't sell other operating systems? DS 7 It goes one further as that, MS had the tactic of we will only sell Windows wholesale

Re: Syntax across languages

2005-10-25 Thread Duncan Booth
Tim Roberts wrote: - Nestable Pascal-like comments (useful): (* ... *) That's only meaningful in languages with begin-comment AND end-comment delimiters. Python has only begin-comment. Effectively, you CAN nest comments in Python: I believe that the OP is mistaken. In standard Pascal

Re: grep

2005-10-25 Thread Fredrik Lundh
marduk wrote: What's the standard replacement for the obsolete grep module? AFAIK there never was a grep module. There does, however exist a deprecated regex module: there was a grep module in 1.5.2 and earlier: http://effbot.org/librarybook/grep.htm but it was removed in 2.0 (or

Re: pickle

2005-10-25 Thread Fredrik Lundh
Shi Mu wrote: what does the following code mean? y = pickle.load(file(cnumber.pickle, r)) open the file cnumber.pickle for reading, pass the file handle to the pickle.load function, and store the result in the y variable. also, I can not understand f in pickle.dump(x, f) the second

Re: Microsoft Hatred FAQ

2005-10-25 Thread Peter T. Breuer
In comp.os.linux.misc David Schwartz [EMAIL PROTECTED] wrote: Peter T. Breuer [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] [DS, MS shill, said ..] Essentially, Microsoft asked for exclusive arrangements. That is, arrangements wherein you could not sell competing products if

Re: testing for modules?

2005-10-25 Thread Fredrik Lundh
Ed Hotchkiss wrote: i have a generic script that is using several modules on windows and linux boxes. i need to have the scripts test if a module is installed, and then if not - then to install the module. can anyone give me a headsup on how to test for a module, returning something to

Re: Setting a Limit to the Maximum Size of an Upload

2005-10-25 Thread Fredrik Lundh
Joey C. wrote: Here is a basic overview of the variables included there. params = cgi.FieldStorage() I accidentally made a mistake when typing what the thefile variable is. thefile = params[upfile].file upfile is the CGI field that contains the file that I'm uploading. As you can see, the

Re: Microsoft Hatred FAQ

2005-10-25 Thread Adriaan Renting
David Schwartz [EMAIL PROTECTED] 10/25/05 9:44 am % %Peter T. Breuer [EMAIL PROTECTED] wrote in message %news:[EMAIL PROTECTED] % %Essentially, Microsoft asked for exclusive arrangements. That is, %arrangements wherein you could not sell competing products if you wished %to %sell

Re: Hi All - Newby

2005-10-25 Thread bruno modulix
Ask wrote: G'day All, (snip) Welcome here... I must admit to much confusion regarding some of the basics, but I'm sure time, reading, and good advice will get rid of that. at this stage, it's just working through some examples and getting my head around things. As an example, if I

Re: [OT] Python vs Ruby

2005-10-25 Thread bruno modulix
Scott David Daniels wrote: bruno modulix wrote: Scott David Daniels wrote: bruno modulix wrote: ... Another language that failed to make it to the mainstream but is worth giving a try is Smalltalk - the father of OOPLs (Simula being the GrandFather). I would say Simula is the

Re: Hi All - Newby

2005-10-25 Thread Fredrik Lundh
Ask wrote: As an example, if I create a window, I've been unable to force it to be a certain size, and put a button (widget) at (say) 20,40 (x y). Is window formatting possible? I'm pretty sure all GUI toolkits can do that, but the exact details depend on the library you're using. (if

Re: Tricky Areas in Python

2005-10-25 Thread Peter Hansen
Tim Roberts wrote: PyPK [EMAIL PROTECTED] wrote: What possible tricky areas/questions could be asked in Python based Technical Interviews? What's the point of asking tricky questions? Aren't you really more interested in what applications they have worked on and whether they were

Re: more than 100 capturing groups in a regex

2005-10-25 Thread Peter Hansen
Joerg Schuster wrote: I just want to use more than 100 capturing groups. If someone told me that it is very unlikely for Python to get rid of the said limitation, I would recode part of my program in C++ using pcre. It is very unlikely for Python to get rid of the said limitation. -Peter --

migrate from ZODB 3.3.1 --- to where, and how?

2005-10-25 Thread Harald Armin Massa
Hello, I am using ZODB standalone in version 3.3.1 within some application. Now I learn that the 3.3.x branch of ZODB is retired. No problem so far, everything is running fine. BUT... retired gives me the hint that nothing GREAT will be done to this branch anymore :) Now I am questioning

Re: Tricky Areas in Python

2005-10-25 Thread Fredrik Lundh
Alex Martelli wrote: No, LC goes back a long way -- I think it was in 2.0 already, 2.1 for sure. $ python1.5 -c print [x for x in 'abc'] File string, line 1 print [x for x in 'abc'] ^ SyntaxError: invalid syntax $ python2.0 -c print [x for x in 'abc'] ['a', 'b', 'c'] I

Re: XML Tree Discovery (script, tool, __?)

2005-10-25 Thread Fredrik Lundh
[EMAIL PROTECTED] wrote: The output I was contemplating was a DOM DNA - that is the DOM without the instances of the elements or their data, a bare tree, a prototype tree based on what is in the document (rather than what is legal to include in the document). Just enough data that for an

RE: python cgi script not understood as html

2005-10-25 Thread Iyer, Prasad C
Your python script is not getting executed. I guess there is something wrong with the server configuration. #-Original Message- #From: Philippe C. Martin [mailto:[EMAIL PROTECTED] #Sent: Tuesday, October 25, 2005 1:27 AM #To: python-list@python.org #Subject: python cgi script not

cell and row

2005-10-25 Thread Shi Mu
I can not understand the use of cell and row in the code: # convert the matrix to a 1D list matrix = [[13,2,3,4,5],[0,10,6,0,0],[7,0,0,0,9]] items = [cell for row in matrix for cell in row] print items -- http://mail.python.org/mailman/listinfo/python-list

Re: Tricky Areas in Python

2005-10-25 Thread Fredrik Lundh
Alex Martelli wrote: my hard-won ignorance, and admit that I don't see the problem with the property examples: class Sic: def getFoo(self): ... def setFoo(self): ... foo = property(getFoo, setFoo) Sorry for skipping the 2nd argument to setFoo, that was

Re: Microsoft Hatred FAQ

2005-10-25 Thread Roedy Green
On Mon, 24 Oct 2005 21:06:36 -0700, David Schwartz [EMAIL PROTECTED] wrote, quoted or indirectly quoted someone who said : Do you think it would be immoral if Microsoft said, we will only sell Windows wholesale to dealers who don't sell other operating systems? I had an existing independent

Re: how to use new AST goodies

2005-10-25 Thread Fredrik Lundh
Simon Burton wrote: I'd like to experiment with this, does anyone know where to start ? with the once there is parts, probably (see below). It seems that the parser module still produces the same junk as before. So where do we find these nice high level AST objects ? here's a nice summary:

Re: Python/Apache Oddness On OSX

2005-10-25 Thread John Abel
[EMAIL PROTECTED] wrote: John Abel wrote: Hi, I'm running Python 2.3.5/2.4.2 on OSX 10.4.2, and am trying to run CGI scripts using the builtin Apache. For ease, I've symlinked my custom modules into the /Library/Python/2.3/site-packages directory, and they import OK via command line python.

Re: more than 100 capturing groups in a regex

2005-10-25 Thread Frithiof Andreas Jensen
Joerg Schuster [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] Hello, Python regular expressions must not have more than 100 capturing groups. Really ?? I have been waiting a long time now for Python to get rid of this limitation. Ahh - The dark side of Open Source: If nobody

Re: Missing modules '_ssl', 'ext.IsDOMString', 'ext.SplitQName'

2005-10-25 Thread uid09012_ti
Hi, unfortunately the result from py2exe won't run eventhough the original script runs without problems. The trouble is I'm at a loss as to where to start looking! Martin. -- http://mail.python.org/mailman/listinfo/python-list

Re: cell and row

2005-10-25 Thread Fredrik Lundh
Shi Mu wrote: I can not understand the use of cell and row in the code: # convert the matrix to a 1D list matrix = [[13,2,3,4,5],[0,10,6,0,0],[7,0,0,0,9]] items = [cell for row in matrix for cell in row] print items working through the Python tutorial might be a good idea. here's the

Re: more than 100 capturing groups in a regex

2005-10-25 Thread Frithiof Andreas Jensen
Joerg Schuster [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] Some people, when confronted with a problem, think I know, I'll use regular expressions. Now they have two problems. --Jamie Zawinski Thanks for the citation. If my goal had been to redesign my program, I would not ask

Re: more than 100 capturing groups in a regex

2005-10-25 Thread Joerg Schuster
What happens if you up the limit to whatever you need? Good idea. I just tried this. Nothing evil seems to happen. This seems to be a solution. Thanks. Jörg -- http://mail.python.org/mailman/listinfo/python-list

Re: Setting a Limit to the Maximum Size of an Upload

2005-10-25 Thread Joey C.
I'm afraid on my interpreter, this works. if os.path.getsize(C:\\Documents and Settings\\Joey\\Desktop\\file.txt) = 1000: print = 1000. = 1000. No problems there, as you can see. -- http://mail.python.org/mailman/listinfo/python-list

Re: more than 100 capturing groups in a regex

2005-10-25 Thread Fredrik Lundh
Joerg Schuster wrote: I just want to use more than 100 capturing groups. define more (101, 200, 1000, 10, ... ?) /F -- http://mail.python.org/mailman/listinfo/python-list

Re: cell and row

2005-10-25 Thread Shi Mu
In the follwoing code, Why the result is 'defenestrate', 'window', 'defenestrate', before the original list instead of 'defenestrate', 'window', ? a = ['defenestrate', 'cat', 'window', 'defenestrate'] for x in a[:]: ... if len(x) 4: a.insert(0, x) ... a ['defenestrate', 'window',

Re: Setting a Limit to the Maximum Size of an Upload

2005-10-25 Thread Fredrik Lundh
Joey C. wrote: I'm afraid on my interpreter, this works. if os.path.getsize(C:\\Documents and Settings\\Joey\\Desktop\\file.txt) = 1000: print = 1000. = 1000. No problems there, as you can see. I'm not sure if you replied to my post, but what I tried to say is that

Re: Upgrading 2.4.1 to 2.4.2

2005-10-25 Thread Vincent Gulinao
Hi, I'm new to python and just upgraded python on my system from 2.3 to 2.4. My platform is Linux-2.6.9-1.667smp-i686-with-redhat-3-Heidelberg. Is there any way to inherit (share?) all extensions and additional modules the my 2.3 have? (of course, beside re-installing everything) On 19 Oct 2005

Re: Setting a Limit to the Maximum Size of an Upload

2005-10-25 Thread Joey C.
Oh, I'm sorry, I didn't understand what you meant at first. Then I read your reply over again and noticed that you said that the problem lied in os.path.getsize() when I tried to run it on the contents of an open file. I'll try the method you outlined now. --

Re: python gc performance in large apps

2005-10-25 Thread Fredrik Lundh
Robby Dermody wrote: In the diagrams above, one can see the night-day separation clearly. At night, the memory usage growth seemed to all but stop, but with the increased call volume of the day, it started shooting off again. When I first started gathering this data, I was hoping for a

Re: A macro editor

2005-10-25 Thread Fabio Zadrozny
Hi Jaume, Pydev (http://pydev.sf.net) is an eclipse plugin that does code-completion for jython, so, it might be worth taking a look at it... Cheers, Fabio jau wrote: Hello mates. I'm part of a big project's developer team. We are writting an application in Java and we are planning to add

Re: Upgrading 2.4.1 to 2.4.2

2005-10-25 Thread Fredrik Lundh
Vincent Gulinao wrote: Hi, I'm new to python and just upgraded python on my system from 2.3 to 2.4. My platform is Linux-2.6.9-1.667smp-i686-with-redhat-3-Heidelberg. Is there any way to inherit (share?) all extensions and additional modules the my 2.3 have? (of course, beside re-installing

Reminder: PyCon proposals due in a week

2005-10-25 Thread A.M. Kuchling
The deadline for PyCon 2006 submissions is now only a week away. If you've been procrastinating about putting your outline together, now's the time to get going... Call for Proposals: http://www.python.org/pycon/2006/cfp Proposal submission site: http://submit.python.org/

Re: Upgrading 2.4.1 to 2.4.2

2005-10-25 Thread Fredrik Lundh
Hi, I'm new to python and just upgraded python on my system from 2.3 to 2.4. My platform is Linux-2.6.9-1.667smp-i686-with-redhat-3-Heidelberg. Is there any way to inherit (share?) all extensions and additional modules the my 2.3 have? (of course, beside re-installing everything) binary

Re: more than 100 capturing groups in a regex

2005-10-25 Thread Joerg Schuster
No limitation at all would be best. If a limitation is necessary, then the more capturing groups, the better. At the time being, I would be really happy about having the possibility to use 1 capturing groups. Jörg -- http://mail.python.org/mailman/listinfo/python-list

Re: pickle

2005-10-25 Thread Steve Holden
Shi Mu wrote: what does the following code mean? y = pickle.load(file(cnumber.pickle, r)) Take it by parts: file(cnumber.pickle, r) returns a file object as a result of opening the cnumber.pickle file, which is presumably a pickle someone wrote earlier. So

Re: Microsoft Hatred FAQ

2005-10-25 Thread David Schwartz
Roedy Green [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] On Mon, 24 Oct 2005 21:06:36 -0700, David Schwartz [EMAIL PROTECTED] wrote, quoted or indirectly quoted someone who said : Do you think it would be immoral if Microsoft said, we will only sell Windows wholesale to

Re: more than 100 capturing groups in a regex

2005-10-25 Thread Jorge Godoy
Joerg Schuster [EMAIL PROTECTED] writes: No limitation at all would be best. If a limitation is necessary, then the more capturing groups, the better. At the time being, I would be really happy about having the possibility to use 1 capturing groups. I'm sorry, I missed the beginning of

Re: cell and row

2005-10-25 Thread Steve Holden
Shi Mu wrote: In the follwoing code, Why the result is 'defenestrate', 'window', 'defenestrate', before the original list instead of 'defenestrate', 'window', ? a = ['defenestrate', 'cat', 'window', 'defenestrate'] for x in a[:]: ... if len(x) 4: a.insert(0, x) ... a

Re: Redirect os.system output

2005-10-25 Thread jas
Paul, I did ceck out the PExpect, however, I thought it was not ported for Windows. Did you find a ported version? If not, what did you have to do to be able to use it? Thanks Paul Dale wrote: You might want to try python expect which gives you a very simple and scriptable interface to a

Re: more than 100 capturing groups in a regex

2005-10-25 Thread Steve Holden
Joerg Schuster wrote: What happens if you up the limit to whatever you need? Good idea. I just tried this. Nothing evil seems to happen. This seems to be a solution. Thanks. Jörg The joys of open source. Just remember you have now made your program non-portable. Hope this isn't an

Re: Microsoft Hatred FAQ

2005-10-25 Thread Peter T. Breuer
In comp.os.linux.misc David Schwartz [EMAIL PROTECTED] wrote: 1) There is no other operating system worth selling. In this case, you are right, you have no choice but to sell the Microsoft OS, but the deal they're offering you harms you in no way. (Unless you intended to sell PCs with

Re: cell and row

2005-10-25 Thread Jan Niestadt
Because you're inserting items into your existing list instead of a new list. What you probably mean is: b = [] for x in a: b.append(x) which creates a new list b that contains all elements whose length is greater than four. A better way to write this would be: b = [x for x in a if

PDO and database abstraction

2005-10-25 Thread Luiz Geron
Hi all, I'm testing the PDO wrapper to database modules [1] and I'm wondering how few things like this there are around. My problem, actually, is the paramstyle of modules. I want to use kinterbasdb in the same code I use cx_oracle, for example, but paramstyle changes from one to other, than I

Re: Microsoft Hatred FAQ

2005-10-25 Thread David Schwartz
Peter T. Breuer [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] 3) there are plenty of other OSs that are developed or could be developed but which cannot get a foothold or even manage to be put on the shelves because the majority product producer insists on charging hardware

overiding assignment in module

2005-10-25 Thread Viktor Marohnic
Hello. I would to do something like this. container = [] p1 = point() l1 = line() and i would like to override = method of the module so that its puts all objects into container. how i can do something like that. thanks for help, viktor. -- http://mail.python.org/mailman/listinfo/python-list

Re: Microsoft Hatred FAQ

2005-10-25 Thread Eike Preuss
David Schwartz wrote: Peter T. Breuer [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] 3) there are plenty of other OSs that are developed or could be developed but which cannot get a foothold or even manage to be put on the shelves because the majority product producer insists on

Re: Microsoft Hatred FAQ

2005-10-25 Thread Roedy Green
On Tue, 25 Oct 2005 04:21:45 -0700, David Schwartz [EMAIL PROTECTED] wrote, quoted or indirectly quoted someone who said : 2) There are other realistic competing operating systems. In this case, you were foolish to agree to Microsoft's deal. You lost out on the realistic competing markets.

Re: more than 100 capturing groups in a regex

2005-10-25 Thread Joerg Schuster
but what is the reason for so much capturing groups? I imagine that coding this and keeping code maintenable is a huge effort. User input is compiled to regular expressions. The user does not have to worry about those groups. -- http://mail.python.org/mailman/listinfo/python-list

Re: PDO and database abstraction

2005-10-25 Thread Gerhard Häring
Luiz Geron wrote: Hi all, I'm testing the PDO wrapper to database modules [1] and I'm wondering how few things like this there are around. Actually there are several Object-Relation Mappers (ORM) for Python, and also a few other attempts to provide a more convenient layer on top of DB-API

Re: overiding assignment in module

2005-10-25 Thread Fredrik Lundh
Viktor Marohnic wrote: I would to do something like this. container = [] p1 = point() l1 = line() and i would like to override = method of the module so that its puts all objects into container. how i can do something like that. you cannot, at least not as you've described the problem.

Re: more than 100 capturing groups in a regex

2005-10-25 Thread Steven D'Aprano
On Tue, 25 Oct 2005 03:55:17 -0700, Joerg Schuster wrote: No limitation at all would be best. If a limitation is necessary, then the more capturing groups, the better. At the time being, I would be really happy about having the possibility to use 1 capturing groups. Do you really think

Re: more than 100 capturing groups in a regex

2005-10-25 Thread Joerg Schuster
The joys of open source. Just remember you have now made your program non-portable. Hope this isn't an issue. Of course portability is an issue -- on the long run. But on the short run I am really glad to be able to do a 1 second demo run on my notebook instead of a 20 seconds demo run. And I

Re: Microsoft Hatred FAQ

2005-10-25 Thread David Schwartz
Eike Preuss [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] Shouldn't it be my right as a seller, to decide that I want to sell an operating system 'that nobody wants' _as well as_ operating systems that 'everybody wants'? Yes, it certainly is. However, it is also Microsoft's

Re: more than 100 capturing groups in a regex

2005-10-25 Thread Iain King
Fredrik Lundh wrote: Joerg Schuster wrote: I just want to use more than 100 capturing groups. define more (101, 200, 1000, 10, ... ?) /F The Zero-One-Infinity Rule: http://www.catb.org/~esr/jargon/html/Z/Zero-One-Infinity-Rule.html Iain --

Re: overiding assignment in module

2005-10-25 Thread Steven D'Aprano
On Tue, 25 Oct 2005 04:56:02 -0700, Viktor Marohnic wrote: Hello. I would to do something like this. container = [] p1 = point() l1 = line() Choosing names that look like numbers is terrible practice. Don't use l, l1, O, ll, and so forth, unless you are trying to deliberately make your

Re: Read/Write from/to a process

2005-10-25 Thread jas
So it seems there is no good way to handle interactive processes on windows using python. By interactive I mean processes/commands that require user interaction, such as telnet or del (to delete a file or directory sometimes you need to confirm with a yes or no), date, etc. os.system gives the

Re: Microsoft Hatred FAQ

2005-10-25 Thread Peter T. Breuer
In comp.os.linux.misc David Schwartz [EMAIL PROTECTED] wrote: Peter T. Breuer [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] 3) there are plenty of other OSs that are developed or could be developed but which cannot get a foothold or even manage to be put on the shelves because the

Security on XML-RPC

2005-10-25 Thread dcrespo
Hi all, Anyone knows a simpler but stronger control access to XML-RPC functions than the one I comment here? My actual system works like this: I have a TCP Server and an XML-RPC Server. Both of them verify if the IP address is allowed. The TCP Server works for validate and register an IP

Re: more than 100 capturing groups in a regex

2005-10-25 Thread Jorge Godoy
Joerg Schuster [EMAIL PROTECTED] writes: but what is the reason for so much capturing groups? I imagine that coding this and keeping code maintenable is a huge effort. User input is compiled to regular expressions. The user does not have to worry about those groups. And what is the problem

swig problem

2005-10-25 Thread klemens letulé
Aloa, I'm new to python as to swig... so my question goes here. I am using swig to call a c function which returns a char*. I do this: ... i = 1 while i = 2: result, chainName = cgiServer.rpcGetTempParameterAttribut (//firewall-input[ + str(i) + ]) print

Re: Read/Write from/to a process

2005-10-25 Thread Steve Holden
jas wrote: So it seems there is no good way to handle interactive processes on windows using python. By interactive I mean processes/commands that require user interaction, such as telnet or del (to delete a file or directory sometimes you need to confirm with a yes or no), date, etc.

Re: Missing modules '_ssl', 'ext.IsDOMString', 'ext.SplitQName'

2005-10-25 Thread Peter Hansen
[EMAIL PROTECTED] wrote: unfortunately the result from py2exe won't run eventhough the original script runs without problems. The trouble is I'm at a loss as to where to start looking! Is there no exception traceback printed? Or some other error when you run the .exe? It would be very

Re: PDO and database abstraction

2005-10-25 Thread Luiz Geron
Excuse me if I wasn't clear. I don't want to use ORMs, since I really have to execute arbitrary sql queries, and then I can't use this object mapping. I'm going to write my own wrapper like you did, it is not so difficult to do. -- http://mail.python.org/mailman/listinfo/python-list

Re: Tricky Areas in Python

2005-10-25 Thread bruno modulix
beza1e1 wrote: let me try. 1) ''.join(lots_of_pieces) 2) This doesn't even work, if something is removed, the list is too short. So: [x for x in somelist if not isbad(x)] well, list comprehension is Python 2.4 2.2.x IIRC and 2.3 is the standard in many OSes, so it is possibly not

Re: PDO and database abstraction

2005-10-25 Thread Steve Holden
Gerhard Häring wrote: Luiz Geron wrote: Hi all, I'm testing the PDO wrapper to database modules [1] and I'm wondering how few things like this there are around. Actually there are several Object-Relation Mappers (ORM) for Python, and also a few other attempts to provide a more

Re: more than 100 capturing groups in a regex

2005-10-25 Thread Steven D'Aprano
On Tue, 25 Oct 2005 05:17:52 -0700, Iain King wrote: Fredrik Lundh wrote: Joerg Schuster wrote: I just want to use more than 100 capturing groups. define more (101, 200, 1000, 10, ... ?) /F The Zero-One-Infinity Rule:

Re: Confused on Kid

2005-10-25 Thread Damjan
I was investigating each subproject individually and could not, for the life of me figure out how Kid worked. I understand that it takes a well-formed XML document and transforms it, but I could not figure out where it transforms it, or how to transform a document. They have plenty of

Re: overiding assignment in module

2005-10-25 Thread Viktor Marohnic
Ok thanks a lot. I think i got the point. I also thought that it could be possible to do something like this globals().__setitem__ = custom_setter but __setitem__ is readonly -- http://mail.python.org/mailman/listinfo/python-list

Re: more than 100 capturing groups in a regex

2005-10-25 Thread Joerg Schuster
You did not quite understand me. I will give you some details: My program is a compiler for a certain type of linguistic grammars. I.e. the user gives *grammar files* to my program. When the grammar files have been compiled, they can be applied to strings (of a certain language, e.g. English).

Re: need some advice on x y plot

2005-10-25 Thread nephish
well, for what i tried, ticstrings just contained a list of times formatted like [10-21 09:15, 10-21 09:44, 10-21 09:59, and so on.] i did write mine a little different than the example that Grant gave me because its a little different application of time. i think i am having trouble knowing

Re: Read/Write from/to a process

2005-10-25 Thread jas
Steve Holden wrote: Look at how you might do it in other languages. Then you'll realise this isn't (just) a Python problem. Yea your right. However, for example, in Java, one can use the Process class, and then read from the stream until its the end (i.e. -1 is returned). However, with Python

Re: cell and row

2005-10-25 Thread Jan Niestadt
Doh, the first example should of cours be: b = [] for x in a: if len(x) 4: b.append(x) -- http://mail.python.org/mailman/listinfo/python-list

Re: Tricky Areas in Python

2005-10-25 Thread Gerhard Häring
bruno modulix wrote: beza1e1 wrote: well, list comprehension is Python 2.4 2.2.x IIRC List comprehensions were introduced in Python 2.0, according to the What's new in ... document at http://www.amk.ca/python/2.0/index.html#SECTION00060 -- Gerhard --

  1   2   3   >