Re: idiom for RE matching

2007-07-24 Thread Gabriel Genellina
En Wed, 25 Jul 2007 00:02:51 -0300, Gordon Airporte <[EMAIL PROTECTED]> escribió: > Gabriel Genellina wrote: > >> As is often the case, a regular expression is NOT the right tool to use >> in this case. > > Very interesting, thank you. I think 'pattern matching' and I > automatically think 'regu

Re: idiom for RE matching

2007-07-24 Thread Miles
On 7/24/07, Gordon Airporte <[EMAIL PROTECTED]> wrote: > I did already find that it speeds things up to pre-test a line like > > if 'bets' or 'calls' or 'raises' in line: > run the appropriate re's Be careful: unless this is just pseudocode, this Python doesn't do what you think it does; i

Re: idiom for RE matching

2007-07-24 Thread Gordon Airporte
Gabriel Genellina wrote: > As is often the case, a regular expression is NOT the right tool to use > in this case. > > --Gabriel Genellina Very interesting, thank you. I think 'pattern matching' and I automatically think 'regular expressions'. I did already find that it speeds things up to pre

Re: Base class for file-like objects? (a.k.a "Stream" in Java)

2007-07-24 Thread Asun Friere
On Jul 25, 8:51 am, Boris Dušek <[EMAIL PROTECTED]> wrote: > In Python, I found that "file" objects exist. While specifying > argument types in Python is not possible as in Java, it is possible to > check whether an object is an instance of some class and that's what I > need - I need to check if

Re: Base class for file-like objects? (a.k.a "Stream" in Java)

2007-07-24 Thread Gabriel Genellina
En Tue, 24 Jul 2007 19:51:30 -0300, Boris Dušek <[EMAIL PROTECTED]> escribió: > in Java, when I want to pass input to a function, I pass > "InputStream", which is a base class of any input stream. > > In Python, I found that "file" objects exist. While specifying > argument types in Python is no

Re: datetime.time() class - How to pass it a time string?

2007-07-24 Thread Gabriel Genellina
En Tue, 24 Jul 2007 14:37:20 -0300, Miles <[EMAIL PROTECTED]> escribió: > On 7/24/07, Robert Dailey wrote: >> I have a string in the following format: >> >> "00:00:25.886411" >> >> I would like to pass this string into the datetime.time() class and >> have it parse the string and use the values.

Re: exec and func_code

2007-07-24 Thread Gabriel Genellina
En Tue, 24 Jul 2007 14:55:43 -0300, Prepscius, Colin (IT) <[EMAIL PROTECTED]> escribió: > Actually, thx to Gabrielle Genellina, who wrote earlier: Ehmm... my name is actually Gabriel, and last time I checked, I was a male :) -- Gabriel Genellina -- http://mail.python.org/mailman/listinfo/

Re: printing unicode strings

2007-07-24 Thread 7stud
Thanks. -- http://mail.python.org/mailman/listinfo/python-list

Re: How do I 'stat' online files?

2007-07-24 Thread Gabriel Genellina
En Tue, 24 Jul 2007 10:47:16 -0300, Carsten Haese <[EMAIL PROTECTED]> escribió: > On Tue, 2007-07-24 at 09:07 -0400, DB Daniel Brown wrote: >> I am working on a program that needs to stat files (gif, swf, xml, >> dirs, etc) from the web. I know how to stat a local file… >> but I can’t figure out

Re: classmethod & staticmethod

2007-07-24 Thread Alex Popescu
Neil Cerutti <[EMAIL PROTECTED]> wrote in news:eRwpi.36813$G23.28496 @newsreading01.news.tds.net: > On 2007-07-25, Alex Popescu <[EMAIL PROTECTED]> wrote: >> As a matter of style, how do you figure out that class_list is >> a class attribute and not an instance attribute? (I don't >> remember seei

Re: From D

2007-07-24 Thread Gabriel Genellina
En Tue, 24 Jul 2007 11:10:53 -0300, Stargaming <[EMAIL PROTECTED]> escribió: > On Tue, 24 Jul 2007 03:19:53 -0700, bearophileHUGS wrote: > >> There are various things I like about the D language that I think Python >> too may enjoy. Here are few bits (mostly syntactical ones): >> >> 1) (we have

Re: classmethod & staticmethod

2007-07-24 Thread Neil Cerutti
On 2007-07-25, Alex Popescu <[EMAIL PROTECTED]> wrote: > As a matter of style, how do you figure out that class_list is > a class attribute and not an instance attribute? (I don't > remember seeing anything in the PEP describing the coding > style). Check out dir(MyClass) and dir(MyClass()) for so

Re: datetime.time() class - How to pass it a time string?

2007-07-24 Thread Neil Cerutti
On 2007-07-24, Ben Finney <[EMAIL PROTECTED]> wrote: > Neil Cerutti <[EMAIL PROTECTED]> writes: > >> On 2007-07-24, Robert Dailey <[EMAIL PROTECTED]> wrote: >> > Hi, >> > >> > I have a string in the following format: >> > >> > "00:00:25.886411" >> > >> > I would like to pass this string into the da

Re: classmethod & staticmethod

2007-07-24 Thread Alex Popescu
"Steven D'Aprano" <[EMAIL PROTECTED]> wrote in news:[EMAIL PROTECTED]: > On Tue, 24 Jul 2007 21:35:58 +, Alex Popescu wrote: > >> Neil Cerutti <[EMAIL PROTECTED]> wrote in >> news:[EMAIL PROTECTED]: >> >>> On 2007-07-24, Alex Popescu <[EMAIL PROTECTED]> wrote: Bruno Desthuilliers

Re: Trouble with email package

2007-07-24 Thread Gabriel Genellina
En Tue, 24 Jul 2007 05:10:31 -0300, Harel <[EMAIL PROTECTED]> escribió: > What was the solution you found? > Could you please post it? I'm having the same problem... ;o( > > On Jul 16, 2:53 pm, Torsten Bronger <[EMAIL PROTECTED]> > wrote: >> >> > The Content-Transfer-Encoding is wrong. Okay (well

Re: datetime.time() class - How to pass it a time string?

2007-07-24 Thread Ben Finney
Neil Cerutti <[EMAIL PROTECTED]> writes: > On 2007-07-24, Robert Dailey <[EMAIL PROTECTED]> wrote: > > Hi, > > > > I have a string in the following format: > > > > "00:00:25.886411" > > > > I would like to pass this string into the datetime.time() class > > and have it parse the string and use the

Re: From D

2007-07-24 Thread [EMAIL PROTECTED]
On Jul 24, 5:19 am, [EMAIL PROTECTED] wrote: > There are various things I like about the D language that I think > Python too may enjoy. Here are few bits (mostly syntactical ones): > > 1) (we have discussed part of this in the past) You can put > underscores inside number literals, like 1_000_000,

Re: how to get next month string?

2007-07-24 Thread John Machin
On Jul 24, 11:16 pm, Carsten Haese <[EMAIL PROTECTED]> wrote: > On Tue, 2007-07-24 at 05:15 -0700, John Machin wrote: > > On Jul 24, 8:31 pm, "Yinghe Chen" <[EMAIL PROTECTED]> wrote: > > > Hi, > > > Could someone help on how to use python to output the next month string > > > like > > > this? > >

Re: code indentation

2007-07-24 Thread Ben Finney
Steve Holden <[EMAIL PROTECTED]> writes: > [EMAIL PROTECTED] wrote: > > On 24 srp, 05:20, "Gabriel Genellina" <[EMAIL PROTECTED]> wrote: > >> En Mon, 23 Jul 2007 16:53:01 -0300, ...:::JA:::... > >> <[EMAIL PROTECTED]> escribió: > >>> So..how can I do this? > >>> I will appreciate a

Re: Reading a Directory of Emails - Problems

2007-07-24 Thread Joshua J. Kugler
On Tuesday 24 July 2007 09:38, Ryan Rosario wrote: > Hi, > > I have a directory that contains a bunch of email messages and I would > like to parse them using the email and mailbox packages. The emails were > exported from Apple Mail. From what I gather, I need to use MHMailbox, but > I can't get

Re: classmethod & staticmethod

2007-07-24 Thread Steven D'Aprano
On Tue, 24 Jul 2007 21:35:58 +, Alex Popescu wrote: > Neil Cerutti <[EMAIL PROTECTED]> wrote in > news:[EMAIL PROTECTED]: > >> On 2007-07-24, Alex Popescu <[EMAIL PROTECTED]> wrote: >>> Bruno Desthuilliers <[EMAIL PROTECTED]> >>> wrote in news:[EMAIL PROTECTED]: >>> >> >> [snip...] >> >>> >>

Re: From D

2007-07-24 Thread Steven D'Aprano
On Tue, 24 Jul 2007 20:09:00 +0200, Bjoern Schliessmann wrote: > Stargaming wrote: >> On Tue, 24 Jul 2007 03:19:53 -0700, bearophileHUGS wrote: > >>> While in a syntax like: >>> for i in xrange(1_000_000): >>> my eyes help me group them at once. >> >> Sounds like a good thing to be but the arbi

Base class for file-like objects? (a.k.a "Stream" in Java)

2007-07-24 Thread Boris Dušek
Hello, (sorry to begin with Java in a Python list ;-) in Java, when I want to pass input to a function, I pass "InputStream", which is a base class of any input stream. In Python, I found that "file" objects exist. While specifying argument types in Python is not possible as in Java, it is possib

Re: printing unicode strings

2007-07-24 Thread John Machin
On Jul 25, 6:56 am, 7stud <[EMAIL PROTECTED]> wrote: > Can anyone tell me why I can print out the individual variables in the > following code, but when I print them out combined into a single > string, I get an error? > > symbol = u'ibm' > price = u'4 \xbd' # 4 1/2 > > print "%s" % symbol > print

Re: printing unicode strings

2007-07-24 Thread Peter Otten
7stud wrote: > Can anyone tell me why I can print out the individual variables in the > following code, but when I print them out combined into a single > string, I get an error? > > symbol = u'ibm' > price = u'4 \xbd' # 4 1/2 > > print "%s" % symbol > print "%s" % price.encode("utf-8") > print

pg8000 (PostgreSQL DB-API 2.0) under IronPython

2007-07-24 Thread OlafMeding
Has anyone tried to run pg8000, a pure Python PostgreSQL DB-API 2.0 implementation, under IronPython? If so, I would be interested in how well it worked. Many thanks for you help. Olaf -- http://mail.python.org/mailman/listinfo/python-list

Re: classmethod & staticmethod

2007-07-24 Thread Alex Popescu
Neil Cerutti <[EMAIL PROTECTED]> wrote in news:[EMAIL PROTECTED]: > On 2007-07-24, Alex Popescu <[EMAIL PROTECTED]> wrote: >> Bruno Desthuilliers <[EMAIL PROTECTED]> >> wrote in news:[EMAIL PROTECTED]: >> > > [snip...] > >> >> class MyClass(object): >> class_list = ['a', 'b'] >> >> def instan

Re: Cleaning up a string

2007-07-24 Thread James Stroud
Peter Otten wrote: > unicode.translate() supports this kind of replacement... > and re.compile(...).sub() accepts a function: Thanks Peter! -- James Stroud UCLA-DOE Institute for Genomics and Proteomics Box 951570 Los Angeles, CA 90095 http://www.jamesstroud.com/ -- http://mail.python.org/ma

Re: datetime.time() class - How to pass it a time string?

2007-07-24 Thread Petr Jakes
On 24 ec, 19:11, Robert Dailey <[EMAIL PROTECTED]> wrote: > Hi, > > I have a string in the following format: > > "00:00:25.886411" > > I would like to pass this string into the datetime.time() class and > have it parse the string and use the values. However, the __init__() > method only takes inte

how to analyse music stream

2007-07-24 Thread Petr Jakes
On the local radio station here in the Czech they announced simple contest: If listeners will hear Elton John's Sacrifice followed immediately by Madonna's Frozen they have to call to the broadcasting. First caller will get some price. I am just thinking about the concept how to analyse music stre

printing unicode strings

2007-07-24 Thread 7stud
Can anyone tell me why I can print out the individual variables in the following code, but when I print them out combined into a single string, I get an error? symbol = u'ibm' price = u'4 \xbd' # 4 1/2 print "%s" % symbol print "%s" % price.encode("utf-8") print "%s %s" % (symbol, price.encode("

[ANNOUNCE] PyKota v1.26 is out

2007-07-24 Thread Jerome Alet
Hi there, I'm pleased to announce the immediate availability of PyKota v1.26 PyKota is a centralized and extensible print accounting and print quotas enforcement solution for CUPS, distributed under the terms of the GNU General Public License v2 or, at your option, any higher version. PyKota can

Re: Cleaning up a string

2007-07-24 Thread Peter Otten
James Stroud wrote: > I dashed off the following function to clean a string in a little > program I wrote: > > def cleanup(astr, changes): >for f,t in changes: > atr = astr.replace(f, t) >return astr > > where changes would be a tuple, for example: > > changes = ( > (

Re: Where do they tech Python officialy ?

2007-07-24 Thread Cameron Laird
In article <[EMAIL PROTECTED]>, NicolasG <[EMAIL PROTECTED]> wrote: . . . >Yes true , I'm already a programmer.. doing technical support for my >company products in a call center. I hate my job, I hate the moment I >have to wa

Cleaning up a string

2007-07-24 Thread James Stroud
Hello all, I dashed off the following function to clean a string in a little program I wrote: def cleanup(astr, changes): for f,t in changes: atr = astr.replace(f, t) return astr where changes would be a tuple, for example: changes = ( ('%', '\%'), ('$',

Re: Hacking with __new__

2007-07-24 Thread Chris Mellon
On 7/24/07, Sandra-24 <[EMAIL PROTECTED]> wrote: > On Jul 24, 5:20 am, Bruno Desthuilliers [EMAIL PROTECTED]> wrote: > > IIRC, __new__ is supposed to return the newly created object - which you > > are not doing here. > > > > class Bar(Foo): > > def __new__(cls, a, b, c, *args): > >

Re: Good String Tokenizer

2007-07-24 Thread Duncan Booth
JamesHoward <[EMAIL PROTECTED]> wrote: > I have searched the board what board? I don't see any boards here. > > And my splitting points are comma, and exclamation point then I would > expect to get back. > > ["Hello", ",", " World", "!", " How are you?"] > > Does anyone know of a tokenizer th

Re: Good String Tokenizer

2007-07-24 Thread James Stroud
JamesHoward wrote: > I have searched the board and noticed that there isn't really any sort > of good implementation of a string tokenizer that will tokenize based > on a custom set of tokens and return both the tokens and the parts > between the tokens. > > For example, if I have the string: > >

Good String Tokenizer

2007-07-24 Thread JamesHoward
I have searched the board and noticed that there isn't really any sort of good implementation of a string tokenizer that will tokenize based on a custom set of tokens and return both the tokens and the parts between the tokens. For example, if I have the string: "Hello, World! How are you?" And

Re: Hacking with __new__

2007-07-24 Thread Duncan Booth
Bruno Desthuilliers <[EMAIL PROTECTED]> wrote: > Duncan Booth a écrit : > (snip) >> I think what you want for Bar is something more along the lines: > > (snip) > >> class Bar(Foo): >> def __new__(cls, a, b, c, *args): >> print 'Bar.__new__', len(args) >> target = cls > You d

Re: wxPython - How to add sorting to a ListCtrl?

2007-07-24 Thread Benjamin
On Jul 24, 11:21 am, Robert Dailey <[EMAIL PROTECTED]> wrote: > Hi, > > I have 3 columns in my list control, each with a different "type" of > data (for example, one column has names, the other has dates, etc). > Can anyone reference a tutorial for solving this issue? I've done my > share of googli

Re: Any python module for Traversing HTML files

2007-07-24 Thread Benjamin
On Jul 24, 12:12 pm, johnny <[EMAIL PROTECTED]> wrote: > Any python module for navigating and selecting, parsing HTML files? htmlparse -- http://mail.python.org/mailman/listinfo/python-list

Re: Technology solutions for Ruby?

2007-07-24 Thread Chris Mellon
On 7/16/07, vasudevram <[EMAIL PROTECTED]> wrote: > > [ Though the OP posted his message to comp.lang.ruby, I'm cross- > posting it to comp.lang.python, since he mentions Python as a possible > alternative he's looking at, and also because I've recommended Python > for his stated needs. Also, inter

Re: Any python module for Traversing HTML files

2007-07-24 Thread Stefan Behnel
johnny wrote: > Any python module for navigating and selecting, parsing HTML files? Since you didn't name any specific requirements, consider taking the best one. "lxml.html" provides loads of goodies like Python iterators, XPath or CSS selection for navigation, or a clean() function for removing

Re: Can a low-level programmer learn OOP?

2007-07-24 Thread Eddie Corns
Paul McGuire <[EMAIL PROTECTED]> writes: >On Jul 23, 12:43 pm, [EMAIL PROTECTED] (Eddie Corns) wrote: >> Paul McGuire <[EMAIL PROTECTED]> writes: >> >On Jul 23, 5:53 am, [EMAIL PROTECTED] (Eddie Corns) wrote: >> >> Wolfgang Strobl <[EMAIL PROTECTED]> writes: >> >> >few of James Gimple's snippets f

Re: datetime.time() class - How to pass it a time string?

2007-07-24 Thread Neil Cerutti
On 2007-07-24, Robert Dailey <[EMAIL PROTECTED]> wrote: > Hi, > > I have a string in the following format: > > "00:00:25.886411" > > I would like to pass this string into the datetime.time() class > and have it parse the string and use the values. However, the > __init__() method only takes integer

Re: Problem in Socket.....

2007-07-24 Thread Grant Edwards
On 2007-07-24, Clement <[EMAIL PROTECTED]> wrote: > Is it possible to close the socket connection immediately in > Python.. Sure. Just call the socket's close() method. [You really ought to get that sticky '.' key fixed.] > Because i am getting error even though i close it after > all the

Re: Technology solutions for Ruby?

2007-07-24 Thread vasudevram
Bruno Desthuilliers wrote: >s/some/great/g >Both Ruby and Python are known for this. Thanks for the info. (I don't know much about metaprogramming etc. in either languages - just started exploring those topics recently.) >I'd say that - wrt/ "advanced" programming tricks - *most* of what you

Re: Problem in Socket.....

2007-07-24 Thread Diez B. Roggisch
Clement schrieb: > Is it possible to close the socket connection immediately in > Python.. Because i am getting error even though i close it after > all the transfer I read from one article it is possible in C > socket Whether is it possible in Python? > Which error? And usually the p

Re: code indentation

2007-07-24 Thread Steve Holden
[EMAIL PROTECTED] wrote: > On 24 srp, 05:20, "Gabriel Genellina" <[EMAIL PROTECTED]> wrote: >> En Mon, 23 Jul 2007 16:53:01 -0300, ...:::JA:::... >> <[EMAIL PROTECTED]> escribió: >> >> >> If you are using the tokenize module as suggested some time ago, try to analyze the token sequence yo

Re: From D

2007-07-24 Thread Bjoern Schliessmann
Stargaming wrote: > On Tue, 24 Jul 2007 03:19:53 -0700, bearophileHUGS wrote: >> While in a syntax like: >> for i in xrange(1_000_000): >> my eyes help me group them at once. > > Sounds like a good thing to be but the arbitrary positioning > doesnt make any sense. Checking underscore positions

Re: Any python module for Traversing HTML files

2007-07-24 Thread Kelvie Wong
I think he meant "Beautiful Soup". On 7/24/07, Clement <[EMAIL PROTECTED]> wrote: > On Jul 24, 10:12 pm, johnny <[EMAIL PROTECTED]> wrote: > > Any python module for navigating and selecting, parsing HTML files? > > try beautyfulshop > > -- > http://mail.python.org/mailman/listinfo/python-list >

Re: wxPython - How to add sorting to a ListCtrl?

2007-07-24 Thread Jason
On Jul 24, 10:21 am, Robert Dailey <[EMAIL PROTECTED]> wrote: > Hi, > > I have 3 columns in my list control, each with a different "type" of > data (for example, one column has names, the other has dates, etc). > Can anyone reference a tutorial for solving this issue? I've done my > share of googli

Re: Hacking with __new__

2007-07-24 Thread Sandra-24
On Jul 24, 5:20 am, Bruno Desthuilliers wrote: > IIRC, __new__ is supposed to return the newly created object - which you > are not doing here. > > class Bar(Foo): > def __new__(cls, a, b, c, *args): > print 'Bar.__new__', len(args) > if not args: > cls = Zoo >

Re: Any python module for Traversing HTML files

2007-07-24 Thread Carsten Haese
On Tue, 2007-07-24 at 17:36 +, Clement wrote: > On Jul 24, 10:12 pm, johnny <[EMAIL PROTECTED]> wrote: > > Any python module for navigating and selecting, parsing HTML files? > > try beautyfulshop Failing that, try BeautifulSoup. -- Carsten Haese http://informixdb.sourceforge.net -- http

RE: exec and func_code

2007-07-24 Thread Prepscius, Colin (IT)
Actually, thx to Gabrielle Genellina, who wrote earlier: Instead of using exec, rebuild a new function from the unmarshalled code: import new f3 = new.function(f2.func_code, globals()) f3(parameter) I haven't tried it yet, but will today... -Original Message- From: [EMAIL PROTECTED] [m

Problem in Socket.....

2007-07-24 Thread Clement
Is it possible to close the socket connection immediately in Python.. Because i am getting error even though i close it after all the transfer I read from one article it is possible in C socket Whether is it possible in Python? -- http://mail.python.org/mailman/listinfo/python-list

Re: Any python module for Traversing HTML files

2007-07-24 Thread Clement
On Jul 24, 10:12 pm, johnny <[EMAIL PROTECTED]> wrote: > Any python module for navigating and selecting, parsing HTML files? try beautyfulshop -- http://mail.python.org/mailman/listinfo/python-list

Re: wxPython - How to add sorting to a ListCtrl?

2007-07-24 Thread kyosohma
On Jul 24, 11:21 am, Robert Dailey <[EMAIL PROTECTED]> wrote: > Hi, > > I have 3 columns in my list control, each with a different "type" of > data (for example, one column has names, the other has dates, etc). > Can anyone reference a tutorial for solving this issue? I've done my > share of googli

Re: exec and func_code

2007-07-24 Thread Carsten Haese
On Tue, 2007-07-24 at 13:24 -0400, Prepscius, Colin (IT) wrote: > Does anybody know how to pass parameters to 'exec > somefunction.func_code'? > > def f1(): > print 'this is f1' > > def f2(p): > print 'this is f2, p =', str(p) > > exec f1.func_code > THIS RESULTS IN: "this is nf1"

Reading a Directory of Emails - Problems

2007-07-24 Thread Ryan Rosario
Hi, I have a directory that contains a bunch of email messages and I would like to parse them using the email and mailbox packages. The emails were exported from Apple Mail. From what I gather, I need to use MHMailbox, but I can't get it to do anything useful and I cannot find any examples of how

Re: datetime.time() class - How to pass it a time string?

2007-07-24 Thread Miles
On 7/24/07, Robert Dailey wrote: > Hi, > > I have a string in the following format: > > "00:00:25.886411" > > I would like to pass this string into the datetime.time() class and > have it parse the string and use the values. However, the __init__() > method only takes integers (which means I'd be f

Memory Logging

2007-07-24 Thread NuclearOnslaught
Hey all, I'm running some data analysis scripts that, due to the input file size, tend to be quite memory intensive. I've been reading up on Python's memory allocation (I'm using 2.4 and am locked into it, so I don't have the new fixes in 2.5) but because of the nature of its looping I don't thin

exec and func_code

2007-07-24 Thread Prepscius, Colin (IT)
Does anybody know how to pass parameters to 'exec somefunction.func_code'? def f1(): print 'this is f1' def f2(p): print 'this is f2, p =', str(p) exec f1.func_code THIS RESULTS IN: "this is nf1" WHICH IS NICE exec f2.func_code THIS RESULTS IN: TypeError: f2() takes exactly 1 ar

Re: Tix not properly installed on OS X?

2007-07-24 Thread Kevin Walzer
Brian Blais wrote: > So I tried to build Tix, and it complains about a tcl header file > (tclPort.h). My Tcl stuff is in > /System/Library/Frameworks/Tcl.framework/Versions/8.4/, but the header > file doesn't exist. I assume I need to download the source for Tcl and > build that, or is it en

Re: code indentation

2007-07-24 Thread vedrandekovic
On 24 srp, 05:20, "Gabriel Genellina" <[EMAIL PROTECTED]> wrote: > En Mon, 23 Jul 2007 16:53:01 -0300, ...:::JA:::... > <[EMAIL PROTECTED]> escribió: > > > > >> If you are using the tokenize module as suggested some time ago, try to > >> analyze the token sequence you get using { } (or perhaps begi

Re: Tix not properly installed on OS X?

2007-07-24 Thread Brian Blais
On Jul 24, 2007, at Jul 24:10:28 AM, Kevin Walzer wrote: You need an up-to-date installation of the base Tix package on your system, in the same path as your Tcl/Tk libraries. I downloaded and built the most recent version of Tix from http://tix.sf.net (dated November 2006) and the Python

Any python module for Traversing HTML files

2007-07-24 Thread johnny
Any python module for navigating and selecting, parsing HTML files? -- http://mail.python.org/mailman/listinfo/python-list

datetime.time() class - How to pass it a time string?

2007-07-24 Thread Robert Dailey
Hi, I have a string in the following format: "00:00:25.886411" I would like to pass this string into the datetime.time() class and have it parse the string and use the values. However, the __init__() method only takes integers (which means I'd be forced to parse the string myself). Does anyone k

Re: classmethod & staticmethod

2007-07-24 Thread Neil Cerutti
On 2007-07-24, Alex Popescu <[EMAIL PROTECTED]> wrote: > Bruno Desthuilliers <[EMAIL PROTECTED]> wrote > in news:[EMAIL PROTECTED]: > > >> >> [snip...] >> >> >> Not necessarily - you can access class attributes from within an >> instance method (but obviously a classmethod cannot access instance

wxPython - How to add sorting to a ListCtrl?

2007-07-24 Thread Robert Dailey
Hi, I have 3 columns in my list control, each with a different "type" of data (for example, one column has names, the other has dates, etc). Can anyone reference a tutorial for solving this issue? I've done my share of googling to no avail. I need the user to be able to click any of the column hea

Re: Closures / Blocks in Python

2007-07-24 Thread Bruno Desthuilliers
treble54 a écrit : > Does anyone know a way to use closures or blocks in python like those > used in Ruby? Particularly those used in the { } braces. > Instead of looking for what you think is the solution, you'd be better explaining your concrete problem. -- http://mail.python.org/mailman/listi

Re: Closures / Blocks in Python

2007-07-24 Thread Jason
On Jul 24, 8:58 am, treble54 <[EMAIL PROTECTED]> wrote: > Does anyone know a way to use closures or blocks in python like those > used in Ruby? Particularly those used in the { } braces. Python isn't Ruby. Python has a lambda function for creating anonymous functions, but many of the common use c

Re: Closures / Blocks in Python

2007-07-24 Thread Neil Cerutti
On 2007-07-24, treble54 <[EMAIL PROTECTED]> wrote: > Does anyone know a way to use closures or blocks in python like > those used in Ruby? Particularly those used in the { } braces. Python's nameless functions are week. So it supports iterators and generators using protocols, comprehensions and a

Re: Code objects

2007-07-24 Thread Terry Reedy
"Evan Klitzke" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] |I was playing around with the inspect module tonight, and I have a | question about "code components". Can an object have more than one | code component? As produced by CPython, a function object has one code attribute,

Re: Parsing XML with ElementTree (unicode problem?)

2007-07-24 Thread Stefan Behnel
[EMAIL PROTECTED] wrote: >> How about trying >> root = ElementTree.parse(urlopen(query), encoding ='utf-8') That doesn't work. > this specific thing is not working, however, parsing the url is not > problematic. So you tried parsing the complete XML file and it works? Then it's the way you stri

Re: Closures / Blocks in Python

2007-07-24 Thread Carsten Haese
On Tue, 2007-07-24 at 14:58 +, treble54 wrote: > Does anyone know a way to use closures or blocks in python like those > used in Ruby? Particularly those used in the { } braces. Please describe the problem you're trying to solve. Even if Python had a direct equivalent of "Ruby closures or bloc

Closures / Blocks in Python

2007-07-24 Thread treble54
Does anyone know a way to use closures or blocks in python like those used in Ruby? Particularly those used in the { } braces. -- http://mail.python.org/mailman/listinfo/python-list

Re: Parsing XML with ElementTree (unicode problem?)

2007-07-24 Thread oren . tsur
> How about trying > root = ElementTree.parse(urlopen(query), encoding ='utf-8') > this specific thing is not working, however, parsing the url is not problematic. the problem is that after parsing the xml at the url I save some of the fields to a local file and the local file is not being parsed

Re: Tix not properly installed on OS X?

2007-07-24 Thread Kevin Walzer
Jay Loden wrote: > Brian Blais wrote: >> Hello, >> >> I am running OS X 10.4, on an Intel Mac, Python 2.5 not installed by >> source (I used the binary install from the website). When I do the >> following, I get an error: >> >> Python 2.5.1 (r251:54869, Apr 18 2007, 22:08:04) >> [GCC 4.0.1 (Ap

Re: Where do they tech Python officialy ?

2007-07-24 Thread Beliavsky
On Jul 23, 1:27 pm, [EMAIL PROTECTED] (Cameron Laird) wrote: > Autodidacticism is an alternative; feel free to regard > http://wiki.python.org/moin/PythonTraining> as a member of > that class. > > If you, for example, were to teach yourself Python, then > volunteer with prominent extensions or

Re: for line in file('filename'):

2007-07-24 Thread Steve Holden
Yoav Goldberg wrote: > > I use the idiom "for line in file('filename'): do_something(line)" quite > a lot. > > Does it close the opened file at the end of the loop, or do I have to > explicitly save the file object and close it afterward? > The file will *normally* be closed in most Python imp

Re: Recursive lists

2007-07-24 Thread Stargaming
On Tue, 24 Jul 2007 02:14:38 -0700, mizrandir wrote: > Can someone tell me why python doesn't crash when I do the following: > a=[] a.append(a) print a > [[...]] print a[0][0][0][0][0][0][0] > [[...]] > > How does python handle this internally? Will it crash or use up lot's o

Re: From D

2007-07-24 Thread Stargaming
On Tue, 24 Jul 2007 03:19:53 -0700, bearophileHUGS wrote: > There are various things I like about the D language that I think Python > too may enjoy. Here are few bits (mostly syntactical ones): > > 1) (we have discussed part of this in the past) You can put underscores > inside number literals,

for line in file('filename'):

2007-07-24 Thread Yoav Goldberg
I use the idiom "for line in file('filename'): do_something(line)" quite a lot. Does it close the opened file at the end of the loop, or do I have to explicitly save the file object and close it afterward? Yoav -- http://mail.python.org/mailman/listinfo/python-list

Re: How do I 'stat' online files?

2007-07-24 Thread Carsten Haese
On Tue, 2007-07-24 at 09:07 -0400, DB Daniel Brown wrote: > I am working on a program that needs to stat files (gif, swf, xml, > dirs, etc) from the web. I know how to stat a local file… > > > import os > tplStat = os.stat(path) > > > > but I can’t figure out how to stat a file that resides o

Re: Tix not properly installed on OS X?

2007-07-24 Thread Jay Loden
Brian Blais wrote: > Hello, > > I am running OS X 10.4, on an Intel Mac, Python 2.5 not installed by > source (I used the binary install from the website). When I do the > following, I get an error: > > Python 2.5.1 (r251:54869, Apr 18 2007, 22:08:04) > [GCC 4.0.1 (Apple Computer, Inc. build

How do I 'stat' online files?

2007-07-24 Thread DB Daniel Brown
I am working on a program that needs to stat files (gif, swf, xml, dirs, etc) from the web. I know how to stat a local file... import os tplStat = os.stat(path) but I can't figure out how to stat a file that resides on a web server. I am not sure if it makes a difference, but most (maybe all)

Re: some parts of wxPython broken on Mac

2007-07-24 Thread kyosohma
On Jul 24, 6:14 am, Steve Holden <[EMAIL PROTECTED]> wrote: > ahlongxp wrote: > > Sorry, I know this is not the most appropriate place to talk about > > wxPython. > > But I can't have access to wxPython mail list page(because I don't pay > > enough). > > > I downloaded python2.5 and wxPython 2.8.4.

Re: how to get next month string?

2007-07-24 Thread Carsten Haese
On Tue, 2007-07-24 at 05:15 -0700, John Machin wrote: > On Jul 24, 8:31 pm, "Yinghe Chen" <[EMAIL PROTECTED]> wrote: > > Hi, > > Could someone help on how to use python to output the next month string like > > this? > > > > "AUG07", suppose now is July 2007. > > > > I think also need to consider De

Re: wxPython Internationalization

2007-07-24 Thread kyosohma
On Jul 24, 1:31 am, "[EMAIL PROTECTED]" <[EMAIL PROTECTED]> wrote: > I know this may have a very simple answer, nonetheless. I am wishing > to find the cleanest and most pythonic way of implementing the > following: > > I am creating a internationalized application in wxPython and have > sorted th

Re: The Modernization of Emacs: keyboard shortcuts pain

2007-07-24 Thread Xah Lee
Why Emacs's Keyboard Shortcuts Are Painful Xah Lee, 2007-07 A important aspect in designing keyboard shortcuts is to have keyboard shortcuts for those most frequently used commands, and, the most frequently used commands should have most easily-pressed keystrokes. For example, they should be on t

How to programmatically insert pages into MDI.

2007-07-24 Thread fynali iladijas
Hi, this query is regarding automating page insertions in Microsoft Document Imaging. I have two sets of MDIs generated fortnightly: Invoices and their corresponding Broadcast Certificates; about 150 of each. My billing application can generate one big MDI with all 150 invoices and another with a

Re: Parsing XML with ElementTree (unicode problem?)

2007-07-24 Thread André
On Jul 23, 11:29 am, [EMAIL PROTECTED] wrote: > (this question was also posted in the devshed python > forum:http://forums.devshed.com/python-programming-11/parsing-xml-with-elem... > ). > - > > (it's a bit longish but I hope I give all the information) > > 1. here is m

Re: how to get next month string?

2007-07-24 Thread John Machin
On Jul 24, 8:31 pm, "Yinghe Chen" <[EMAIL PROTECTED]> wrote: > Hi, > Could someone help on how to use python to output the next month string like > this? > > "AUG07", suppose now is July 2007. > > I think also need to consider Dec 07 case, it is supposed to output as > below: > "JAN07". > > datetim

Re: Where do they tech Python officialy ?

2007-07-24 Thread Neil Cerutti
On 2007-07-24, Paul Rubin wrote: > I think Python is not used in university programs very much. > Look for one that uses SICP (Scheme) or CTM (Mozart/Oz) or a > functional language like Haskell, in preference to the ones > that use Java (the Cobol of the 1990's). With some reasonable > experience

Re: how to get next month string?

2007-07-24 Thread BartlebyScrivener
On Jul 24, 5:31 am, "Yinghe Chen" <[EMAIL PROTECTED]> wrote: > Hi, > Could someone help on how to use python to output the next month string like > this? > > "AUG07", suppose now is July 2007. > I usually find time and date answers somewhere in here: http://pleac.sourceforge.net/pleac_python/date

Re: Where do they tech Python officialy ?

2007-07-24 Thread gregarican
On Jul 24, 6:57 am, NicolasG <[EMAIL PROTECTED]> wrote: > > Why would you want to become a programmer? Programmers smell bad, > > they have no social life, they get treated like crap by everyone. > > They can get paid pretty well but then they spend all the money on > > useless electronic junk so

Re: display image through cgi python html

2007-07-24 Thread Ladislav Andel
Thanks for quick reply. Yes, that's the hint I needed. Lada Marc 'BlackJack' Rintsch wrote: > On Tue, 24 Jul 2007 11:58:47 +0200, Ladislav Andel wrote: > > >> Here is what I have in image.cgi but it is incorrect and i'm not able to >> find it on the web. >> >> #!/usr/bin/python >> print "Cont

Re: display image through cgi python html

2007-07-24 Thread Steve Holden
Marc 'BlackJack' Rintsch wrote: > On Tue, 24 Jul 2007 11:58:47 +0200, Ladislav Andel wrote: > >> Here is what I have in image.cgi but it is incorrect and i'm not able to >> find it on the web. >> >> #!/usr/bin/python >> print "Content-Type: image/png\n" >> print 'image.png' > > You have to print

  1   2   >