Re: Regular Expression Syntax Help

2006-02-08 Thread Raja Raman Sundararajan
Oh! yes you can use re for that. You just need to change the pattern a bit I did not understand where the "title" will be so I have ignored it, but I got something below which will be helpful for you >>> value = """name:asasasasas\nrequest: play\ntitle""" >>> reg = re.compile('Name:.*\\nrequest:.

Re: Python 2.4.2 using msvcrt71.dll on Win and compatibility issues

2006-02-08 Thread Christoph Zwerschke
Martin v. Löwis wrote: > Christoph Zwerschke wrote: >> I understand what you mean. But the Postgres dll provides no means to >> fdopen a new stream. > > Right. So you must do so in the pygresql module. That means you have > to get hold of msvcrt.dll's (sic) fdopen implementation. > > One way to d

only a simple xml reader value

2006-02-08 Thread martijn
H!, Is it possible to get a value value ? When I do this: - theXML = """ The Fascist Menace """ import xml.dom.minidom as dom doc = dom.parseString(theXML) print doc.getElementsByTagName('title')[0].toxml() I get : The Fascist Menace thats

Re: tricky regular expressions

2006-02-08 Thread Elezar Simeon Papo
I had a somewhat similar problem that got solved with a line-based state machine parser. Cheers, Elezar = Wiki Dictionary - Bosnian/Croatian/Serbian http://izraz.com/%C4%8Cengi%C4%87_vila -- http://mail.python.org/mailman/listinfo/python-list

Re: Detecting line endings

2006-02-08 Thread Fuzzyman
Alex Martelli wrote: > Fuzzyman <[EMAIL PROTECTED]> wrote: >... > > I can't open with a codec unless an encoding is explicitly supplied. I > > still want to detect UTF16 even if the encoding isn't specified. > > > > As I said, I ought to test this... Without metadata I wonder how Python > > d

Re: apostrophe or double quote?

2006-02-08 Thread Christoph Zwerschke
Steve Holden wrote: > It's just easier to have two permitted string quotes. That way, if your > string has an apostrophe in it you can say > > s = "it's" It's particularly handy if you are building strings of a language that already has its own quotes, e.g. SQL or XML: sql_snippet = " wher

Re: Too Many if Statements?

2006-02-08 Thread Juho Schultz
Bryan Olson wrote: > Alan Morgan wrote: > >> slogging_away wrote: >> >>> Hi - I'm running Python 2.4.2 (#67, Sep 28 2005, 12:41:11) [MSC v.1310 >>> 32 bit (Intel)] on win32, and have a script that makes numerous checks >>> on text files, (configuration files), so discrepancies can be reported. >>>

Re: The problem of anonymity with decorators

2006-02-08 Thread Franck Pommereau
Alex, Michele and Skip, Many thanks for your help, I should find my way by putting all these information together. Best regards, Franck -- http://mail.python.org/mailman/listinfo/python-list

Re: Too Many if Statements?

2006-02-08 Thread bruno at modulix
Pierre Quentel wrote: > This is because Python has a hidden mechanism to detect programs > generated by Perl scripts, and make them crash with no explanation > KEYBOARD ! -- bruno desthuilliers python -c "print '@'.join(['.'.join([w[::-1] for w in p.split('.')]) for p in '[EMAIL PROTECTED]'.spl

Re: Python Class use

2006-02-08 Thread bruno at modulix
S Borg wrote: > Hello, > > I am running Python on Mac OS X. The interpreter has been great for > learning the basics, but I would now like to be able to reuse code. > How do I write reusable code? I have done it "The Java way": write > the class, and save it to my home directory, then call it fr

Re: Question about idioms for clearing a list

2006-02-08 Thread Magnus Lycka
Ed Singleton wrote: > I'm a fairly average programmer (better than average compared to my > immediate colleagues). I've read every tutorial I can get my hands > on, but I have no _memory_ of ever coming across the del keyword, let > alone that it is fundamental to Python, and I have no idea what

Re: Best way of finding terminal width/height?

2006-02-08 Thread Joel Hedlund
> sys.stdin.read() will return when ... the > underyling read() call is aborted by a signal. Not "return", really? Won't it just pass an exception? I thought that was what I was catching with the "except IOError" part there? I assumed that sys.stdin.read() would only return a value properly at

RE: module with __call__ defined is not callable?

2006-02-08 Thread Steven D'Aprano
On Wed, 08 Feb 2006 13:58:13 +1100, Delaney, Timothy (Tim) wrote: > adam johnson wrote: > >> Hi All. >> I was wondering why defining a __call__ attribute for a module >> doesn't make it actually callable. > > For the same reason that the following doesn't work [snip example] > The __call__ attr

Re: module with __call__ defined is not callable?

2006-02-08 Thread Fuzzyman
Steven D'Aprano wrote: > On Wed, 08 Feb 2006 13:58:13 +1100, Delaney, Timothy (Tim) wrote: > > > adam johnson wrote: > > > >> Hi All. > >> I was wondering why defining a __call__ attribute for a module > >> doesn't make it actually callable. > > > > For the same reason that the following doesn't w

Re: Strange behavior with os call in cgi script

2006-02-08 Thread Rene Pijlman
Vinay Sajip: >Rene Pijlman: >> It struck me as somewhat complicated as well. >You should look at later versions of Python - your points above about >easier configuration have already been addressed: here's a link from >the current (2.4) docs: > >http://docs.python.org/lib/minimal-example.html Yes

Re: Question about idioms for clearing a list

2006-02-08 Thread Magnus Lycka
Ed Singleton wrote: > Is it obvious to a newbie what the difference between mappings and > "not-mappings", and is it obvious exactly what is and isn't a mapping? > > Should it be necessary to "know" python before it becomes easy to use? QOTW! (You are joking, aren't you? :) I can undestand how p

Re: Problem with curses and UTF-8

2006-02-08 Thread Thomas Dickey
"Martin v. Löwis" <[EMAIL PROTECTED]> wrote: > Ian Ward wrote: >> Any Ideas? > I think there is one or more ncurses bugs somewhere. indeed. It might be nice to report them rather than jawing about it. > The ncurses documentation suggests that you should link with > ncurses_w instead of linking

Re: Replacing curses

2006-02-08 Thread Thomas Dickey
Ian Ward <[EMAIL PROTECTED]> wrote: > I've had to work around many curses issues while developing Urwid (a hmm - I've read Urwid, and most of the comments I've read in that regard reflect problems in Urwid. Perhaps it's time for you to do a little analysis. (looking forward to bug reports, rat

Re: Detecting line endings

2006-02-08 Thread Fuzzyman
Alex Martelli wrote: > Fuzzyman <[EMAIL PROTECTED]> wrote: >... > > > Open the file with 'rU' mode, and check the file object's newline > > > attribute. > > Just to confirm, for a UTF16 encoded file, the newlines attribute is ``None``. All the best, Fuzzyman http://www.voidspace.org.uk/pyth

get output of cmd-line command under MS windows

2006-02-08 Thread calmar
Hi all, unfotunately, 'commands.getstatusoutput(command)' does not work under windows. Would there be any alternative? os.system also just provides the exit number I think. thanks a lot, and cheers marco -- calmar (o_ It rocks: LINUX + Command-Line-Interface //\

Re: Is Python good for web crawlers?

2006-02-08 Thread Magnus Lycka
Tempo wrote: > I was wondering if python is a good language to build a web crawler > with? For example, to construct a program that will routinely search x > amount of sites to check the availability of a product. Or to search > for news articles containing the word 'XYZ'. These are just random > i

Re: module with __call__ defined is not callable?

2006-02-08 Thread Steve Holden
Fuzzyman wrote: > Steven D'Aprano wrote: > >>On Wed, 08 Feb 2006 13:58:13 +1100, Delaney, Timothy (Tim) wrote: >> >> >>>adam johnson wrote: >>> >>> Hi All. I was wondering why defining a __call__ attribute for a module doesn't make it actually callable. >>> >>>For the same reason that

Re: Detecting line endings

2006-02-08 Thread Fuzzyman
Fuzzyman wrote: > Alex Martelli wrote: > > Fuzzyman <[EMAIL PROTECTED]> wrote: > >... > > > > Open the file with 'rU' mode, and check the file object's newline > > > > attribute. > > > > > Just to confirm, for a UTF16 encoded file, the newlines attribute is > ``None``. > Hmmm... having read t

Re: Question about idioms for clearing a list

2006-02-08 Thread Simon Brunning
On 2/8/06, Fredrik Lundh <[EMAIL PROTECTED]> wrote: > you seem to be missing that we're talking about a programming language > here. nothing is obvious if you don't know anything about the language; > a lot of things are obvious once you've learned a little about it. a little > is > all it takes

Re: module with __call__ defined is not callable?

2006-02-08 Thread Fuzzyman
Steve Holden wrote: > Fuzzyman wrote: > > Steven D'Aprano wrote: > > > >>On Wed, 08 Feb 2006 13:58:13 +1100, Delaney, Timothy (Tim) wrote: > >> > >> > >>>adam johnson wrote: > >>> > >>> > Hi All. > I was wondering why defining a __call__ attribute for a module > doesn't make it actuall

Re: module with __call__ defined is not callable?

2006-02-08 Thread Steve Holden
Fuzzyman wrote: > Steve Holden wrote: [...] >> >>The pursuit of orthogonality, while admirable, can lead to insanity if >>pushed too far. >> > > > Sure - feel free to venture as far down the road of insanity as you > like :-) To pursue your analogy, why don't we answer all usenet posts > by pushi

Re: critique my code, please

2006-02-08 Thread Frithiof Andreas Jensen
"Brian Blais" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > Hello, > > I am including at the end of this document (is it better as an attachment?) some code > for a small gui dialog. Since I am quite new to this, if anyone has any suggestions > for improvements to the code, bad co

Re: Question about idioms for clearing a list

2006-02-08 Thread Ed Singleton
On 08/02/06, Magnus Lycka <[EMAIL PROTECTED]> wrote: > Ed Singleton wrote: > > I'm a fairly average programmer (better than average compared to my > > immediate colleagues). I've read every tutorial I can get my hands > > on, but I have no _memory_ of ever coming across the del keyword, let > > a

Re: 450 Pound Library Program

2006-02-08 Thread Magnus Lycka
just a few style notes... > def checkOutBook(self, readerName): > "'Remove book from the front of the list, block if no books are > available'" I don't understand what "' is supposed to imply. If you meant to use triple quoting, you need to use ''' or """. Then the string can contain

Re: Another try at Python's selfishness

2006-02-08 Thread Frithiof Andreas Jensen
<[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > Having read previous discussions on python-dev I think I'm not the only > Python programmer who doesn't particularly like python's "self" > parameter: Ok, there might be five programmers and one imam. The imam does not like anything mo

Python threading, and processes

2006-02-08 Thread Robin Haswell
Hey there I'm doing some threading in python with Python 2.3 and 2.4 on Ubuntu and Debian machines, and I've noticed that if I open a lot of threads (say, 50), I get lots of python processes with individual PIDs, which consume a disproportionate amount of CPU. Does this mean that Python is using t

Re: Question about idioms for clearing a list

2006-02-08 Thread Fredrik Lundh
Ed Singleton wrote: > Having bricks that work in lots of places makes the language > 'guessable'. "I've never cleared a list before, but I've cleared > dictionaries and I guess the same way would work here". f = open("foo") f.clear() sys.stdout.clear() os.getcwd().clear() shelve.clear() s =

Re: Python threading, and processes

2006-02-08 Thread Diez B. Roggisch
Robin Haswell wrote: > Hey there > > I'm doing some threading in python with Python 2.3 and 2.4 on Ubuntu and > Debian machines, and I've noticed that if I open a lot of threads (say, > 50), I get lots of python processes with individual PIDs, which consume a > disproportionate amount of CPU. Doe

Re: 450 Pound Library Program

2006-02-08 Thread bruno at modulix
mwt wrote: > So in a further attempt to learn some Python, I've taken the little > Library program > (http://groups.google.com/group/comp.lang.python/browse_thread/thread/f6a9ccf1bc136f84) > I wrote and added several features to it. Readers now quit when they've > read all the books in the Library.

Re: 450 Pound Library Program

2006-02-08 Thread bruno at modulix
Magnus Lycka wrote: > just a few style notes... > (snip) > > Why bother with L? The follwing is as clear I think, and solves > the problem of commas in the title. Also, don't put a space between > the callable and the parenthesis please. See the Python style guide, > PEP 008. > > aut

Re: module with __call__ defined is not callable?

2006-02-08 Thread bruno at modulix
Steve Holden wrote: (snip) > The pursuit of orthogonality, while admirable, can lead to insanity if > pushed too far. > +1 QOTW -- bruno desthuilliers python -c "print '@'.join(['.'.join([w[::-1] for w in p.split('.')]) for p in '[EMAIL PROTECTED]'.split('@')])" -- http://mail.python.org/mailm

Re: Question about idioms for clearing a list

2006-02-08 Thread Ed Singleton
On 08/02/06, Magnus Lycka <[EMAIL PROTECTED]> wrote: > Ed Singleton wrote: > > Is it obvious to a newbie what the difference between mappings and > > "not-mappings", and is it obvious exactly what is and isn't a mapping? > > > > Should it be necessary to "know" python before it becomes easy to use?

Re: Another try at Python's selfishness

2006-02-08 Thread Ben Wilson
"But the point is, the current situation is not newbie-friendly (I can tell, I am a newbie)" I will agree to that, as I consider myself still new. _But_, it's a stumbling stone only briefly. Get enough nagging error messages, and you learn and move on. I agree with the grandparent poster that it i

os.walk() dirs and files

2006-02-08 Thread rtilley
Hello, When working with file and dir info recursively on Windows XP. I'm going about it like this: for root, dirs, files in os.walk(path): for f in files: ADD F to dictionary for d in dirs: ADD D to dictionary Is it possible to do something such as this: for root,

Re: Another try at Python's selfishness

2006-02-08 Thread DH
Frithiof Andreas Jensen wrote: > <[EMAIL PROTECTED]> wrote in message > news:[EMAIL PROTECTED] >> Having read previous discussions on python-dev I think I'm not the only >> Python programmer who doesn't particularly like python's "self" >> parameter: > > Ok, there might be five programmers and one

Re: Python threading, and processes

2006-02-08 Thread Robin Haswell
On Wed, 08 Feb 2006 14:24:38 +0100, Diez B. Roggisch wrote: > Robin Haswell wrote: > >> Hey there >> >> I'm doing some threading in python with Python 2.3 and 2.4 on Ubuntu and >> Debian machines, and I've noticed that if I open a lot of threads (say, >> 50), I get lots of python processes with

Re: os.walk() dirs and files

2006-02-08 Thread rtilley
Duncan Booth wrote: > How about just concatentating the two lists: > >>for root, dirs, files in os.walk(path): >for fs_object in files + dirs: >> ADD fs_object to dictionary Thank you Duncan! that solves the problem perfectly! -- http://mail.python.org/mailman/listinfo/python-li

Re: a question regarding call-by-reference

2006-02-08 Thread enjoying the view
Thank you everyone for your helpful replies! I think the problems that arise with nested and overly large lists and dictionaries, and difficulties of handling other mutable datatypes will make my little assignment just too difficult. I'll just specify that call-by-reference isn't supported and lea

Re: apostrophe or double quote?

2006-02-08 Thread Sion Arrowsmith
Steve Holden <[EMAIL PROTECTED]> wrote: >Huy wrote: >> I've been unable to find information clarifying this but. What is the >> difference between 'somestring' and "somestring"? >It's just easier to have two permitted string quotes. That way, if your >string has an apostrophe in it you can say >

Re: Python and Flash

2006-02-08 Thread rodmc
Thanks for the help so far. There are two Python applications involved, one runs on a remote PC (server) and another on the users PC (client). The server at present merely receives and sends out messages via an instant messaging platform. Based on the information it receives via the IM platform i

Re: os.walk() dirs and files

2006-02-08 Thread rtilley
rtilley wrote: > Hello, > > When working with file and dir info recursively on Windows XP. I'm going > about it like this: > > for root, dirs, files in os.walk(path): > for f in files: > ADD F to dictionary > for d in dirs: > ADD D to dictionary > > Is it possible to do

Re: os.walk() dirs and files

2006-02-08 Thread Duncan Booth
rtilley wrote: > Just to clarify. In this particular case, I do not need to differentiate > between files and dirs... so would it be possible to do something such > as this: > How about just concatentating the two lists: > for root, dirs, files in os.walk(path): > for fs_object in files,

Re: Too Many if Statements?

2006-02-08 Thread Nicola Musatti
bruno at modulix wrote: [...] > Suppose you have to match a line against a list of regexp and log if it > doesn't match. You could of course repeat the whole code for each > regexp, ie: > > if not re.match(r'a/regexp/here', line): > log('a first message') > > if not re.match(r'another/regexp/her

Re: UnboundMethodType and MethodType

2006-02-08 Thread Kent Johnson
Kirk McDonald wrote: > I think it's perfectly consistent: > > >>> class B(object): > ... def bar(self): pass > ... > >>> B.bar > > >>> type(B.bar) > > >>> b = B() > >>> b.bar > > > >>> type(b.bar) > > >>> id(B.bar) > -1211888788 > >>> id(b.bar) > -1211888788 > > It's the same func

Re: module with __call__ defined is not callable?

2006-02-08 Thread Antoon Pardon
Op 2006-02-08, Steve Holden schreef <[EMAIL PROTECTED]>: > Fuzzyman wrote: >> Steve Holden wrote: > [...] >>> >>>The pursuit of orthogonality, while admirable, can lead to insanity if >>>pushed too far. >>> >> >> >> Sure - feel free to venture as far down the road of insanity as you >> like :-) T

Re: only a simple xml reader value

2006-02-08 Thread uche . ogbuji
[EMAIL PROTECTED] wrote: > H!, > > Is it possible to get a value value ? > > When I do this: > - > theXML = """ > The Fascist Menace > """ > import xml.dom.minidom as dom > doc = dom.parseString(theXML) > print doc.getElementsByTagName('title

how to...python with winmodem...

2006-02-08 Thread pdt
Hello, i wanna know how to communicate my python program with my winmodem on PC...thanks!!! -- http://mail.python.org/mailman/listinfo/python-list

Re: module with __call__ defined is not callable?

2006-02-08 Thread Antoon Pardon
Op 2006-02-08, Steve Holden schreef <[EMAIL PROTECTED]>: > > Why should a module be callable? What's the advantage? Should we be able > to add two modules together, yielding a module that contains all the > code of both modules? What happens if I multiply a module by two - > presumably the resul

Re: only a simple xml reader value

2006-02-08 Thread martijn
I'm newbie with that xml stuff. The only thing I must read is the response I get from a EPP server. A response like this: http://www.eurid.eu/xml/epp/epp-1.0"; xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"; xmlns:contact="http://www.eurid.eu/xml/epp/contact-1.0"; xmlns:domain="http://www

What editor shall I use?

2006-02-08 Thread Lad
What editor shall I use if my Python script must contain utf-8 characters? I use XP Thank you for reply l.b. -- http://mail.python.org/mailman/listinfo/python-list

Re: 450 Pound Library Program

2006-02-08 Thread Sion Arrowsmith
mwt <[EMAIL PROTECTED]> wrote: >while len(self.stacks) == 0: To (kind of) repeat myself, the idiomatic Python would be: while not self.stacks: An empty list is considered to be false, hence testing the list itself is the same as testing len(l) > 0 . As someone else has noticed,

Undergraduate project :: python ToDo list

2006-02-08 Thread Joao Macaiba
Hi. I would like to know if there's any todo list on python project. My interest in doing a undergraduate project. It could be anything in the python core interpreter. I program C/C++. Thanks in advance. Regards. Joao Macaiba (wavefunction) -- http://mail.python.org/mailman/listinfo/python-l

Re: What editor shall I use?

2006-02-08 Thread Radek Kubicek
> What editor shall I use if my Python script must contain utf-8 > characters? > I use XP vim :-) > Thank you for reply > l.b. not for all :-) -- http://mail.python.org/mailman/listinfo/python-list

Re: What editor shall I use?

2006-02-08 Thread Lad
is vim for XP? -- http://mail.python.org/mailman/listinfo/python-list

Re: get output of cmd-line command under MS windows

2006-02-08 Thread Bernard Lebel
You should give a go to os.popen( ). Article 6.1.2 and 6.1.3 in the Python Library doc. I recently wrote a program that would create a pipe using the popen() method, and would enter a while loop. At each iteration, it would read one line of the pipe output, and the loop would break when it gets a

Re: 450 Pound Library Program

2006-02-08 Thread plahey
Ok, I give up. DRY = Don't Repeat Yourself (google Pragmatic Programmers) but SPOT? Google is little help here, SPOT is too common a word. Thanks! -- http://mail.python.org/mailman/listinfo/python-list

Re: UnboundMethodType and MethodType

2006-02-08 Thread Scott David Daniels
Kent Johnson wrote: > Kirk McDonald wrote: ... >> >>> id(B.bar) >> -1211888788 >> >>> id(b.bar) >> -1211888788 >> >> It's the same function, whether it's bound or not > > No, it's not the same function. You got the same id because you didn't > bind B.bar and b.bar to anything so the id was

Re: What editor shall I use?

2006-02-08 Thread Lad
I did not find where I can set encoding type in vim -- http://mail.python.org/mailman/listinfo/python-list

Re: Question about idioms for clearing a list

2006-02-08 Thread Scott David Daniels
Magnus Lycka wrote: >... I sometimes come across things that I once new but had forgotten. I'm sorry, and I mean no offense, _but_ I think _new_ there is a lovely typo. :-) I stopped, corrected it in my head, proceeded, and then I backed up, put it back and laughed out loud. --Scott David Daniel

Re: module with __call__ defined is not callable?

2006-02-08 Thread Scott David Daniels
Steven D'Aprano wrote: > On Wed, 08 Feb 2006 13:58:13 +1100, Delaney, Timothy (Tim) wrote: > >> adam johnson wrote: >> >>> Hi All. >>> I was wondering why defining a __call__ attribute for a module >>> doesn't make it actually callable. >> For the same reason that the following doesn't work > [sn

Re: apostrophe or double quote?

2006-02-08 Thread Huy
Thank you for all your help; it makes perfect sense now. -- http://mail.python.org/mailman/listinfo/python-list

PyGTK

2006-02-08 Thread Huy
Hi, I'm new to Python, and GUI development, but am no novice to backend programming. Aside from mastering the standard language, I will eventually be developing applications dealing with images and controls. Thus forth I have been testing out PyGTK & it appears to be quite robust (that and I like

Re: Undergraduate project :: python ToDo list

2006-02-08 Thread Alex Martelli
Joao Macaiba <[EMAIL PROTECTED]> wrote: > Hi. > > I would like to know if there's any todo list on python project. > > My interest in doing a undergraduate project. > > It could be anything in the python core interpreter. I program C/C++. The PEP index shows several PEPs approved but not imple

Re: What editor shall I use?

2006-02-08 Thread Petr Jakes
http://www.pspad.com/en/ Petr Jakes -- http://mail.python.org/mailman/listinfo/python-list

Re: Python threading, and processes

2006-02-08 Thread Alex Martelli
Robin Haswell <[EMAIL PROTECTED]> wrote: ... > Cheers for that info. The thread's main tasks are getting webpages > (spidering), the actual amount of processing done in each thread is > minimal - that's why I'm confused by the CPU usage. BTW, spidering is a great use case for async (even-driven

Re: Jython inherit from Java class

2006-02-08 Thread Alan Kennedy
[Mark Fink] > I wrote a Jython class that inherits from a Java class and (thats the > plan) overrides one method. Everything should stay the same. > > If I run this nothing happens whereas if I run the Java class it says: > usage: java fit.FitServer [-v] host port socketTicket > -v ver

Re: Replacing curses (Was: Re: Problem with curses and UTF-8)

2006-02-08 Thread Grant Edwards
On 2006-02-08, Ian Ward <[EMAIL PROTECTED]> wrote: > I think there are enough escape sequences common to all modern terminals > so that I can build a generic curses-replacement for my library. Why not use termcap/terminfo? -- Grant Edwards grante Yow! Where does

Re: Is Python good for web crawlers?

2006-02-08 Thread Simon Brunning
On 2/8/06, Alex Martelli <[EMAIL PROTECTED]> wrote: > > Bot? me? did I fail a Turing test again without even noticing?! If you'd noticed the test, you'd have passed. ;-) -- Cheers, Simon B, [EMAIL PROTECTED], http://www.brunningonline.net/simon/blog/ -- http://mail.python.org/mailman/listinfo/p

RE: What editor shall I use?

2006-02-08 Thread McCann, Brian
I use it on XPvisit http://www.vim.org/download.php , and scroll down to the Windows section. --Brian > -Original Message- > From: [EMAIL PROTECTED] > [mailto:[EMAIL PROTECTED] > On Behalf Of Lad > Sent: Wednesday, February 08, 2006 10:08 > To: python-list@python.org > Subject: Re:

Re: RPy / R

2006-02-08 Thread jason
Thanks for your response. I'll try to install all the same versions that you have. I have removed my version of Python and installed ActivePython (ActivePython-2.4.2.10-win32-x86.msi). Could you please tell me which versions of the following you have installed: NumPy SciPy RPy R I have not ins

Re: UnboundMethodType and MethodType

2006-02-08 Thread Schüle Daniel
[...] >> It's the same function, whether it's bound or not. Thus, it should >> always have the same type. > > > No, it's not the same function. You got the same id because you didn't > bind B.bar and b.bar to anything so the id was reused. thank you for the explanation it's indeed tricky wit

Re: Question about idioms for clearing a list

2006-02-08 Thread Magnus Lycka
A slim lady in a brown overcoat appears and says with a silly French accent: "Lizten very carefully, I vill zay ziz only onze." BTW, I happen to reply to Ed's post now, but I'm really responding to a fairly common attitude which I find somewhat counterproductive. I hope people are openminded and a

Re: Is Python good for web crawlers?

2006-02-08 Thread Alex Martelli
Magnus Lycka <[EMAIL PROTECTED]> wrote: ... > I dunno, but there are these two guys, Sergey Brin and Lawrence Page, > who wrote a web crawler in Python. As far as I understood, they were > fairly successful with it. I think they called their system Koogle, > Bugle, or Gobble or something like th

encoding during elementtree serialization

2006-02-08 Thread Chris McDonough
ElementTree's XML serialization routine implied by tree._write(file, node, encoding, namespaces looks like this (elided): def _write(self, file, node, encoding, namespaces): # write XML to file tag = node.tag if tag is Comment: file.write("" % _escape_

Re: Best way of finding terminal width/height?

2006-02-08 Thread Grant Edwards
On 2006-02-08, Joel Hedlund <[EMAIL PROTECTED]> wrote: >> sys.stdin.read() will return when ... the >> underyling read() call is aborted by a signal. > > Not "return", really? Yes, really. On a SIGWINCH, the read() will _either_ return currently buffered data or thrown an IOError exception. You

Re: Python threading, and processes

2006-02-08 Thread Yves Glodt
Robin Haswell wrote: > Hey there > > I'm doing some threading in python with Python 2.3 and 2.4 on Ubuntu and > Debian machines, and I've noticed that if I open a lot of threads (say, > 50), I get lots of python processes with individual PIDs, which consume a > disproportionate amount of CPU. Does

breadth first search

2006-02-08 Thread News
I am new in using Python Anyone know how to implement breadth first search using Python? Can Python create list dynamically, I want to implement a program which will read data from a file and store each line into a list, is this possible? Please send mail to me at [EMAIL PROTECTED] or reply this

Re: What editor shall I use?

2006-02-08 Thread Magnus Lycka
Lad wrote: > I did not find where I can set encoding type in vim Google is your friend. http://vim.sourceforge.net/scripts/script.php?script_id=789 http://www.vim.org/tips/tip.php?tip_id=246 http://www.vim.org/htmldoc/mbyte.html -- http://mail.python.org/mailman/listinfo/python-list

Re: 450 Pound Library Program

2006-02-08 Thread Magnus Lycka
[EMAIL PROTECTED] wrote: > Ok, > > I give up. DRY = Don't Repeat Yourself (google Pragmatic Programmers) > but SPOT? Google is little help here, SPOT is too common a word. The only SPOT I worked with (as I know of) was SPOT4 (Le Systeme Pour 'l Observation de la Terre) but that's probably not it

Re: breadth first search

2006-02-08 Thread Chris McDonough
News wrote: > I am new in using Python > > Anyone know how to implement breadth first search using Python? Breadth-first search of what? It depends what kind of tree you're searching, but here's a page with a few implementations: http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/231503

Re: Replacing curses

2006-02-08 Thread Ian Ward
Thomas Dickey wrote: > hmm - I've read Urwid, and most of the comments I've read in that regard > reflect problems in Urwid. Perhaps it's time for you to do a little analysis. > > (looking forward to bug reports, rather than line noise) A fair request. My appologies for the inflammatory subject

Mixing custom __setattr__ method and properties in new style classes

2006-02-08 Thread L.C. Rees
Can custom __setattr__ methods and properties be mixed in new style classes? I experimented with a new style class with both a custom __setattr__ method and a property. Attributes controlled by the __setattr__ method work fine. When I attempt to set or get the property it raises the error: "TypeEr

Number Format function

2006-02-08 Thread Edward Hartfield
I'm am relatively new to Python but use it daily. Today, I went looking for a function, like PHP's number_function, that will take a number and return a string with number formatted with grouped thousands and the decimal portion rounded to a given number of places. This is certainly needed wh

Re: breadth first search

2006-02-08 Thread Tim Chase
> Anyone know how to implement breadth first search using Python? Yes. Granted, for more details, you'd have to describe the data structure you're trying to navigate breadth-first. > Can Python create list dynamically Is Perl write-only? Does Lisp use too many parens? Of course! :) Not only

Re: Mixing custom __setattr__ method and properties in new style classes

2006-02-08 Thread L.C. Rees
I see the error: the get and set properties are inverted. Now it works. -- http://mail.python.org/mailman/listinfo/python-list

Re: breadth first search

2006-02-08 Thread Peter Otten
Chris McDonough wrote: >> Can Python >> create list dynamically, I want to implement a program which will read >> data from a file and store each line into a list, is this possible? > > L = [] > [L.append(line) for line in (open('filename.txt')] Why would you create two lists, one filled only wi

Re: breadth first search

2006-02-08 Thread mrmakent
Chris McDonough wrote: > L = [] > [L.append(line) for line in (open('filename.txt')] Ouch. Did you perhaps mean: L = [ line for line in open('filename.txt') ] Or, with better error handling: try: f = open('filename.txt') except IOError: # handle error here else: L = [ line for lin

Re: Omniorb event channel question

2006-02-08 Thread Attila Rajmund Nohl
Diez B. Roggisch <[EMAIL PROTECTED]> wrote: >> channel = orb.getRootInterface(channelname) >> chadmin = channel.for_consumers() >> supplier = chadmin.obtain_push_supplier() >> listener = EventListener() >> supplier.connect_push_consumer(listener) > > Not sure, but I guess you want a > > listener

Re: breadth first search

2006-02-08 Thread Scott David Daniels
Chris McDonough wrote: > News wrote: >... Can Python >> create list dynamically, I want to implement a program which will read >> data >> from a file and store each line into a list, is this possible? > > L = [] > [L.append(line) for line in (open('filename.txt')] > > - C Woops, crossed wires

Re: sys.path and unicode folder names

2006-02-08 Thread Thomas Heller
>> Nir Aides wrote: >>> Is there a solution or a work around for the sys.path problem with >>> unicode folder names on Windows XP? >>> >>> I need to be able to import modules from a folder with a non-ascii name. > Martin v. Löwis wrote: >> If the name is restricted to the CP_ACP code page (i.e.

Re: Mixing custom __setattr__ method and properties in new style classes

2006-02-08 Thread Fredrik Lundh
"L.C. Rees" wrote: > This is the code for the property at the end of the class definition: > > def _settext(self, txt): > self._tree.text = txt > > def _gettext(self, txt): > return self._tree.text > > def _deltext(self, txt): > self._tree.text = '' > > text

email questions

2006-02-08 Thread Scott Frankel
I'm looking for a way to send a simple, plain text email message using Python. My initial attempts are failing with the following error: socket.error: (61, 'Connection refused') Does this imply that I do not have the machine's smtp server running? (I don't; and I'd like to avoid se

Re: Mixing custom __setattr__ method and properties in new style classes

2006-02-08 Thread Scott David Daniels
L.C. Rees wrote: > Can custom __setattr__ methods and properties be mixed in new style > classes? > > I experimented with a new style class with both a custom __setattr__ > method and a property. Attributes controlled by the __setattr__ method > work fine. When I attempt to set or get the property

Re: breadth first search

2006-02-08 Thread Chris McDonough
Peter Otten wrote: > Chris McDonough wrote: > >>> Can Python >>> create list dynamically, I want to implement a program which will read >>> data from a file and store each line into a list, is this possible? >> L = [] >> [L.append(line) for line in (open('filename.txt')] > > Why would you create

Re: how to...python with winmodem...

2006-02-08 Thread Diez B. Roggisch
pdt wrote: > Hello, i wanna know how to communicate my python program with my > winmodem on PC...thanks!!! Use pyserial. Diez -- http://mail.python.org/mailman/listinfo/python-list

  1   2   3   >