Re: zipfile stupidly broken

2007-05-19 Thread Nick Craig-Wood
Martin Maney <[EMAIL PROTECTED]> wrote: > Nick Craig-Wood <[EMAIL PROTECTED]> wrote: > > You don't need to do that, you can just "monkey patch" the _EndRecData > > function. > > For a quick & dirty test, sure. If I were certain I'd only ever use > this on one machine for a limited time (viz, n

Re: What is deployment?

2007-05-19 Thread Paul Rubin
Ben Finney <[EMAIL PROTECTED]> writes: > Agreed. I usually discuss "deployment" as meaning "everything required > to take something from the point of working in a vendor's lab > environment, to an actual working installation in a production > environment". I'd go beyond that. It includes putting

Re: Can't embed python in C++(Mingw[3.*] compiler)

2007-05-19 Thread Arjun Narayanan
On May 20, 1:28 am, "Gabriel Genellina" <[EMAIL PROTECTED]> wrote: > En Sat, 19 May 2007 13:14:40 -0300, Arjun Narayanan > <[EMAIL PROTECTED]> escribió: > > > For thr program, > > #include "E:\Python25\include\Python.h" > > #include > > Configure your environment so using: > > #include > > works (

Re: What is deployment?

2007-05-19 Thread Ben Finney
Paul Rubin writes: > [EMAIL PROTECTED] (Cameron Laird) writes: > > all those things that happen after narrow-sense installation are > > still part of "deployment". > > Deployment also refers to pre-installation issues, like buying the > hardware that you're going to inst

Closing socket file descriptors

2007-05-19 Thread Yang
Hi, I'm experiencing a problem when trying to close the file descriptor for a socket, creating another socket, and then closing the file descriptor for that second socket. I can't tell if my issue is about Python or POSIX. In the following, the first time through, everything works. On the sec

Re: Inverse of id()?

2007-05-19 Thread Alex Martelli
Paul McGuire <[EMAIL PROTECTED]> wrote: > Is there an inverse function to the builtin 'id'? The poster who No, there isn't. > Now is there anything better than this search technique to get back a > variable, given its id? For your own classes/types, you could override __new__ to maintain a cla

Re: interesting dict bug

2007-05-19 Thread Sick Monkey
Ahhh thank you so much! I just added a ".encode('utf-8')" to the variables causing problems and that resolved my issue. Much appreciated! .dave On 5/19/07, Jeff McNeil <[EMAIL PROTECTED]> wrote: Filename is a unicode string. See http://www.diveintopython.org/xml_processing/unicode.html or htt

Re: PEP 3131: Supporting Non-ASCII Identifiers

2007-05-19 Thread Istvan Albert
On May 19, 3:33 am, "Martin v. Löwis" <[EMAIL PROTECTED]> wrote: > >That would be invalid syntax since the third line is an assignment > > with target identifiers separated only by spaces. > > Plus, the identifier starts with a number (even though 6 is not DIGIT > SIX, but FULLWIDTH DIGIT SIX,

Re: zipfile [module and file format, both] stupidly broken

2007-05-19 Thread Martin Maney
Gabriel Genellina <[EMAIL PROTECTED]> wrote: > A module in the Python Standard Library has a bug. I take the Python > Library Reference manual, go to the last pages (Appendix B), and find how > to properly report a bug. Sure, the information is *somewhere*. Silly me, I expected it to be readi

Re: What is deployment?

2007-05-19 Thread Steve Holden
Paul Rubin wrote: > [EMAIL PROTECTED] (Cameron Laird) writes: >> What might C. mean? Say I install a program, but I still have to worry >> about how I'm going to configure it within the cluster where I intend to >> use it, AND I need to co-ordinate its configuration with the central >> database o

Re: regex matching question

2007-05-19 Thread bullockbefriending bard
> > No way? Famous last words :-) > > C:\junk>type showargs.py > import sys; print sys.argv > > C:\junk>\python25\python > Python 2.5.1 (r251:54863, Apr 18 2007, 08:51:08) [MSC v.1310 32 bit > (Intel)] on win32 > Type "help", "copyright", "credits" or "license" for more information. > >>> import

Re: interesting dict bug

2007-05-19 Thread Jeff McNeil
Filename is a unicode string. See http://www.diveintopython.org/xml_processing/unicode.html or http://docs.python.org/tut/node5.html#SECTION00513. Python 2.5 (r25:51918, Sep 19 2006, 08:49:13) [GCC 4.0.1 (Apple Computer, Inc. build 5341)] on darwin Type "help", "copyright", "credit

Re: Start

2007-05-19 Thread Benjamin
On May 19, 10:18 am, Nautilus <[EMAIL PROTECTED]> wrote: > Can anybody halp me start using Python. First you'll need to download Python. You can do that at http://www.python.org. Then download and read the tutorial at http://python.org/doc/. -- http://mail.python.org/mailman/listinfo/python-list

interesting dict bug

2007-05-19 Thread Sick Monkey
Here is a segment of some code that I have. CODE: -- print filename params2 = {'filename':filename,'id3title':title,'id3artist':artist,'id3album':album,'id3year':year,'id3track':track,'id3genre':genre,'uname':username,'password':password,'filesToUpload':open(file, 'rb')} print pa

Re: What is deployment? (was: A Few More Forrester Survey Questions)

2007-05-19 Thread Paul Rubin
[EMAIL PROTECTED] (Cameron Laird) writes: > What might C. mean? Say I install a program, but I still have to worry > about how I'm going to configure it within the cluster where I intend to > use it, AND I need to co-ordinate its configuration with the central > database on which it depends, AND

Re: (Modular-)Application Framework / Rich-Client-Platform in Python

2007-05-19 Thread Ben Finney
Wildemar Wildenburger <[EMAIL PROTECTED]> writes: > I really, really appreciate the effort you (all of you) make in > helping me and getting me on the right track, but I'm a bit > confounded by how you can be trying to convince me that the tools > I'm currently reading the docs for don't exist. I

Re: [dfwPython] A Few More Forrester Survey Questions

2007-05-19 Thread Cameron Laird
In article <[EMAIL PROTECTED]>, Brad Allen <[EMAIL PROTECTED]> wrote: >At 10:22 AM -0500 5/18/07, Jeff Rush wrote: . . . >>3) What is the value of the language to developers? >> >>Yeah, a very common, slippery question. T

What is deployment? (was: A Few More Forrester Survey Questions)

2007-05-19 Thread Cameron Laird
In article <[EMAIL PROTECTED]>, Jeff Rush <[EMAIL PROTECTED]> wrote: . . . >2) How easy is it to install an application written in the language? > How is the application deployed? > > I'm having some trouble understanding

Re: python shell

2007-05-19 Thread Peter Anderson
Krypto wrote: > I have been using python shell to test small parts of the big program. > What other ways can I use the shell effectively. My mentor told me > that you can virtually do anything from testing your program to > anything in the shell. Any incite would be useful. > I'm not sure this wi

Re: regex matching question

2007-05-19 Thread Steve Holden
John Machin wrote: > On 20/05/2007 10:18 AM, bullockbefriending bard wrote: >>> Instead of the "or match.group(0) != results" caper, put \Z (*not* $) at >>> the end of your pattern: >>> mobj = re.match(r"pattern\Z", results) >>> if not mobj: >> as the string i am matching against is coming

Re: mod_python performs several magnitudes slower than PHP?

2007-05-19 Thread Graham Dumpleton
On May 20, 10:01 am, John Nagle <[EMAIL PROTECTED]> wrote: > That's puzzling, because withmod_python, you're only invoking > the compiler once per Apache restart. With CGI programs, you pay > the loading penalty on every request. > > John Nagle > > [EMAIL PROTEC

Re: docs patch: dicts and sets

2007-05-19 Thread Steve Holden
7stud wrote: >> Actually, it would just move the "endless, petty discussions about what >> minutiae are more important" into the docs. I don't see how that's an >> improvement. > > Because it highlights the issues you will be faced with when using the > described functions. People will post about

Re: regex matching question

2007-05-19 Thread John Machin
On 20/05/2007 10:18 AM, bullockbefriending bard wrote: >> Instead of the "or match.group(0) != results" caper, put \Z (*not* $) at >> the end of your pattern: >> mobj = re.match(r"pattern\Z", results) >> if not mobj: > > as the string i am matching against is coming from a command line > a

Re: python shell

2007-05-19 Thread Steve Holden
Cameron Laird wrote: > In article <[EMAIL PROTECTED]>, > Paddy <[EMAIL PROTECTED]> wrote: >> On May 16, 6:38 pm, Krypto <[EMAIL PROTECTED]> wrote: >>> I have been using python shell to test small parts of the big program. >>> What other ways can I use the shell effectively. My mentor told me >>> t

Re: Typed named groups in regular expression

2007-05-19 Thread Hugo Ferreira
Both Paddy (hackish) and McGuire (right tool for the job) ideas sound very interesting ;-) I'll definitely research on them further. Thanks for the support... On 19 May 2007 04:39:58 -0700, Paul McGuire <[EMAIL PROTECTED]> wrote: > On May 19, 12:32 am, Paddy <[EMAIL PROTECTED]> wrote: > > On May

Re: converting strings to most their efficient types '1' --> 1, 'A' ---> 'A', '1.2'---> 1.2

2007-05-19 Thread John Machin
On 19/05/2007 3:14 PM, Paddy wrote: > On May 19, 12:07 am, py_genetic <[EMAIL PROTECTED]> wrote: >> Hello, >> >> I'm importing large text files of data using csv. I would like to add >> some more auto sensing abilities. I'm considing sampling the data >> file and doing some fuzzy logic scoring on

Re: How to convert a number to binary?

2007-05-19 Thread Cameron Laird
In article <[EMAIL PROTECTED]>, Lyosha <[EMAIL PROTECTED]> wrote: . . . >While I agree with this general statement, I think remembering a >particular one-liner to convert a number to a binary is more valuable >to my brain than

Re: python shell

2007-05-19 Thread Cameron Laird
In article <[EMAIL PROTECTED]>, Paddy <[EMAIL PROTECTED]> wrote: >On May 16, 6:38 pm, Krypto <[EMAIL PROTECTED]> wrote: >> I have been using python shell to test small parts of the big program. >> What other ways can I use the shell effectively. My mentor told me >> that you can virtually do anyth

Re: regex matching question

2007-05-19 Thread bullockbefriending bard
> Here "all pairs different" means "for each pair, both numbers must be > different", but they may appear in another pair. That is, won't flag > "1,2/3,4/3,5/2,6/8,3/1,2" as invalid, but this wasn't clear from your > original post. > > -- > Gabriel Genellina thanks! you are correct that the

Re: regex matching question

2007-05-19 Thread bullockbefriending bard
> Instead of the "or match.group(0) != results" caper, put \Z (*not* $) at > the end of your pattern: > mobj = re.match(r"pattern\Z", results) > if not mobj: as the string i am matching against is coming from a command line argument to a script, is there any reason why i cannot get away wi

Re: converting strings to most their efficient types '1' --> 1, 'A' ---> 'A', '1.2'---> 1.2

2007-05-19 Thread John Machin
On 19/05/2007 9:17 PM, James Stroud wrote: > John Machin wrote: >> The approach that I've adopted is to test the values in a column for >> all types, and choose the non-text type that has the highest success >> rate (provided the rate is greater than some threshold e.g. 90%, >> otherwise it's te

Re: mod_python performs several magnitudes slower than PHP?

2007-05-19 Thread John Nagle
That's puzzling, because with mod_python, you're only invoking the compiler once per Apache restart. With CGI programs, you pay the loading penalty on every request. John Nagle [EMAIL PROTECTED] wrote: > Recently I've had to move my site to a new dedicated ser

Re: regex matching question

2007-05-19 Thread bullockbefriending bard
> Backslash? Your example uses a [forward] slash. correct.. my mistake. i use forward slashes. > Are you sure you don't want to allow for some spaces in the data, for > the benefit of the humans, e.g. > 1,2 / 3,4 / 5,6 / 7,8 / 9,10 / 11,12 you are correct. however, i am using string as a co

Inverse of id()?

2007-05-19 Thread Paul McGuire
Is there an inverse function to the builtin 'id'? The poster who asked about 1-to-1, 1-to-n, etc. relationships (presumably in CS terms - I hope I didn't misread some porn spam by mistake), got me thinking about containers and ids, and what kind of a container would implement a many-to-many. I ha

Re: regex matching question

2007-05-19 Thread John Machin
On 20/05/2007 3:21 AM, bullockbefriending bard wrote: > first, regex part: > > I am new to regexes and have come up with the following expression: > ((1[0-4]|[1-9]),(1[0-4]|[1-9])/){5}(1[0-4]|[1-9]),(1[0-4]|[1-9]) > > to exactly match strings which look like this: > > 1,2/3,4/5,6/7,8/9

mod_python performs several magnitudes slower than PHP?

2007-05-19 Thread chris . monsanto
Recently I've had to move my site to a new dedicated server running FreeBSD 6.1. After installing apache 2.0.59, python 2.4.4 and mod_python 3.3.1, I decided to bench a script in PHP vs one in Python. I found out that for some reason, my mod_python was performing extremely slow - magnitudes slower

Re: regex matching question

2007-05-19 Thread Gabriel Genellina
En Sat, 19 May 2007 19:40:39 -0300, bullockbefriending bard <[EMAIL PROTECTED]> escribió: > from my cursory skimming of friedl, i get the feeling that the all > pairs different constraint would give rise to some kind of fairly > baroque expression, perhaps likely to bring to mind the following >

Re: regex matching question

2007-05-19 Thread bullockbefriending bard
thanks for your suggestion. i had already implemented the all pairs different constraint in python code. even though i don't really need to give very explicit error messages about what might be wrong with my data (obviously easier to do if do all constraint validation in code rather than one regex)

Re: docs patch: dicts and sets

2007-05-19 Thread 7stud
>Actually, it would just move the "endless, petty discussions about what >minutiae are more important" into the docs. I don't see how that's an >improvement. Because it highlights the issues you will be faced with when using the described functions. People will post about an issue they had with a

Re: dislin titlin and string decode

2007-05-19 Thread Gabriel Genellina
En Sat, 19 May 2007 18:28:51 -0300, luis <[EMAIL PROTECTED]> escribió: > The problem was the value of dislin.chacod. This must be 'ISO1' not > the default ('STANDAR') I used to use DISLIN some time ago, but now I use PyChart most of the time. Its convoluted interfase (mostly due to Fortran supp

Re: dislin titlin and string decode

2007-05-19 Thread luis
On 19 mayo, 12:56, luis <[EMAIL PROTECTED]> wrote: > Hello! > > I have an unespectedn result with dislin titlin > > dislin.metafl ('WMF') > dislin.disini () > > > a="Andrés or Ramón" > dislin.titlin (a.encode("Latin-1"), 1) > # not error raised, is ok > > > dislin.disfin () > > In the out

Re: [Bulk] Re: Python compared to other language

2007-05-19 Thread scott
Michael Torrie wrote: > I think the original poster will find Python, and may wxPython, > satisfies the bulk of his development needs. True, I like how Python is a general language that can be used for many different purposes and hope to learn wxPython as well. I have read through the archives

Re: zipfile [module and file format, both] stupidly broken

2007-05-19 Thread Gabriel Genellina
En Sat, 19 May 2007 14:00:01 -0300, Martin Maney <[EMAIL PROTECTED]> escribió: > BTW, thanks for the pointer someone else gave to the proper place for > posting bugs. I'd had the silly idea that I would be able to find that > easily at www.python.org, but if I had then I'd not have posted here

Re: getting thread object from SocketServer.ThreadingTCPServer

2007-05-19 Thread Gabriel Genellina
En Sat, 19 May 2007 14:40:55 -0300, Brad Brock <[EMAIL PROTECTED]> escribió: > Hi list. I have a little problem when using > SocketServer.ThreadingTCPServer. I want to make a list > of thread-objects generated by the > ThreadingTCPServer. How can I get the thread object? If getting the list of

Re: List Moderator

2007-05-19 Thread Steve Holden
Dotan Cohen wrote: > On 19/05/07, Steve Holden <[EMAIL PROTECTED]> wrote: >> I'm sorry, but you have no idea what you are talking about. Most of what >> can be done *is* being done, which is why you see the relatively low >> spam volumes you do. > > I hope that I don't. I receive no less than 700

Re: Can't embed python in C++(Mingw[3.*] compiler)

2007-05-19 Thread Gabriel Genellina
En Sat, 19 May 2007 13:14:40 -0300, Arjun Narayanan <[EMAIL PROTECTED]> escribió: > For thr program, > #include "E:\Python25\include\Python.h" > #include Configure your environment so using: #include works (you may need to add E:\Python25\include to some list of searched directories, maybe

Re: _PyObject_New / PyObject_Init / PyInstance_New / etc?

2007-05-19 Thread Gabriel Genellina
En Sat, 19 May 2007 10:54:32 -0300, Gre7g Luterman <[EMAIL PROTECTED]> escribió: > I'm so confuzzled! How do I instantiate my new C Python object from C? > I tried inserting some code with _PyObject_New and PyObject_Init: > > Then I compiled, went into the Python interpreter and tried it. I wou

Re: List Moderator

2007-05-19 Thread Dotan Cohen
On 19/05/07, Steve Holden <[EMAIL PROTECTED]> wrote: > I'm sorry, but you have no idea what you are talking about. Most of what > can be done *is* being done, which is why you see the relatively low > spam volumes you do. > I hope that I don't. I receive no less than 700 spams a day to my regular

Re: PEP 3131: Supporting Non-ASCII Identifiers

2007-05-19 Thread Peter Maas
Martin v. Löwis wrote: > Python code is written by many people in the world who are not familiar > with the English language, or even well-acquainted with the Latin > writing system. I believe that there is a not a single programmer in the world who doesn't know ASCII. It isn't hard to learn the l

Re: docs patch: dicts and sets

2007-05-19 Thread Robert Kern
7stud wrote: > On May 19, 12:36 pm, Steve Holden <[EMAIL PROTECTED]> wrote: >> The last thing I want to read in a language's documentation is an >> ill-informed and sometimes interminable argument about a particular feature. > > Yet some readers will be able to get to the bottom of an issue they >

Re: docs patch: dicts and sets

2007-05-19 Thread Steven Bethard
7stud wrote: > On May 19, 9:06 am, Steven Bethard <[EMAIL PROTECTED]> wrote: >> Alan Isaac wrote: >>> I submitted the language based on Bill and Carsten's proposals: >>> https://sourceforge.net/tracker/?func=detail&atid=105470&aid=1721372&;... >>> That language has been rejected. >>> You many want

Re: PEP 3131: Supporting Non-ASCII Identifiers

2007-05-19 Thread René Fleschenberg
Martin v. Löwis schrieb: >>> Then get tools that match your working environment. >> Integration with existing tools *is* something that a PEP should >> consider. This one does not do that sufficiently, IMO. > > What specific tools should be discussed, and what specific problems > do you expect? S

Re: Python-URL! - weekly Python news and links (May 16)

2007-05-19 Thread Grant Edwards
On 2007-05-17, Beliavsky <[EMAIL PROTECTED]> wrote: > >> QOTW: "Sometimes you just have to take the path of least >> distaste". - Grant Edwards >> >> "I want to choose my words carefully here, so I'm not misunderstood. > > > > I think Cameron Laird does a good job with the Python digest > but blu

Re: PEP 3131: Supporting Non-ASCII Identifiers

2007-05-19 Thread René Fleschenberg
Martin v. Löwis schrieb: > I've reported this before, but happily do it again: I have lived many > years without knowing what a "hub" is, and what "to pass" means if > it's not the opposite of "to fail". Yet, I have used their technical > meanings correctly all these years. I was not speaking of t

Re: RFC - n-puzzle.py

2007-05-19 Thread Peter Otten
Phoe6 wrote: > I would like to request a code and design review of one of my program. > n-puzzle.py > I have used OO Python for the above program and would like comments on > my approach as I am just starting with OOP. [The following has nothing to do with OOP, I just read Raymond's post and got

Re: docs patch: dicts and sets

2007-05-19 Thread 7stud
On May 19, 12:36 pm, Steve Holden <[EMAIL PROTECTED]> wrote: > The last thing I want to read in a language's documentation is an > ill-informed and sometimes interminable argument about a particular feature. > Yet some readers will be able to get to the bottom of an issue they are having by readin

Re: docs patch: dicts and sets

2007-05-19 Thread Steve Holden
7stud wrote: > On May 19, 11:38 am, Steve Holden <[EMAIL PROTECTED]> wrote: >> Except in those instances where users added information that was >> explicitly wrong. > > It's a self correcting mechanism. Other reader's will spot the error > and post corrections. > The last thing I want to read in

Re: regex matching question

2007-05-19 Thread Marc 'BlackJack' Rintsch
In <[EMAIL PROTECTED]>, bullockbefriending bard wrote: > first, regex part: > > I am new to regexes and have come up with the following expression: > ((1[0-4]|[1-9]),(1[0-4]|[1-9])/){5}(1[0-4]|[1-9]),(1[0-4]|[1-9]) > > to exactly match strings which look like this: > > 1,2/3,4/5,6/7,8

Re: Writelines() a bit confusing

2007-05-19 Thread Gabriel Genellina
En Sat, 19 May 2007 10:31:50 -0300, Stefan Sonnenberg-Carstens <[EMAIL PROTECTED]> escribió: > so you'd want this: > > f.writelines([x+os.linesep for x in strings]) > > or something similar. You would use os.linesep *only* if the file was opened in binary mode - unusual if you want to write l

Re: Python compared to other language

2007-05-19 Thread Michael Torrie
On Fri, 2007-05-18 at 22:28 -0400, Steve Holden wrote: > Surely the fact that Python is available on so many platforms implies > that C is a fairly portable language. I realise that you have to take > platform specifics into account much more than you do in Python, but I > do feel you are being

Re: docs patch: dicts and sets

2007-05-19 Thread 7stud
On May 19, 11:38 am, Steve Holden <[EMAIL PROTECTED]> wrote: > Except in those instances where users added information that was > explicitly wrong. It's a self correcting mechanism. Other reader's will spot the error and post corrections. -- http://mail.python.org/mailman/listinfo/python-list

getting thread object from SocketServer.ThreadingTCPServer

2007-05-19 Thread Brad Brock
Hi list. I have a little problem when using SocketServer.ThreadingTCPServer. I want to make a list of thread-objects generated by the ThreadingTCPServer. How can I get the thread object? Thank you. Lookin

Re: Many-to-many pattern possiable?

2007-05-19 Thread 7stud
On May 19, 10:33 am, Jia Lu <[EMAIL PROTECTED]> wrote: > Hi all > > I see dict type can do 1-to-1 pattern, But is there any method to do > 1-to-many, many-to-1 and many-to-many pattern ? How about: one_to_many = {"a":[10, "red", 2.5]} many_to_1 = {("red", 2.5, 3):"hello"} many_to_many = {("red

Re: docs patch: dicts and sets

2007-05-19 Thread Steve Holden
7stud wrote: > On May 19, 9:06 am, Steven Bethard <[EMAIL PROTECTED]> wrote: >> Alan Isaac wrote: >>> I submitted the language based on Bill and Carsten's proposals: >>> https://sourceforge.net/tracker/?func=detail&atid=105470&aid=1721372&;... >>> That language has been rejected. >>> You many want

Re: RFC - n-puzzle.py

2007-05-19 Thread Steve Holden
Peter Otten wrote: > Steve Holden wrote: > >> Phoe6 wrote: >>> On May 19, 2:23 pm, Raymond Hettinger <[EMAIL PROTECTED]> wrote: Instead of: short_path = mdists[0] if mdists.count(short_path) > 1: write: short_path = mdists[0] if short_path in mdists[1:

Re: No Python for Blackberry?

2007-05-19 Thread Tommy Nordgren
On 19 maj 2007, at 03.19, walterbyrd wrote: > I could not find a version of Python that runs on a Blackberrry. > > I'm just amazed. A fairly popular platform, and no Python > implementation? > Download the sources and try compiling it yourself. On most platforms Expand the archive. Then e

Re: Python compared to other language

2007-05-19 Thread Steve Holden
walterbyrd wrote: > On May 19, 7:23 am, Steve Holden <[EMAIL PROTECTED]> wrote: > >> The reason you can do this with Python is precisely because the >> developers have ironed out the wrinkles between platforms by putting the >> requisite conditionals in the C source. > > But that is my point. Wit

Re: Beginner question: module organisation

2007-05-19 Thread 7stud
On May 19, 10:45 am, 7stud <[EMAIL PROTECTED]> wrote: > > refineModule.py: > --- > def refine(userfunc, mesh): > #process mesh > func(mesh) > The last line should be: userfunc(mesh) -- http://mail.python.org/mailman/listinfo/python-list

regex matching question

2007-05-19 Thread bullockbefriending bard
first, regex part: I am new to regexes and have come up with the following expression: ((1[0-4]|[1-9]),(1[0-4]|[1-9])/){5}(1[0-4]|[1-9]),(1[0-4]|[1-9]) to exactly match strings which look like this: 1,2/3,4/5,6/7,8/9,10/11,12 i.e. 6 comma-delimited pairs of integer numbers separated b

Re: Many-to-many pattern possiable?

2007-05-19 Thread Raymond Hettinger
On May 19, 9:33 am, Jia Lu <[EMAIL PROTECTED]> wrote: > I see dict type can do 1-to-1 pattern, But is there any method to do > 1-to-many, many-to-1 and many-to-many pattern ? >>> mm = {'a': ['A', 'B', 'C'], 'c': ['C', 'D', 'E'], 'b': ['A', 'D']} >>> # Now, invert the relation >>> mmr = {} >>> fo

Structuring the code of a wiki parsing engine

2007-05-19 Thread Michiel Sikma
Hello everybody. I'm kind of new to Python. I'm working on a simple text parser that will allow me to transform a certain syntax into a certain output. I find wikis interesting, so wiki to HTML parsing is one of the things that I want to accomplish (I'm not actually writing a whole wiki, th

Re: Many-to-many pattern possiable?

2007-05-19 Thread Gre7g Luterman
"Jia Lu" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > I see dict type can do 1-to-1 pattern, But is there any method to do > 1-to-many, many-to-1 and many-to-many pattern ? Dict objects can do many-to-1 relationships. Dict[Key1] = Obj Dict[Key2] = Obj Dict[Key3] = Obj 1-to-man

Re: Python-URL! - weekly Python news and links (May 16)

2007-05-19 Thread Fred Pacquier
[EMAIL PROTECTED] (Cameron Laird) said : > I'll make a few personal comments. > > I knew the choice of quotes was in questionable taste. I was > out to be provocative without being offensive, though. My > apologies to Mr. Beliavsky and anyone else I disappointed. On > the whole, I still think

Re: zipfile [module and file format, both] stupidly broken

2007-05-19 Thread Martin Maney
Larry Bates <[EMAIL PROTECTED]> bristled: > Are you serious? A zipfile with a comment > 4Kbytes. I've never encountered > such a beast. If I hadn't run into one I would never have had a clue that Python's zipfile module had this silly bug. > As with any open source product it is much better to r

Re: zipfile stupidly broken

2007-05-19 Thread Martin Maney
Nick Craig-Wood <[EMAIL PROTECTED]> wrote: > To search 64k for all zip files would slow down the opening of all zip > files whereas most zipfiles don't have comments. No, actually it would only slow down for files which do have comments, assuming I understand the code correctly. IME most zipfiles

Re: No Python for Blackberry?

2007-05-19 Thread David Boddie
On Saturday 19 May 2007 03:19, walterbyrd wrote: > I could not find a version of Python that runs on a Blackberrry. > > I'm just amazed. A fairly popular platform, and no Python > implementation? If you can get the hardware into the hands of capable developers, they'll put Python on it. ;-) Dav

Re: docs patch: dicts and sets

2007-05-19 Thread 7stud
On May 19, 9:06 am, Steven Bethard <[EMAIL PROTECTED]> wrote: > Alan Isaac wrote: > > I submitted the language based on Bill and Carsten's proposals: > > >https://sourceforge.net/tracker/?func=detail&atid=105470&aid=1721372&;... > > > That language has been rejected. > > You many want to read the d

Re: Beginner question: module organisation

2007-05-19 Thread 7stud
On May 14, 7:09 am, [EMAIL PROTECTED] wrote: > Hello :) > > I am new to python and I don't have much expirience in object-oriented > technologies neither. > > The problem is the following: I have to create a simple python > template script that will always follow the same algorithm, let's say: > -

Many-to-many pattern possiable?

2007-05-19 Thread Jia Lu
Hi all I see dict type can do 1-to-1 pattern, But is there any method to do 1-to-many, many-to-1 and many-to-many pattern ? What about using some Serialized objects? Thanks. -- http://mail.python.org/mailman/listinfo/python-list

Re: PEP 3131: Supporting Non-ASCII Identifiers

2007-05-19 Thread Richard Hanson
On Fri, 18 May 2007 06:28:03 +0200, Martin v. Löwis wrote: [excellent as always exposition by Martin] Thanks, Martin. > P.S. Anybody who wants to play with generating visualisations > of the PEP, here are the functions I used: [code snippets] Thanks for those functions, too -- I've been explo

Re: Python compared to other language

2007-05-19 Thread walterbyrd
On May 19, 9:36 am, [EMAIL PROTECTED] (Alex Martelli) wrote: > > From these numbers it would seem that Ruby (and PHP) aren't really more > web-specific than Perl (and Python). > Excellent find, nice work. However, if it is found that there are "X" many PHP programs running payroll applications, do

Can't embed python in C++(Mingw[3.*] compiler)

2007-05-19 Thread Arjun Narayanan
For thr program, #include "E:\Python25\include\Python.h" #include int main(int argc, char* argv[]){ Py_Initialise(); Py_Finalise(); return 0; } I get the errors, main.cpp:7: `Py_Initialise' undeclared (first use this function) main.cpp:7: (Each undeclared identifier is reported only on

Re: Writelines() a bit confusing

2007-05-19 Thread aiwarrior
On May 19, 2:46 pm, "Gre7g Luterman" <[EMAIL PROTECTED]> wrote: > "aiwarrior" <[EMAIL PROTECTED]> wrote in message > > news:[EMAIL PROTECTED] > > > If file.WriteLines( seq ) accepts a list and it says it writes lines, > > why does it write the whole list in a single line. Be cause of that > > the r

Re: Python compared to other language

2007-05-19 Thread walterbyrd
On May 19, 7:23 am, Steve Holden <[EMAIL PROTECTED]> wrote: > The reason you can do this with Python is precisely because the > developers have ironed out the wrinkles between platforms by putting the > requisite conditionals in the C source. But that is my point. With Python, the language itself

Re: Start

2007-05-19 Thread Glich
I got started here: http://showmedo.com/videos/python -- http://mail.python.org/mailman/listinfo/python-list

Re: RFC - n-puzzle.py

2007-05-19 Thread Peter Otten
Steve Holden wrote: > Phoe6 wrote: >> On May 19, 2:23 pm, Raymond Hettinger <[EMAIL PROTECTED]> wrote: >>> Instead of: >>> short_path = mdists[0] >>> if mdists.count(short_path) > 1: >>> write: >>> short_path = mdists[0] >>> if short_path in mdists[1:]: >> >> I would like to under

Re: Python compared to other language

2007-05-19 Thread Alex Martelli
walterbyrd <[EMAIL PROTECTED]> wrote: > On May 18, 10:24 pm, [EMAIL PROTECTED] (Alex Martelli) wrote: > > > > > I think that Ruby, which roughly speaking sits somewhere between Python > > and Perl, is closer to Python than Perl is. > > I don't know much about Ruby, but it does not seem to be com

Re: Beginner question: module organisation

2007-05-19 Thread Rainer Grimm
[EMAIL PROTECTED] wrote: > Hello :) > > I am new to python and I don't have much expirience in object-oriented > technologies neither. > > The problem is the following: I have to create a simple python > template script that will always follow the same algorithm, let's say: > - read a mesh > - tr

Re: Start

2007-05-19 Thread Paddy
On May 19, 4:18 pm, Nautilus <[EMAIL PROTECTED]> wrote: > Can anybody halp me start using Python. http://wiki.python.org/moin/BeginnersGuide And welcome :-) - Paddy. -- http://mail.python.org/mailman/listinfo/python-list

Start

2007-05-19 Thread Nautilus
Can anybody halp me start using Python. -- http://mail.python.org/mailman/listinfo/python-list

Re: docs patch: dicts and sets

2007-05-19 Thread Steven Bethard
Alan Isaac wrote: > I submitted the language based on Bill and Carsten's proposals: > > https://sourceforge.net/tracker/?func=detail&atid=105470&aid=1721372&group_id=5470 > > That language has been rejected. > You many want to read the discussion and see if > acceptible language still seems disco

Re: Execute commands from file

2007-05-19 Thread Martin Blume
"Steve Holden" schrieb > > I simply meant that the whole source has to be presented > to the exec statement and not chunked into lines. > That's what I meant: With exec open(f).read() it is not broken into several exec invocations. > > I was probably just a little over-zealous in pursuing >

Re: Creating a sub folder in the pythons LIB Directory

2007-05-19 Thread Gre7g Luterman
<[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > Hi, > > I am creating a library of functions. I would like to have them saved > in a sub folder of pythons LIB folder, but I cannot get it to work. > > I have a script called test.py > I stored it in LIB folder and typed > Import test,

ANN: Pyro 3.7 (remote objects)

2007-05-19 Thread Irmen de Jong
I'm happy to announce Pyro 3.7 -- Python's own powerful remote method invocation technology! You can get it via http://pyro.sourceforge.net, then go to the SF project homepage download area. This is a small improvement release since Pyro 3.6. New stuff: - bdist_rpm typo fix in setup.cfg - rena

_PyObject_New / PyObject_Init / PyInstance_New / etc?

2007-05-19 Thread Gre7g Luterman
(My apologies if this appears twice. It did not post the first time.) I'm so confuzzled! How do I instantiate my new C Python object from C? After flailing helplessly with my own code, and searching tirelessly with Google, I stepped back to the classic noddy2.c example in the Python help files an

Creating a sub folder in the pythons LIB Directory

2007-05-19 Thread [EMAIL PROTECTED]
Hi, I am creating a library of functions. I would like to have them saved in a sub folder of pythons LIB folder, but I cannot get it to work. I have a script called test.py I stored it in LIB folder and typed Import test, work fine. I store the script in lib/ted Then type Import lib\ted I get a

Re: Writelines() a bit confusing

2007-05-19 Thread Gre7g Luterman
"aiwarrior" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > If file.WriteLines( seq ) accepts a list and it says it writes lines, > why does it write the whole list in a single line. Be cause of that > the reverse of file.writelines(seq) is not file.readlines(). > Are the assumptions

Re: RFC - n-puzzle.py

2007-05-19 Thread Steve Holden
Phoe6 wrote: > On May 19, 2:23 pm, Raymond Hettinger <[EMAIL PROTECTED]> wrote: >> On May 18, 4:15 pm, Phoe6 <[EMAIL PROTECTED]> wrote: >>> I would like to request a code and design review of one of my program. >>> n-puzzle.pyhttp://sarovar.org/snippet/detail.php?type=snippet&id=83 >> Nice job, thi

Re: Writelines() a bit confusing

2007-05-19 Thread Steve Holden
aiwarrior wrote: > If file.WriteLines( seq ) accepts a list and it says it writes lines, > why does it write the whole list in a single line. Be cause of that > the reverse of file.writelines(seq) is not file.readlines(). > Are the assumptions i made correct? If yes why is this so? > > I find a fu

Re: Execute commands from file

2007-05-19 Thread Steve Holden
Martin Blume wrote: > "Steve Holden" schrieb >>> [ difference between exec open(fname).read() >>>and for line in open(fname): exec line ] >>> >>> So it seems to depend on the way the file is read. >>> >> It depends on the way the lines of the file are executed, >> not how they are read. >>

  1   2   >