Re: HTML Parsing and Indexing

2006-11-13 Thread Stefan Behnel
[EMAIL PROTECTED] wrote: > I am involved in one project which tends to collect news > information published on selected, known web sites inthe format of > HTML, RSS, etc and sortlist them and create a bookmark on our website > for the news content(we will use django for web development). Curren

Re: to setattr or def setProp()

2006-11-13 Thread Steven D'Aprano
On Mon, 13 Nov 2006 22:20:03 -0800, [EMAIL PROTECTED] wrote: > I have a class for rectangle and it has two points in its __slots__ . > However, we can derive a number of properties like width, height, > centerPoint etc from these two points. Now, I want to be able to set > and get these properties

Need help installing Tkinter/tkdnd

2006-11-13 Thread los
Hi I am trying to install the tk drag and drop to python 2.4. I installed python to c:\python24 I downloaded tkdnd-1.0a2.tar.gz, and TkinterDnD-0.4.zip. After I unzipped tkdnd-1.0a2.tar.gz, I copied the lib directory to c:\python24\tcl, now in C:\Python24\tcl\lib\tkdnd I have; libtkdnd.dll pkgIn

A memory leak involving builtin/pure-python inheritance.

2006-11-13 Thread [EMAIL PROTECTED]
Hi folks, Quick Synopsis: A test script demonstrates a memory leak when I use pythonic extensions of my builtin types, but if I use the builtin types themselves there is no memory leak. If you are interested in how builtin/pure-python inheritance interacts with the gc, maybe you can help me fix

Re: to setattr or def setProp()

2006-11-13 Thread Marc 'BlackJack' Rintsch
In <[EMAIL PROTECTED]>, [EMAIL PROTECTED] wrote: > I have a class for rectangle and it has two points in its __slots__ . > However, we can derive a number of properties like width, height, > centerPoint etc from these two points. Now, I want to be able to set > and get these properties directly fr

Re: A question on Encoding and Decoding.

2006-11-13 Thread John Machin
kath wrote: > Hi all, > > Platform:winxp > Version: Python 2.3 > > I have a task of reading files in a folder and creating an one excel > file with sheets, one sheet per file, with sheet named as filename. I > am facing problem in handling special characters. I am using XLRD

to setattr or def setProp()

2006-11-13 Thread [EMAIL PROTECTED]
I have a class for rectangle and it has two points in its __slots__ . However, we can derive a number of properties like width, height, centerPoint etc from these two points. Now, I want to be able to set and get these properties directly from the instances. I can either def __setattr__ , __getattr

Re: Unpacking sequences and keywords in one function call

2006-11-13 Thread OKB (not okblacke)
Steve Holden wrote: > Noah Rawlins wrote: > You should be ok as long as you use the following ordering of > actual arguments in a function call: > >1. Positional arguments >2. Keyword arguments >3. * sequence >4. ** dict I was just wondering about this yesterday. Is ther

Re: Test-driven development of random algorithms

2006-11-13 Thread Ben Finney
Robert Kern <[EMAIL PROTECTED]> writes: > Steven D'Aprano wrote: > > Does anyone have generic advice for the testing and development of > > this sort of function? > > "Design for Testability". In library code, never call the functions > in the random module. Always take as an argument a random.Ran

Re: Random image text generation?

2006-11-13 Thread Hendrik van Rooyen
From: "Leif K-Brooks" <[EMAIL PROTECTED]> wrote: > Steven D'Aprano wrote: > > For a text only solution, consider putting up a natural language question > > such as: > > > > What is the third letter of 'national'? > > What is four plus two? > > How many eggs in a dozen? > > Fill in the blank: Mary

Re: Test-driven development of random algorithms

2006-11-13 Thread Robert Kern
Steven D'Aprano wrote: > I'm working on some functions that, essentially, return randomly generated > strings. Here's a basic example: > > def rstr(): > """Return a random string based on a pseudo > normally-distributed random number. > """ > x = 0.0 > for i in range(12): >

Test-driven development of random algorithms

2006-11-13 Thread Steven D'Aprano
I'm working on some functions that, essentially, return randomly generated strings. Here's a basic example: def rstr(): """Return a random string based on a pseudo normally-distributed random number. """ x = 0.0 for i in range(12): x += random.random() return str(i

Re: Unpacking sequences and keywords in one function call

2006-11-13 Thread Steve Holden
Noah Rawlins wrote: > ram wrote: >> Stupid question #983098403: >> >> I can't seem to pass an unpacked sequence and keyword arguments to a >> function at the same time. What am I doing wrong? >> >> def f(*args, **kw): >> for a in args: >> print 'arg:', a >> for (k,v) in kw.iteritems

Re: Unpacking sequences and keywords in one function call

2006-11-13 Thread Gabriel Genellina
At Monday 13/11/2006 22:06, ram wrote: Stupid question #983098403: I can't seem to pass an unpacked sequence and keyword arguments to a function at the same time. What am I doing wrong? def f(*args, **kw): for a in args: print 'arg:', a for (k,v) in kw.iteritems(): pri

Re: __cmp__ between dissimilar objects

2006-11-13 Thread Gabriel Genellina
At Monday 13/11/2006 21:33, [EMAIL PROTECTED] wrote: I have a class that has, as an attribute, an instance of datetime.datetime(). I would like to be able to compare my class directly to instances of datetime.datetime in addition to other instances of my class. The value used for the compariso

Re: Unpacking sequences and keywords in one function call

2006-11-13 Thread Noah Rawlins
ram wrote: > Stupid question #983098403: > > I can't seem to pass an unpacked sequence and keyword arguments to a > function at the same time. What am I doing wrong? > > def f(*args, **kw): > for a in args: > print 'arg:', a > for (k,v) in kw.iteritems(): > print k, '=', v

Tkinter: Strange behavior using place() and changing cursors

2006-11-13 Thread Mudcat
I was trying to design a widget that I could drag and drop anywhere in a frame and then resize by pulling at the edges with the mouse. I have fiddled with several different approaches and came across this behavior when using the combination of place() and configure(cursor = ...) This problem doesn'

Re: SPE bug?

2006-11-13 Thread SPE - Stani's Python Editor
timmy schreef: > i can't paste from SPE into an xterm window. is this problem with SPE? No the problem is with the wxPython binding of stc (scintilla). It happens with the wxPython demo as well. I'll ask on the wxpython-users mailing list. Stani -- http://mail.python.org/mailman/listinfo/pytho

Re: Is python for me?

2006-11-13 Thread SPE - Stani's Python Editor
lennart schreef: > [*] As a photographer i like to build a picture management system Cornice, a cross-platform image viewer, might be a good start. Features Here is a list of the main features of Cornice: * Fully cross-platform: it should run wherever wxPython does; * Detail and thumbna

Re: Py3K idea: why not drop the colon?

2006-11-13 Thread Carl Banks
Ben Finney wrote: > Michael Hobbs <[EMAIL PROTECTED]> writes: > > > To be clear, this is the actual thrust of my argument. It seems > > redundant to have *both* line continuations and colons in compound > > statements. > > Why are you trying to remove redundancy? The language is designed for > comm

Re: Searching for a module to generate GUI events

2006-11-13 Thread Stephan Kuhagen
Paul Boddie wrote: > Searching for "Python GUI testing" on Google gave this as the first > result: Thank you very much, this looks very promissing to me. Seems to be a very usefull skill, if one is able to type the right words at the google prompt. Think, I should learn that some day... ;-) Step

Unpacking sequences and keywords in one function call

2006-11-13 Thread ram
Stupid question #983098403: I can't seem to pass an unpacked sequence and keyword arguments to a function at the same time. What am I doing wrong? def f(*args, **kw): for a in args: print 'arg:', a for (k,v) in kw.iteritems(): print k, '=', v >>> f(1,2) arg: 1 arg: 2 >>>

Re: Py3K idea: why not drop the colon?

2006-11-13 Thread Carl Banks
Steve Holden wrote: > In fact most Python doesn't use such constructs, though I'll admit the > occasional __init__ is more or less inevitable once you start using the > object-oriented features more than casually. Occasional? I don't know about you, but I use __init__ in 99% of the classes I defi

__cmp__ between dissimilar objects

2006-11-13 Thread [EMAIL PROTECTED]
I have a class that has, as an attribute, an instance of datetime.datetime(). I would like to be able to compare my class directly to instances of datetime.datetime in addition to other instances of my class. The value used for the comparison in either case should be the value of the datetime att

Re: Python 3000 idea -- + on iterables -> itertools.chain

2006-11-13 Thread Carl Banks
George Sakkis wrote: > Carl Banks wrote: > > George Sakkis wrote: > > > If by 'respond to "+"' is implied that you can get a "TypeError: > > > iterable argument required", as you get now for attempting "x in y" for > > > non-iterable y, why not ? > > > > Bad idea on many, many levels. Don't go th

Re: tab compleation input

2006-11-13 Thread Eli Criffield
#Thanks for the link from Fredrik Lundh #from http://effbot.org/librarybook/readline.htm #You do it like this, class Completer: def __init__(self, words): self.words = words self.prefix = None def complete(self, prefix, index): if prefix != self.prefix:

Re: HTML Parsing and Indexing

2006-11-13 Thread Andy Dingley
[EMAIL PROTECTED] wrote: > I am involved in one project which tends to collect news > information published on selected, known web sites inthe format of > HTML, RSS, etc I just can't imagine why anyone would still want to do this. With RSS, it's an easy (if not trivial) problem. With HTML

Re: Py3K idea: why not drop the colon?

2006-11-13 Thread Dan Lenski
Ben Finney wrote: > Readability doesn't vary directly or inversely with the number of > characters, even though it is affected when they change. Good point! Perl has more characters than Python, and I find they make it harder to read because they are distracting. Brainf*** (http://en.wikipedia.o

Re: Is python for me?

2006-11-13 Thread Dan Lenski
Carsten Haese wrote: > On Mon, 2006-11-13 at 10:14 -0800, Dan Lenski wrote: > > lennart wrote: > > > So i ask myself is python the language I'm looking for? > > > > Yep! Python is very much a jack-of-all-trades language. > > I'll run the risk of being nitpicky, but the full phrase is "Jack of all

Re: Py3K idea: why not drop the colon?

2006-11-13 Thread Michael Hobbs
Robert Kern wrote: > Michael Hobbs wrote: > >> True enough. Although, I have to ask how many times you define a new >> function only to have Python spit a syntax error out at you saying that >> you forgot a colon. It happens to me all the time. (Usually after an >> "else") If you'd never noti

Re: Python app links in windows

2006-11-13 Thread Gabriel Genellina
At Monday 13/11/2006 18:47, Bryce Bolton wrote: My question is: How do the contents of the link file get passed to the python application assocated with .PAL files? Are the file contents passed as an ARGV array? There must be more to this because when I open a file like some_doc.XLS, the enti

Re: Py3K idea: why not drop the colon?

2006-11-13 Thread skip
Mike> But so far, the only response that I've received is that there's Mike> that ABC study somewhere and that settles that. In the absence of a later study that refutes the ABC work, I think it's best left alone. Skip -- http://mail.python.org/mailman/listinfo/python-list

Re: Py3K idea: why not drop the colon?

2006-11-13 Thread Robert Kern
Michael Hobbs wrote: > True enough. Although, I have to ask how many times you define a new > function only to have Python spit a syntax error out at you saying that > you forgot a colon. It happens to me all the time. (Usually after an > "else") If you'd never notice that the colon was missing

Re: Python app links in windows

2006-11-13 Thread Fredrik Lundh
Bryce Bolton wrote: > I want to click a link, which is assocated with a Python application in > Windows, and have the contents of the link file passed to my program. How > is this done? if you want to open a new thread, please don't do that by replying to a random existing post. > I don't kno

Re: Is python for me?

2006-11-13 Thread TiNo
> > At least: i use the dutch portal http://python.startpagina.nl/ to start > with. Can you advice me a good Python interpreter, or a good startpage > (as in Python for dummys)? > > Lennart > > -- > http://mail.python.org/mailman/listinfo/python-list > check http://www.diveintopython.org/ pretty g

Re: explicit self revisited

2006-11-13 Thread Peter Maas
Steven D'Aprano schrieb: > Implicit self will never be used for Python, because it is redundant so > long as there is a need for explicit self, and there is a need for > explicit self because there are a number of basic, dare I say > *fundamental* programming techniques that require an explicit sel

Re: explicit self revisited

2006-11-13 Thread Fredrik Lundh
Peter Maas wrote: > But at least I learned something: a heated debate isn't bound to become an > endless thread if the OP abstains from answering idiot replies ;) trolling is trolling even if you use smilies. I'm sure you can find a way to actually *contribute* to Python if you really want to..

Re: Py3K idea: why not drop the colon?

2006-11-13 Thread Steve Holden
Michael Hobbs wrote: > Carsten Haese wrote: >> On Sat, 2006-11-11 at 23:18 -0800, Doug wrote: >> >>> Michael Hobbs wrote: >>> I think the colon could be omitted from every type of compound statement: 'if', 'for', 'def', 'class', whatever. Am I missing anything? Thanks, >

Python app links in windows

2006-11-13 Thread Bryce Bolton
I want to click a link, which is assocated with a Python application in Windows, and have the contents of the link file passed to my program. How is this done? Let's say the link name is: open_database_viewform_50324.pal (pal = python application link) Inside of open_document_number_50324

Re: Py3K idea: why not drop the colon?

2006-11-13 Thread Steve Holden
John Salerno wrote: > Fredrik Lundh wrote: >> John Salerno wrote: >> Anyway, the FAQ answer seems to be a weak argument to me. >>> I agree. I was expecting something more technical to justify the >>> colon, not just that it looks better. >> yeah, the whole idea of treating programming languag

Re: HTML Parsing and Indexing

2006-11-13 Thread Bernard
a combination of urllib, urlib2 and BeautifulSoup should do it. Read BeautifulSoup's documentation to know how to browse through the DOM. [EMAIL PROTECTED] a écrit : > Hi All, > > I am involved in one project which tends to collect news > information published on selected, known web sites int

ANN: Martin Franklin's Tile/Tablelist Tkinter wrappers now at SourceForge

2006-11-13 Thread Kevin Walzer
I have posted Martin Franklin's Tkinter wrappers for the TableList package (http://www.nemethi.de/) and the Tile theming extension (http://tktable.sourceforge.net/tile/) at SourceForge. Mr. Franklin previously hosted these wrappers at the URL's below: http://mfranklin.is-a-geek.org/docs/TableList

Re: Py3K idea: why not drop the colon?

2006-11-13 Thread [EMAIL PROTECTED]
Michael Hobbs wrote: > No, old research does is not automatically invalidated, but > out-of-context research is. I'm sure there's research somewhere proving > that code written in ALL UPPERCASE is preferable, since it makes > punched-cards easier to read by humans. Python 1.0 may have been a nice >

Re: Python memory usage

2006-11-13 Thread Jonathan Ballet
Le Mon, 13 Nov 2006 21:30:35 +0100, Fredrik Lundh <[EMAIL PROTECTED]> a écrit : > Jonathan Ballet wrote: > > >> http://effbot.org/pyfaq/why-doesnt-python-release-the-memory-when-i-delete-a-large-object > > > > Is it still true with Python 2.5 ? > > > > I mean, [http://evanjones.ca/python-memory

Re: Is python for me?

2006-11-13 Thread jkn
Hi Carsten > > I'll run the risk of being nitpicky, but the full phrase is "Jack of all > trades, master of none," which doesn't do Python justice. Python is a > master of all trades! > FYI that's only *one* version of 'the full phrase'. I, for instance, am a 'Jack of all trades, master of many'. I

Re: Py3K idea: why not drop the colon?

2006-11-13 Thread Ron Adam
Michael Hobbs wrote: > Ron Adam wrote: >> Michael Hobbs wrote: >> >>> Ron Adam wrote: >>> LOL, of course it would. I would expect that too after a suitable amount of 'brain washing', oops, I mean training and conditioning. ;-) >>> Trust me, my brain is

Re: Is python for me?

2006-11-13 Thread Cameron Laird
In article <[EMAIL PROTECTED]>, lennart <[EMAIL PROTECTED]> wrote: . . . >At least: i use the dutch portal http://python.startpagina.nl/ to start >with. Can you advice me a good Python interpreter, or a good startpage >(as in P

Re: Py3K idea: why not drop the colon?

2006-11-13 Thread John Salerno
Ben Finney wrote: > No. "The fewer characters, the better" is not right. Such absolutes > are to be avoided. > > Sometimes, as in the case of omitting block-enclosing braces, removing > characters results in better readability. Other times, as in the case > of explicit names for objects, *more* c

Re: str.title question after '

2006-11-13 Thread Fredrik Lundh
Leo Kislov wrote: >> Is there an easy way to get what I want? > > def title_words(s): > words = re.split('(\s+)', s) > return ''.join(word[0:1].upper()+word[1:] for word in words) nit: to work well also for Unicode strings using arbitrary alphabets, you should use title() instead of upp

Re: Py3K idea: why not drop the colon?

2006-11-13 Thread Michael Hobbs
Robert Kern wrote: > Michael Hobbs wrote: > >> In the end, I have to admit that I really couldn't give a flying frog if >> the colon is there or not. It's just a colon, after all. I *was* hoping >> that I could convince someone to honestly think about it and consider if >> the colon is really

Re: Python memory usage

2006-11-13 Thread Fredrik Lundh
Klaas wrote: > I think floats use obmalloc so I'm slightly surprised you don't see > differences. as noted in the FAQ I just posted a link to, floats also use a free list (using pretty much identical code to that used for integers). see comments in Objects/intobject.c (quoted below) and Object

Re: Python memory usage

2006-11-13 Thread Klaas
velotron wrote: > On Nov 9, 8:38 pm, "Klaas" <[EMAIL PROTECTED]> wrote: > > > I was referring specifically to abominations like range(100) > > However, there are plenty of valid reasons to allocate huge lists of > integers. I'm sure there are some; I doubt there are plenty. Care to name a few?

Re: Py3K idea: why not drop the colon?

2006-11-13 Thread Ron Adam
Michael Hobbs wrote: > Ron Adam wrote: >> [EMAIL PROTECTED] wrote: >> >>> > I'm not sure why '\'s are required to do multi-line before the >>> colon. >>> Special cases aren't special enough to break the rules. >>> >>> Georg >>> >>> A bit of a circular ans

Re: tab compleation input

2006-11-13 Thread Fredrik Lundh
Eli Criffield wrote: > Not sure what your trying to do, but it doesn't work. :) > valid doesn't exsist it's assigned to by the for-in loop, and is only used inside it. > Either way, it doesn't take the tab tell after you hit enter, Not > really what i was getting at. What i want is like a bash s

Re: Py3K idea: why not drop the colon?

2006-11-13 Thread Georg Brandl
Michael Hobbs wrote: > Georg Brandl wrote: >> Ron Adam wrote: >> >>> Michael Hobbs wrote: >>> >>> The same problem that is solved by not having to type parens around the 'if' conditional, a la C and its derivatives. That is, it's unnecessary typing to no good advantage, IMH

Re: Py3K idea: why not drop the colon?

2006-11-13 Thread Ben Finney
Michael Hobbs <[EMAIL PROTECTED]> writes: > To be clear, this is the actual thrust of my argument. It seems > redundant to have *both* line continuations and colons in compound > statements. Why are you trying to remove redundancy? The language is designed for communication between people (progra

Re: Printing database output in tabular form

2006-11-13 Thread ronrsr
I just changed the database to be a TEXT field, and that took care of the array() stuff - Now, I'm trying to convert the formatting codes to html. thanks for your help. bests, r0sr- -- http://mail.python.org/mailman/listinfo/python-list

Re: Py3K idea: why not drop the colon?

2006-11-13 Thread Robert Kern
Michael Hobbs wrote: > In the end, I have to admit that I really couldn't give a flying frog if > the colon is there or not. It's just a colon, after all. I *was* hoping > that I could convince someone to honestly think about it and consider if > the colon is really that noticeable. But so far,

Re: Python memory usage

2006-11-13 Thread Fredrik Lundh
Jonathan Ballet wrote: >> http://effbot.org/pyfaq/why-doesnt-python-release-the-memory-when-i-delete-a-large-object > > Is it still true with Python 2.5 ? > > I mean, [http://evanjones.ca/python-memory.html] should fix this > behaviour, doesn't it ? not really -- that change just means that Pyt

Re: Is python for me?

2006-11-13 Thread Stephen Eilert
Not to be picky, but any slowness in software is rarely because of code size. Rather, it is the data size and algorithms that play the major role. Only after you got the first two right is that you should worry about implementation speed. That said, you are correct. Only if you intend to do *heav

Re: Py3K idea: why not drop the colon?

2006-11-13 Thread Ben Finney
John Salerno <[EMAIL PROTECTED]> writes: > personally, i don't mind the colon and see no need to lose it, but > if we are talking in the realm of aesthetics, it actually seems like > it would be cleaner if it weren't there...sure, at first everyone > who is used to it might feel like something is

Re: jython's future

2006-11-13 Thread Steve Holden
Łukasz Langa wrote: > Steve Holden: >> I think you will find that most of Fredrik Lundh's stuff will work on >> 1.5.2. He sets a fine example to us all. >> > > 1.5.2? Come on, it's 7 years old. Back then PHP was still at 3.0, Java > was at 1.2 (and compiling Hello World took over 5 minutes),

Re: Py3K idea: why not drop the colon?

2006-11-13 Thread Michael Hobbs
Ron Adam wrote: > Michael Hobbs wrote: > >> Ron Adam wrote: >> >>> LOL, of course it would. I would expect that too after a suitable amount >>> of >>> 'brain washing', oops, I mean training and conditioning. ;-) >>> >>> >> Trust me, my brain is quite filthy and doesn't wash ea

Re: Python memory usage

2006-11-13 Thread Jonathan Ballet
Le Mon, 13 Nov 2006 20:46:58 +0100, Fredrik Lundh <[EMAIL PROTECTED]> a écrit : > > http://effbot.org/pyfaq/why-doesnt-python-release-the-memory-when-i-delete-a-large-object > > > Is it still true with Python 2.5 ? I mean, [http://evanjones.ca/python-memory.html] should fix this behaviour, do

Re: tab compleation input

2006-11-13 Thread ZeD
Eli Criffield wrote: > Here is what i want to do. I have a question in my program, and i want > to do tab completion for the valid answers. I think you may "play" width curses library: readline() read... while you input a "newline", but you need to catch single keys (the "TAB" key, foremost) --

Re: Is python for me?

2006-11-13 Thread lennart
[EMAIL PROTECTED] schreef: > As stated above python is capable of all those things, however on > larger applications like that it can tend to slow down a bit. And the > executables do need a little bit of work, because it's bassicly a dll > and a library of all your .pyc files. However python is

Re: Character Encodings and display of strings

2006-11-13 Thread Leo Kislov
JKPeck wrote: > It seemed to me that this sentence > > For many types, this function makes an attempt to return a string that > would yield an object with the same value when passed to eval(). > > might mean that the encoding setting of the source file might influence > how repr represented the co

Re: Printing database output in tabular form

2006-11-13 Thread Gabriel Genellina
At Monday 13/11/2006 16:40, ronrsr wrote: when I try to print a web table containing output from a database, I am getting more info than I want- - I would like this to print w'o the array('c',AND I'd like the control characters to print as HTML control chars. array('c', '- "In the boom yea

Re: Printing database output in tabular form

2006-11-13 Thread Marc 'BlackJack' Rintsch
In <[EMAIL PROTECTED]>, ronrsr wrote: > when I try to print a web table containing output from a database, I am > getting more info than I want- - > > I would like this to print w'o the array('c',AND I'd like the > control characters to print as HTML control chars. Look up the `tostring()` m

Re: Printing database output in tabular form

2006-11-13 Thread ronrsr
On Nov 13, 2:48 pm, Fredrik Lundh <[EMAIL PROTECTED]> wrote: > ronrsr wrote: > > when I try to print a web table containing output from a database, I am > > getting more info than I want- - > > > I would like this to print w'o the array('c',arrays instead of strings? > > what database is this,

Re: Printing database output in tabular form

2006-11-13 Thread Fredrik Lundh
ronrsr wrote: > when I try to print a web table containing output from a database, I am > getting more info than I want- - > > I would like this to print w'o the array('c', arrays instead of strings? what database is this, and how is that column defined ? -- http://mail.python.org/mailman/

Re: Is python for me?

2006-11-13 Thread lennart
Carsten Haese schreef: > On Mon, 2006-11-13 at 10:14 -0800, Dan Lenski wrote: > > lennart wrote: > > > So i ask myself is python the language I'm looking for? > > > > Yep! Python is very much a jack-of-all-trades language. > > I'll run the risk of being nitpicky, but the full phrase is "Jack of

Re: Python memory usage

2006-11-13 Thread Fredrik Lundh
velotron wrote: > x=range(1000) > x=None > > The problem exists for floats too, so for a less contrived example: > > x=[random.weibullvariate(7.0,2.0) for i in xrange(1000)] > x=None > > Both leave the Python process bloated in my environment. Is this > problem a good candidate for th

Printing database output in tabular form

2006-11-13 Thread ronrsr
when I try to print a web table containing output from a database, I am getting more info than I want- - I would like this to print w'o the array('c',AND I'd like the control characters to print as HTML control chars. array('c', '- "In the boom years of 1990-1997 developing countries paid mor

Re: tab compleation input

2006-11-13 Thread Eli Criffield
Not sure what your trying to do, but it doesn't work. :) valid doesn't exsist, and if you make vaid = sys.stdin.readline().rstrip(), then answer doesn't exsist. Either way, it doesn't take the tab tell after you hit enter, Not really what i was getting at. What i want is like a bash shell prompt

Re: Python memory usage

2006-11-13 Thread velotron
(hello group) On Nov 9, 8:38 pm, "Klaas" <[EMAIL PROTECTED]> wrote: > I was referring specifically to abominations like range(100) However, there are plenty of valid reasons to allocate huge lists of integers. This issue has been worked on: http://evanjones.ca/python-memory.html http://eva

Re: Py3K idea: why not drop the colon?

2006-11-13 Thread Ron Adam
Michael Hobbs wrote: > Ron Adam wrote: >> LOL, of course it would. I would expect that too after a suitable amount >> of >> 'brain washing', oops, I mean training and conditioning. ;-) >> > Trust me, my brain is quite filthy and doesn't wash easily. I do > appreciate aesthetics, which is wh

Re: handling many default values

2006-11-13 Thread Gabriel Genellina
At Monday 13/11/2006 13:33, Michele Simionato wrote: Alan Isaac wrote: > Also, as an aside, no one objected to using > self.__dict__.update(kwargs) > in the __init__ function of the parameter holding class. It is a common trick, also shown in the Python cookbook, IIRC. If you are anal about

Re: HTML Parsing and Indexing

2006-11-13 Thread Fredrik Lundh
[EMAIL PROTECTED] wrote: > I need a help on HTML parser. http://www.effbot.org/pyfaq/tutor-how-do-i-get-data-out-of-html.htm -- http://mail.python.org/mailman/listinfo/python-list

HTML Parsing and Indexing

2006-11-13 Thread mailtogops
Hi All, I am involved in one project which tends to collect news information published on selected, known web sites inthe format of HTML, RSS, etc and sortlist them and create a bookmark on our website for the news content(we will use django for web development). Currently this project is unde

Re: Find how to embed the BitTorrent in my program

2006-11-13 Thread Gabriel Genellina
At Monday 13/11/2006 11:56, å¼ æ²ˆé¹ wrote: >Is there any module can easy embed the BitTorrent(both tracker and >client) in myself's program . >Or where can find the documents for reuse official BitTorrent . Tried downloading the source? -- Gabriel Genellina Softlab SRL

Re: Py3K idea: why not drop the colon?

2006-11-13 Thread Michael Hobbs
Ron Adam wrote: > LOL, of course it would. I would expect that too after a suitable amount of > 'brain washing', oops, I mean training and conditioning. ;-) > Trust me, my brain is quite filthy and doesn't wash easily. I do appreciate aesthetics, which is why still stay with Python, even aft

Re: Py3K idea: why not drop the colon?

2006-11-13 Thread Michael Hobbs
Carsten Haese wrote: > On Sat, 2006-11-11 at 23:18 -0800, Doug wrote: > >> Michael Hobbs wrote: >> >>> I think the colon could be omitted from every type of compound >>> statement: 'if', 'for', 'def', 'class', whatever. Am I missing anything? >>> >>> Thanks, >>> - Mike >>> >> It is a

A question on Encoding and Decoding.

2006-11-13 Thread kath
Hi all, Platform:winxp Version: Python 2.3 I have a task of reading files in a folder and creating an one excel file with sheets, one sheet per file, with sheet named as filename. I am facing problem in handling special characters. I am using XLRD and XLW package to read/w

Re: httplib.ResponseNotReady question

2006-11-13 Thread Max
Fredrik Lundh wrote: > Max wrote: > > > If I run this with loops=1 then everything works fine. If I use a > > number greater than 1 then I get the error. Is there a method call > > that I need to restore the requestor object to a condition where it's > > eligible to receive another response? > >

Re: jython's future

2006-11-13 Thread Łukasz Langa
Steve Holden: > I think you will find that most of Fredrik Lundh's stuff will work on > 1.5.2. He sets a fine example to us all. > 1.5.2? Come on, it's 7 years old. Back then PHP was still at 3.0, Java was at 1.2 (and compiling Hello World took over 5 minutes), Google was nothing more than a

RE: Singleton Class Exception

2006-11-13 Thread Ames Andreas
> -Original Message- > From: [EMAIL PROTECTED] > [mailto:[EMAIL PROTECTED] > g] On Behalf Of Dan Lenski > Sent: Monday, November 13, 2006 7:05 PM > Subject: Re: Singleton Class Exception > > dischdennis wrote: > > the line "raise Singleton.__single" invokes in my class the > following >

Re: Singleton Class Exception

2006-11-13 Thread Jason
I threw together two different singleton classes. They both ensure that the initializers and destructors can be called at most once. (The ImmortalSingleton won't ever have its destructor called unless the programmer manually forces things.) I haven't extensively tested these things, so handle th

Re: Is python for me?

2006-11-13 Thread Carsten Haese
On Mon, 2006-11-13 at 10:14 -0800, Dan Lenski wrote: > lennart wrote: > > So i ask myself is python the language I'm looking for? > > Yep! Python is very much a jack-of-all-trades language. I'll run the risk of being nitpicky, but the full phrase is "Jack of all trades, master of none," which do

Re: Py3K idea: why not drop the colon?

2006-11-13 Thread Michael Hobbs
Ron Adam wrote: > [EMAIL PROTECTED] wrote: > >> > I'm not sure why '\'s are required to do multi-line before the >> colon. >> Special cases aren't special enough to break the rules. >> >> Georg >> >>> A bit of a circular answer. >> >>> >> >>> Why

Re: httplib.ResponseNotReady question

2006-11-13 Thread Fredrik Lundh
Max wrote: > If I run this with loops=1 then everything works fine. If I use a > number greater than 1 then I get the error. Is there a method call > that I need to restore the requestor object to a condition where it's > eligible to receive another response? I'm pretty sure that to get a new r

Re: Py3K idea: why not drop the colon?

2006-11-13 Thread Michael Hobbs
Georg Brandl wrote: > Ron Adam wrote: > >> Michael Hobbs wrote: >> >> >>> The same problem that is solved by not having to type parens around the >>> 'if' conditional, a la C and its derivatives. That is, it's unnecessary >>> typing to no good advantage, IMHO. I was coding in Ruby for sev

Re: httplib.InvalidURL: nonnumeric port: For charactersintheproxypassword in URL

2006-11-13 Thread Phoe6
Fredrik Lundh wrote: > "Phoe6" wrote: > > > proxy_password = urllib.quote(proxy_password_orig) > > make that: > > proxy_password = urllib.quote(proxy_password_orig, "") > Oh yeah. Wonderful!! That worked. Thanks a lot Fredrik!. :-) (<^> prostrations) Am sorry for the trouble and my mistake

Re: tab compleation input

2006-11-13 Thread [EMAIL PROTECTED]
On a gui on this would be a little bit easier but it's a completley diffrent realm when doing it in the console. It makes it a little more difficult when using stdin.readline() because you can only read line by line. Here is my implmentation. import sys validanswers = [ 'yes', 'no', 'maybe', 'tue

Re: Is python for me?

2006-11-13 Thread Dan Lenski
lennart wrote: > But I'm not a full-time programmer. I know, that I've only time & > possibility to learn one (= 1) language good. So i ask myself is python > the language I'm looking for? Yep! Python is very much a jack-of-all-trades language. I've used it for similar tasks, including as a fron

Re: Py3K idea: why not drop the colon?

2006-11-13 Thread Michael Hobbs
Antoon Pardon wrote: > On 2006-11-11, Steven D'Aprano <[EMAIL PROTECTED]> wrote: > >> On Fri, 10 Nov 2006 13:16:32 -0600, Michael Hobbs wrote: >> >> >>> Yeah, okay, I didn't read through the details of the PEP. I picked a bad >>> example to illustrate a point that is still true. The FAQ al

Re: Is python for me?

2006-11-13 Thread [EMAIL PROTECTED]
As stated above python is capable of all those things, however on larger applications like that it can tend to slow down a bit. And the executables do need a little bit of work, because it's bassicly a dll and a library of all your .pyc files. However python is still a great language and I would re

Re: explicit self revisited

2006-11-13 Thread Peter Maas
Michele Simionato wrote: > Peter Maas wrote: >> All these reasons are valid and retained by the following suggestion: let >> self be represented by the dot > > This suggestion has been discussed in the past (I remember having the > same idea myself when I first learned Python). But at the end I b

Re: Py3K idea: why not drop the colon?

2006-11-13 Thread John Salerno
Fredrik Lundh wrote: > John Salerno wrote: > >>> Anyway, the FAQ answer seems to be a weak argument to me. >> >> I agree. I was expecting something more technical to justify the >> colon, not just that it looks better. > > yeah, the whole idea of treating programming languages as an interface >

Re: Is python for me?

2006-11-13 Thread Cameron Laird
In article <[EMAIL PROTECTED]>, lennart <[EMAIL PROTECTED]> wrote: >Hi, > >I'm planning to learn a language for 'client' software. Until now, i >'speak' only some web based languages, like php. As a kid i programmed >in Basic (CP/M, good old days :'-) ) Now i want to start to learn a >(for me) new

  1   2   >