ANN: SPE 0.7.5.c: Improved documentation bugfixes
With special thanks to Dimitri Pater to contribute his documenation from http://www.serpia.com and Nir Aides for the documentation about the debugger. Also thanks to all Mac donors who bring real Mac support for SPE more and more close. For more info visit the homepage. Stani Spe is a free python IDE with auto indentation completion, call tips, syntax coloring highlighting, UML diagrams, class explorer, source index, auto todo list, sticky notes, pycrust shell, file browsers, dragdrop, context help, Blender support, ... Spe ships with Python debugger (remote encrypted), wxGlade (gui designer), PyChecker (source code doctor) and Kiki (regex console). http://pythonide.stani.be http://pythonide.stani.be/blog http://pythonide.stani.be/screenshots -- http://mail.python.org/mailman/listinfo/python-announce-list Support the Python Software Foundation: http://www.python.org/psf/donations.html
Re: loop in python
I gotta say that as number cruncher, iteration in python is my biggest nightmare. I do what is possible with numpy, but element by element processing is a hassle. My programming experience is still pretty fresh at a year, so exotics as such are not in play yet. I also wish python looping/iterative features could be improved as best possible (what ever extent that may be). Generators are a friend, but not as performance friendly as when I am able to do all the needed work in numpy. I dunno I guess I got spoiled :) -- http://mail.python.org/mailman/listinfo/python-list
Re: Email client in Pyhton
IIRC, many of the mailbox modules (such as mailbox and mhlib) are read-only, but they should provide a good starting point. The mailbox module has recently been upgraded for full read-write access by a student participating in google's Summer of Code. It is currently under review for inclusion in the standard library. -- http://mail.python.org/mailman/listinfo/python-list
Re: Jargons of Info Tech industry
HTML is designed to degrade gracefully (never mind that most web authors and many browser developers don't seem to comprehend this), so you don't really need a subset html to get the safety features you want. All you need to do is disable the appropriate features in the HTML renderer in your news and mail readers. JavaScript, Java, and any form of object embedding. Oh yeah, and frames. And links. And cookies. And any kind of external site or local file access. And browser history. What is the risk with browser history? spyware and viruses (which can come from places other than email) sending it somewhere. Actually, there's not much point in keeping a browser history if all it can contain is mail in YOUR mailbox that may or may not have been already deleted. Gordon L. Burditt -- http://mail.python.org/mailman/listinfo/python-list
Re: variable hell
Not in my Python. for count in range(0, 10): ... value = count ... exec('a%s=%s' % (count, value)) ... dir() ['__builtins__', '__doc__', '__name__', 'count', 'value'] for count in range(0, 10): ... value = count ... exec(eval('a%s=%s' % (count, value))) ... dir() ['__builtins__', '__doc__', '__name__', 'a0', 'a1', 'a2', 'a3', 'a4', 'a5', 'a6', 'a7', 'a8', 'a9', 'count', 'value'] I myself use code like this to load user defined classes. exec(eval('from %s import %s' % (script, script))) exec(eval('self.user_class = %s()' % script)) self.user_class.run() But this can probably be done with the imp module too. rafi [EMAIL PROTECTED] 08/25/05 6:03 pm Adriaan Renting wrote: You might be able to do something along the lines of for count in range(0,maxcount): value = values[count] exec(eval('a%s=%s' % (count, value))) why using the eval? exec ('a%s=%s' % (count, value)) should be fine -- rafi Imagination is more important than knowledge. (Albert Einstein) -- http://mail.python.org/mailman/listinfo/python-list -- http://mail.python.org/mailman/listinfo/python-list
Re: Setting the encoding in pysqlite2
Well, the issue is not how to input text in the database from Python (it is enough to use literal unicode strings); in my case the database has been generated from a text file containing accented chars, using .import, and it seems I cannot read it from Python because of the unicode error :-( Michele Simionato -- http://mail.python.org/mailman/listinfo/python-list
Re: variable hell
Ron Garret wrote: Because eval() takes an expression as an argument, and assignment is a statement. And if you find this distinction annoying, try Lisp. that's were I come from :-) -- rafi Imagination is more important than knowledge. (Albert Einstein) -- http://mail.python.org/mailman/listinfo/python-list
Re: while c = f.read(1)
Op 2005-08-25, Steve Holden schreef [EMAIL PROTECTED]: Antoon Pardon wrote: Op 2005-08-24, Magnus Lycka schreef [EMAIL PROTECTED]: Antoon Pardon wrote: I think he did, because both expression are not equivallent unless some implicite constraints make them so. Values where both expressions differ are: start1=67, stop1=9, start2=10, stop2=29 This is just too fatuous to ignore, sorry. You mean you can't think of circumstances where this could be valid data. Ouch! That didn't occur to me. How sloppy to just assume that time periods can't end before they start. I have no trouble that you assume a time period starts before it ends. But two pieces of code that only give the same result under particular assumptions are not equivallent. For all I know his code might work without this assumption and thus be usefull in circumstances where yours is not. Maybe someone uses a convention where time intervals that stop before they start can have some meaning. Equivallent code IMO always gives the same results, not only under the particular constraints you are working with. I'll shut up now. You win, I'm obviously the idiot here, and Python's must be redesigned from ground up. Pyrdon maybe? If I ever design a language it'll be called: 'Queny' ...and you will regard it as perfect I doubt that. I've looked at the problem of designing a language and IMO it is a very complex matter, that is difficult to do good, let alone perfect. At this moment I think very highly about the designers of Python, because I think they have done a very good job and Python is for the moment my language of choice. Sure Python has its warts, but I can live with them. I just don't like it if I get the impression that people want to deny the warts. and be completely unable to understand why nobody likes it. Could we possibly reduce the number of arguments about ridiculous postulates such as , and try to remember that most people on this list are dealing with real life? So? Real life is full of thinss that could be better. If people just want deal with that, fine. But arguing that there is nothing wrong with how python treats conditional context is not dealing with real life. AFAIAC writing articles in newsgroups isn't dealing with real life, unless maybe if you have a question you need an answer for. I deal plenty with real life myself, during working hours that consists partly in writing python software, with all the good and the few bad python brings. Magnus gave you a perfectly reasonable example of some code that could be simplified. You say the two pieces of code aren't equivalent. While you may be (strictly) correct, your assertion signally fails to add enlightenment to the discussion. No, my assertion pointed out, that his code would only work under specific constraints. Constraints that may have been very natural in the context the program was written, but that doesn't mean all programs work with such a constraint. He was also talking about logical equivallence and his expression was not logical equivallent with the one that was replaced. I continue to look forward to the first post in which you actually accept someone else's point of view without wriggling and squirming to justify your increasingly tenuous attempts to justify every opinion you've ever uttered on this group :-) I don't post me too's. There have been plenty of posts here, I have no problem with. I read them, give a slight nod and go on. And if I have an opinion I was to express here, I certainly will to justify it. -- Antoon Pardon -- http://mail.python.org/mailman/listinfo/python-list
Re: Setting the encoding in pysqlite2
Michele Simionato wrote: An easy question, but I don't find the answer in the docs :-( I have a sqlite3 database containing accented characters (latin-1). How do I set the right encoding? For instance if I do this: I think you should ask on the pysqlite-devel list. Reinhold -- http://mail.python.org/mailman/listinfo/python-list
Re: Should I move to Amsterdam?
True. Unless you have two proper locks. In that case your bike will last a very long time. Nope. You will probably retrieve your two locks from the fencing you attached them to (if you did!), with your bike gone. Wouter van Ooijen -- http://www.voti.nl Webshop for PICs and other electronics http://www.voti.nl/hvu Teacher electronics and informatics -- http://mail.python.org/mailman/listinfo/python-list
file access dialog
I have a tool in Python to which I want to add a small GUI. The tools currently runs everywhere PySerial is supported. I need a file-access dialog. What is the preffered way to to this? Is there a platform-independent file-access dialog available, or should I use the windows native version when running on windows (and how do I do that)? Wouter van Ooijen -- http://www.voti.nl Webshop for PICs and other electronics http://www.voti.nl/hvu Teacher electronics and informatics -- http://mail.python.org/mailman/listinfo/python-list
Re: Bug in string.find; was: Re: Proposed PEP: New style indexing, was Re: Bug in slice type
Op 2005-08-25, Bryan Olson schreef [EMAIL PROTECTED]: Steve Holden asked: Do you just go round looking for trouble? In the course of programming, yes, absolutly. As far as position reporting goes, it seems pretty clear that find() will always report positive index values. In a five-character string then -1 and 4 are effectively equivalent. What on earth makes you call this a bug? What you just said, versus what the doc says. And what are you proposing that find() should return if the substring isn't found at all? please don't suggest it should raise an exception, as index() exists to provide that functionality. There are a number of good options. A legal index is not one of them. IMO, with find a number of features of python come together. that create an awkward situation. 1) 0 is a false value, but indexes start at 0 so you can't return 0 to indicate nothing was found. 2) -1 is returned, which is both a true value and a legal index. It probably is too late now, but I always felt, find should have returned None when the substring isn't found. -- Antoon Pardon -- http://mail.python.org/mailman/listinfo/python-list
Re: file access dialog
Well, I only know how to do it with Qt: Dialog = QFileDialog(self.filedir, 'Python files (*.py)', self, 'open file dialog') self.filename = str( Dialog.getOpenFileName()) I don't think PyQt is available for Qt4 on windows yet. You might be ablt to use this: http://www.quadgames.com/download/pythonqt/PyQtGPL10.exe Tk or wxWindows, or the Windows API itself might also be possible, I have no experience with them. Using either Tk or wxWindows should give a portable application as well. Wouter van Ooijen www.voti.nl) [EMAIL PROTECTED] 08/26/05 9:52 am I have a tool in Python to which I want to add a small GUI. The tools currently runs everywhere PySerial is supported. I need a file-access dialog. What is the preffered way to to this? Is there a platform-independent file-access dialog available, or should I use the windows native version when running on windows (and how do I do that)? Wouter van Ooijen -- http://www.voti.nl Webshop for PICs and other electronics http://www.voti.nl/hvu Teacher electronics and informatics -- http://mail.python.org/mailman/listinfo/python-list -- http://mail.python.org/mailman/listinfo/python-list
Language translation possible in python?
I have a program that currently displays all of its messages and instructions in only English. My boss wants me to change it all to Korean. Is there a python module that will automatically translate my English to Korean? -Jon -- http://mail.python.org/mailman/listinfo/python-list
Re: variable hell
I was responding to rafi's suggestion, I had not received the exec 'a%s = %s' % (count,count) response yet at that time. The exec 'a%s = %s' % (count,value) works fine. Not in my Python. ---snip--- why using the eval? exec ('a%s=%s' % (count, value)) should be fine -- rafi --- I appologize for any top-posting, and improper inlining, I'm using groupwise --- Martin v. Löwis [EMAIL PROTECTED] 08/26/05 10:19 am Adriaan Renting wrote: Not in my Python. for count in range(0, 10): ... value = count ... exec('a%s=%s' % (count, value)) ... dir() ['__builtins__', '__doc__', '__name__', 'count', 'value'] You did not copy the suggestion properly: for count in range(0, 10): ... exec 'a%s = %s' % (count,count) ... dir() ['__builtins__', '__doc__', '__file__', '__name__', 'a0', 'a1', 'a2', 'a3', 'a4', 'a5', 'a6', 'a7', 'a8', 'a9', 'count'] a5 5 (you can put additional parentheses around the string, but not additional quotation marks) Regards, Martin -- http://mail.python.org/mailman/listinfo/python-list -- http://mail.python.org/mailman/listinfo/python-list
Re: Usenet, HTML (was Re: Jargons of Info Tech industry)
John Bokma wrote: Ulrich Hobelmann [EMAIL PROTECTED] wrote: On the information side (in contrast to the discussion side) RSS is replacing Usenet, LOL, how? I can't post to RSS feeds. Or do you mean for lurkers? I said information side, meaning stuff like RSS is used for. There is no real reason why NNTP couldn't be used like RSS (i.e. contain a small description and a web link as message text), It has been used like that for ages (or as long as I can remember). Yes, but for some reason people jumped onto the RSS hype. I wonder why. Heck, even I am subscribed to a bunch of RSSes, because those institutions don't offer NNTP ;) or why a newsgroup shouldn't we written in HTML and contain a (default, or user-provided) CSS sheet. It's called www. It's already here (or there) Well, but forums only emulate the posting/reply structure. It would make more sense to use NNTP for that, and use $WHATEVER, e.g. HTML, for markup inside the posts. WWW is something else; a bunch of pages with hyperlinks to each other. Maybe we shouldn't call web forums and other dynamic websites www, as they don't really follow that purpose. They are just abuses of HTTP/HTML/JS for thin clienting. ;) If things were that way, suddenly people *would* use Outlook and Thunderbird for news-reading, But why do you want that? (Oh, and you can't read news with Outlook). Why do you want more people on Usenet? No, I'm not talking about usenet. I'm glad if the SNR keeps as high (haha) as it is, and messages in plain text. I'm talking about using the technology for communication, instead of reinventing the wheel with crappy web forums. Oh, and I've heard there are people reading our in-house newsgroup with Outlook. while today everything is just Browser+HTTP. And what's wrong with that? It's slow and pointless. All interaction that's more than clicking a link has to be emulated with Javascript (heard of Ajax already?) to make it more smooth. NNTP has advantages like giving you only the headlines first, so you can choose what to check out. Then you can get the article if you like (in the communication case) or the news description (in the RSSoid case) and maybe click on a link inside. Saves bandwidth and is quite faster than waiting for some overloaded PHP server to send you a bunch of HTML tables. Responding doesn't involve *any* HTTP requests, just a keypress and you're typing. Web forums are stone-age, as are most web-pages. -- I believe in Karma. That means I can do bad things to people all day long and I assume they deserve it. Dogbert -- http://mail.python.org/mailman/listinfo/python-list
Re: variable hell
Adriaan Renting wrote: Not in my Python. for count in range(0, 10): ... value = count ... exec('a%s=%s' % (count, value)) ... dir() ['__builtins__', '__doc__', '__name__', 'count', 'value'] You did not copy the suggestion properly: for count in range(0, 10): ... exec 'a%s = %s' % (count,count) ... dir() ['__builtins__', '__doc__', '__file__', '__name__', 'a0', 'a1', 'a2', 'a3', 'a4', 'a5', 'a6', 'a7', 'a8', 'a9', 'count'] a5 5 (you can put additional parentheses around the string, but not additional quotation marks) Regards, Martin -- http://mail.python.org/mailman/listinfo/python-list
Re: Setting the encoding in pysqlite2
Michele Simionato wrote: Well, the issue is not how to input text in the database from Python (it is enough to use literal unicode strings); in my case the database has been generated from a text file containing accented chars, using .import, and it seems I cannot read it from Python because of the unicode error :-( You should not do that. In SQLite 3, TEXT fields should always be UTF-8. That .import did not reject your data sounds like a bug in .import. So if you make your input data UTF-8, you should be able to fetch them easily, and receive Unicode strings. Regards, Martin -- http://mail.python.org/mailman/listinfo/python-list
Re: Jargons of Info Tech industry
In comp.lang.perl.misc Ulrich Hobelmann [EMAIL PROTECTED] wrote: [EMAIL PROTECTED] wrote: In comp.lang.perl.misc John Bokma [EMAIL PROTECTED] wrote: the argument that usenet should never change seems a little heavy-handed and anachronistic. No, simple since there *are* alternatives: web based message boards. Those alternatives *do* support HTML formatting (often the subset mentioned ... and generally these web based message boards (i.e. forums I assume you mean) have none of the useful tools that Usenet offers and are much, much slower. That is because NNTP and its applications didn't evolve to feed the glitzy need lots of users have. I don't think they have glitzy need, they are just fed glitzy (but slow) forums as the way to get support etc. If they were told about the alternatives as well and told how to use them then I thiink those alternatives would be used. NNTP and its applications have evolved to provide a set of much more sophisticated means of accessing and giving information than any forum I've ever seen. Sadly web forums (esp. the ugly, slw PHPBB, and the unspeakable Google groups) are increasingly replacing usenet, but there are exceptions (DragonflyBSD). One good solution is a furum which is also accessible by NNTP. On the information side (in contrast to the discussion side) RSS is replacing Usenet, with some obvious disadvantages: go on vacation, return after a week, and -- yahoo! -- all your RSS feeds only turn of the, say, most recent 30 articles, while your newsgroups all show everything you missed. Same applies to most newsfeeds, depending on retention. If you want to look a long way back in a thread, use Google Groups. -- Chris Green -- http://mail.python.org/mailman/listinfo/python-list
Re: Jargons of Info Tech industry
In comp.lang.perl.misc John Bokma [EMAIL PROTECTED] wrote: [EMAIL PROTECTED] wrote: In comp.lang.perl.misc John Bokma [EMAIL PROTECTED] wrote: the argument that usenet should never change seems a little heavy-handed and anachronistic. No, simple since there *are* alternatives: web based message boards. Those alternatives *do* support HTML formatting (often the subset mentioned ... and generally these web based message boards (i.e. forums I assume you mean) have none of the useful tools that Usenet offers and are much, much slower. Yup, Slow because of all the HTML and avatars. And you suggest to introduce such a thing to Usenet? No, quite the opposite, I like Usenet News as it is. And which useful tools do you require? A choice of news readers to suit different people with different interfaces, filtering, kill files, etc. etc. A forum provides a single, usually rather limited, interface for the user with no way for the user to change it radically. -- Chris Green -- http://mail.python.org/mailman/listinfo/python-list
Re: Jargons of Info Tech industry
Mike Meyer wrote: Mike Schilling [EMAIL PROTECTED] writes: Another advantage is that evewry internet-enabled computer today already comes with an HTML renderer (AKA browser) No, they don't. Minimalist Unix distributions don't include a browser by default. I know the BSD's don't, and suspect that gentoo Linux doesn't. HTML is designed to degrade gracefully (never mind that most web authors and many browser developers don't seem to comprehend this), so you don't really need a subset html to get the safety features you want. All you need to do is disable the appropriate features in the HTML renderer in your news and mail readers. JavaScript, Java, and any form of object embedding. Oh yeah, and frames. That's a good idea. I have parts of it disabled. The advantage of disabling them all is that you don't have to visit all those crappy modern websites, because they don't work. What I hate about most are the sites that don't even *mention* that they want cookies. Often I have to wonder, reinput input fields etc. and then after ten minutes trying *bang*, the idea, maybe to allow cookies for that site. Some people really don't have a clue, but kludgy web standards technologies (by the oh-so-omnisavant W3C) kind of force it. -- I believe in Karma. That means I can do bad things to people all day long and I assume they deserve it. Dogbert -- http://mail.python.org/mailman/listinfo/python-list
Re: Setting the encoding in pysqlite2
On Thu, Aug 25, 2005 at 01:15:55AM -0700, Michele Simionato wrote: An easy question, but I don't find the answer in the docs :-( I have a sqlite3 database containing accented characters (latin-1). How do I set the right encoding? For instance if I do this: [...] You cannot set the encoding directly, because TEXT data in SQLite3 databases is expected to be in UTF-8 encoding. If you store weird TEXT, you can work around it by using a custom converter in pysqlite2, like in the following example: #-*- encoding: latin-1 -*- from pysqlite2 import dbapi2 as sqlite # Register an additional converter for plain bytestrings sqlite.register_converter(bytestring, str) con = sqlite.connect(:memory:, detect_types=sqlite.PARSE_COLNAMES) cur = con.cursor() cur.execute(create table test(t)) testdata = H?ring # bytestring in ISO-8859-1 encoding cur.execute(insert into test(t) values (?), (testdata,)) # Try to retrieve the test data, will fail try: cur.execute(select t from test) except UnicodeDecodeError: print Could not decode latin1 as utf-8 (as expected) # Via the PARSE_COLNAMES trick, explicitly choose the bytestring converter # instead of the default unicode one: cur.execute('select t as t [bytestring] from test') result = cur.fetchone()[0] assert testdata == result print Correctly retrieved test data HTH, -- Gerhard -- http://mail.python.org/mailman/listinfo/python-list
Re: Jargons of Info Tech industry
Chris Head [EMAIL PROTECTED] wrote: John Bokma wrote: Additionally, a user interface operating inside an HTML renderer can NEVER be as fast as a native-code user interface with only the e-mail message itself passed through the renderer. Nowadays, more then futile. Sorry, I don't understand what you mean. Even on my 2.8GHz Pentium 4, using Thunderbird to juggle messages is noticeably faster than wandering around Hotmail. Complex HTML rendering still isn't absolutely instantaneous. It can be made much faster. There will always be a delay since messages have to be downloaded, but with a fast connection and a good design, the delay will be very very small and the advantages are big. It's significantly more painful when I use my 433MHz Celeron. It simply takes a long time to jump between message, inbox, other message, inbox, other other message, inbox, etc. ... This can be designed much better by using iframes, maybe even Ajax. Agreed. Judicious use of frames (internal or otherwise) or Javascript-based partial reloads could seriously improve the situation. They might also provide an easier way for Webmail providers to implement their pages in valid HTML: if you render the entire e-mail message alone in a frame, you don't have to start stripping out pieces of e-mail because they already exist (html and body elements, for example) Yup. Why can't we use the Web for what it was meant for: viewing hypertext pages? Why must we turn it into a wrapper around every application imaginable? Because it works? ... and purpose-built client applications (e.g. Thunderbird) don't? if A - B, it doesn't say that B - A :-) I.e. that it works via HTML doesn't mean it doesn't with a dedicated client ;-). I live in Mexico, most people here rely on so called Internet cafes for their connection, and even the use of a computer. For them Thunderbird *doesn't work*. Maybe I'm old-fashioned but I still very much prefer thick clients. They simply feel much more solid. Perhaps part of it is that thin clients have to communicate with the server at least a little bit for just about everything they do, while thick clients can do a lot of work without ANY Internet round-trip delay at all. Each has it's place. A bug in a thick client means each and everyone has to be fixed. With a thin one, just one has to be fixed :-D. Hotmail has to talk to the server to move a message from one mailbox to another. Thunderbird doesn't. Depends on where your mailbox resides. Isn't there something called MAPI? (I haven't used it myself, but I recall something like that). Ergo, Thunderbird is faster as soon as the Internet gets congested. Ah, yeah, wasn't that predicted to happen in like 2001? Also, unless you have some program that kills spam on the server, you have to download all with Thunderbird. I remember a funny day when I got 2000 messages/hour due to a virus outbreak :-( With hotmail, if you have 100 new messages you download them when you read them. Or kill them when you don't want to read. -- John Small Perl scripts: http://johnbokma.com/perl/ Perl programmer available: http://castleamber.com/ Happy Customers: http://castleamber.com/testimonials.html -- http://mail.python.org/mailman/listinfo/python-list
Re: Limited XML tidy
[EMAIL PROTECTED] writes: The problem is that when the sax handler raises an exception, I can't see how to find out why. What I want to do is for DodgyErrorHandler to do something different depending on where we are in the course of parsing. Is there anyway to get that information back from xml.sax (or indeed from any other sax handler?) You can get raw location information, yes. See: http://www.xml.com/pub/a/2004/11/24/py-xml.html But I don't think this is enough for you. You also need recovery, which you're implementing in crude form. (If you're referring to the Locator objects), yes I'm aware that's possible. But what I want is not my location in the document, but for the parser to say this is an error because I am in the middle of a tag the document ended, or I was in the middle of a text section and the document ended, or I was in the middle of an attribute value and the document ended, etc, so that I can then construct a simple end to the document, inserting quote marks, finishing the tag, and closing all unclosed tags as appropriate. I have just realised that I might be able to grab the message that the exception gives me, look at the expat source code and work out what parsing events cause which error messages. Which is a bit round the houses, but I think ought to work. I tend to agree with Magnus that using an SGML parser might be your best bet. You might even be able to turn that SGML into XML using a tool such as James Clark's SX: http://www.jclark.com/sp/sx.htm If I can't get my scheme above to work, I'll have a go. But I was hoping to do this without requiring additional packages. And in any case, it doesn't need to be perfectly robust. As long as it handles 99% of cases, I'll be happy. -- Dr. Toby White Dept. of Earth Sciences, Downing Street, Cambridge CB2 3EQ. UK Email: [EMAIL PROTECTED] -- http://mail.python.org/mailman/listinfo/python-list
Re: Better crypto hash functions, long, with code
Nice. Note that the Sourceforge bug for this issue indicates that something is already being done about it. It just happens to have been updated a day or so ago: https://sourceforge.net/tracker/?func=detailatid=355470aid=1123660group_id=5470 Note to skeptics: the attacks are pretty serious. Here's a demo of a meaningful possible fraud resulting from knowing just one md5 collision, possibly found by somebody else: http://www.cits.rub.de/imperia/md/content/magnus/rump_ec05.pdf Something similar can be done with SHA1 if a collision gets published. The work factor for finding an SHA1 collision is now down to O(2**63), which is within range of a distributed internet search. The md5 attack relies on the md5's message-extension property (shared by sha-1): if you find just one collision, you can easily generate an infinite family of colliding messages. Anyone know if the sha-2 hashes have that property? -- http://mail.python.org/mailman/listinfo/python-list
Re: Better crypto hash functions, long, with code
Bryan Olson [EMAIL PROTECTED] writes: The module provides classes and functions. The functions are: string_to_hex(str): Return a string with two hex digits for each byte of str, representing the ord() of the byte. The case of the hex digits A-F/a-f is up to Python's built-in formatting; Python doc doesn't specify the case, so it may be either and may change. oid_to_der(arc_sequence): Return the DER encoding of an OID, including the encoded tag and length. smd_from_oid(oid): Look up and return the Secure Message Digest class corresponding to the oid, or None if no such class is known. The oid may be a sequence of integer arcs, or a string holding the DER encoding. Note there's a PEP for crypto hash function API's and modules like hmac.py expect hashes to conform to it: http://www.python.org/peps/pep-0247.html You might want to bring your own API closer to it. Also, I think the PEP should be extended to include those OID lookup functions. -- http://mail.python.org/mailman/listinfo/python-list
classes and list as parameter, whats wrong?
Hi! I have a problem in a program. And I don't understand what is going on. I can code something, that the error doesn't occur anymore. But I still don't know the reason and this is unsatisfactory: Did I understood something wrong or is there a bug? To make it short, I boiled down the program to the crucial part. It looks like this: --- START #!/usr/bin/env python class cClass: Base class to handle playlists, i.e. the files, the name, etc. def __init__(self, LL=[]): self.list=LL def addFile(self,L): self.list.append(L) def main(): l1 = ['a','b','c'] lNames=['n1','n2','n3'] for name in lNames: objC=cClass() for each in l1: objC.addFile(each) print objC.list del objC if __name__ == __main__: main() --- END If I start it, I get the following output: ['a', 'b', 'c'] ['a', 'b', 'c', 'a', 'b', 'c'] ['a', 'b', 'c', 'a', 'b', 'c', 'a', 'b', 'c'] Why does this list grow? I thought, with every new instance the list LL is set to []? How can bring light in this? Best, Dirk -- http://mail.python.org/mailman/listinfo/python-list
Re: Bug in string.find; was: Re: Proposed PEP: New style indexing, was Re: Bug in slice type
Antoon Pardon wrote: Bryan Olson schreef: Steve Holden asked: And what are you proposing that find() should return if the substring isn't found at all? please don't suggest it should raise an exception, as index() exists to provide that functionality. There are a number of good options. A legal index is not one of them. IMO, with find a number of features of python come together. that create an awkward situation. 1) 0 is a false value, but indexes start at 0 so you can't return 0 to indicate nothing was found. 2) -1 is returned, which is both a true value and a legal index. It probably is too late now, but I always felt, find should have returned None when the substring isn't found. None is certainly a reasonable candidate. The one-past-the-end value, len(sequence), would be fine, and follows the preferred idiom of C/C++. I don't see any elegant way to arrange for successful finds always to return a true value and unsuccessful calls to return a false value. The really broken part is that unsuccessful searches return a legal index. My suggestion doesn't change what find() returns, and doesn't break code. Negative one is a reasonable choice to represent an unsuccessful search -- provided it is not a legal index. Instead of changing what find() returns, we should heal the special-case-when-index-is-negative-in-a-certain-range wart. -- --Bryan -- http://mail.python.org/mailman/listinfo/python-list
Re: classes and list as parameter, whats wrong?
No, the default paramter LL is only ever created once, not reinitialised every time the constructor is called - this is quite a common gotcha! You want to do something like: class cClass: Base class to handle playlists, i.e. the files, the name, etc. def __init__(self, LL=None): if LL == None: LL = [] self.list=LL def addFile(self,L): self.list.append(L) James On 8/26/05, Dirk Zimmermann [EMAIL PROTECTED] wrote: Hi! I have a problem in a program. And I don't understand what is going on. I can code something, that the error doesn't occur anymore. But I still don't know the reason and this is unsatisfactory: Did I understood something wrong or is there a bug? To make it short, I boiled down the program to the crucial part. It looks like this: --- START #!/usr/bin/env python class cClass: Base class to handle playlists, i.e. the files, the name, etc. def __init__(self, LL=[]): self.list=LL def addFile(self,L): self.list.append(L) def main(): l1 = ['a','b','c'] lNames=['n1','n2','n3'] for name in lNames: objC=cClass() for each in l1: objC.addFile(each) print objC.list del objC if __name__ == __main__: main() --- END If I start it, I get the following output: ['a', 'b', 'c'] ['a', 'b', 'c', 'a', 'b', 'c'] ['a', 'b', 'c', 'a', 'b', 'c', 'a', 'b', 'c'] Why does this list grow? I thought, with every new instance the list LL is set to []? How can bring light in this? Best, Dirk -- http://mail.python.org/mailman/listinfo/python-list -- http://mail.python.org/mailman/listinfo/python-list
Re: Jargons of Info Tech industry
Mike Schilling wrote: Threaded mail-readers too, screen-based editors , spell-checkers, all useless frills. Interestingly enough, I have explained my opinion in the part of the post you have trimmed. On the other hand, things you mentioned are far from being useless. They introduce no intrinsical slowdown due to increased bandwidth consumation, nor potential security problems. They have no downsides I can possibly think of and have many advantages. They are useful. HTML on Usenet is not. -- Denis -- http://mail.python.org/mailman/listinfo/python-list
Re: Should I move to Amsterdam?
Wouter van Ooijen (www.voti.nl) enlightened us with: True. Unless you have two proper locks. In that case your bike will last a very long time. Nope. You will probably retrieve your two locks from the fencing you attached them to (if you did!), with your bike gone. That's not my experience, but hey, who am I? I've just lived here for eight years. Sybren -- The problem with the world is stupidity. Not saying there should be a capital punishment for stupidity, but why don't we just take the safety labels off of everything and let the problem solve itself? Frank Zappa -- http://mail.python.org/mailman/listinfo/python-list
Re: minimalist regular expression
the shortest description in regex way -- http://mail.python.org/mailman/listinfo/python-list
DOM text
Hello Pythoners, I'm currently writing some Python to manipulate a semi-structured XML document. I'm using DOM (minidom) and I've got working code for transforming the document to HTML files and for adding the 'structured' elements which populate the higher regions of the tree (i.e. near the root). What I have to do next is write some code for working with the 'less structured' elements towards the 'leaf ends' of the tree. These are rather like little sub-documents and contain a mixture of text with inline formatting (for links, font styles, headings, paragraphs etc.) and objects (images, media files etc.). I admit I haven't tried very much code yet, but I'm not sure how I'm going to handle situations like: the user wants to insert a link in the middle of a paragraph. How can I use the DOM to insert a node into the middle of some text? Am I right in thinking that the DOM will reference a whole text node but nothing smaller? Any thoughts or suggestions would be very welcome! Cheers, Richard -- http://mail.python.org/mailman/listinfo/python-list
Re: variable hell
Benji York schrieb: suffix = 'var' vars()['a%s' % suffix] = 45 avar 45 Quoting from http://docs.python.org/lib/built-in-funcs.html#l2h-76 about the vars built in: The returned dictionary should not be modified: the effects on the corresponding symbol table are undefined. I tried this once and it worked. This may be too naive, so thanks for the warning :) -- --- Peter Maas, M+R Infosysteme, D-52070 Aachen, Tel +49-241-93878-0 E-mail 'cGV0ZXIubWFhc0BtcGx1c3IuZGU=\n'.decode('base64') --- -- http://mail.python.org/mailman/listinfo/python-list
Re: Should I move to Amsterdam?
Sybren Stuvel wrote: Martin P. Hellwig enlightened us with: Personal transportation sucks in the Netherlands, if you live in the Randstad (the area of the above mentioned cities) and you have to travel across the Randstad, you go with the bike and/or bus/tram/metro/train because that is the fastest way of transportation. And a bike isn't personal transportation? Yes it is, and it sucks too, or do you find it amusing to ride 15 clicks through rain and wind to get to your clients? Of course you go by car but then it will take you longer. Byt the way did you notice the travel across the Randstad part? By the way, the big cities are notorious for losing your bike fast. True. Unless you have two proper locks. In that case your bike will last a very long time. Yes that reminds me that I had 2 quite expensive abus locks on my rather cheap bike, the day after a hack was published on the Internet how to open this lock without damaging, the locks where stolen but my bike was further untouched, that pretty badly hurt my bikes ego I guess. That doesn't mean that public transportation is good, no actual since the public transportation is commercialized it sucks too. It's quite good actually. The Dutch Railways (Nationale Spoorwegen, NS for short) have a reputation of being late, but it isn't that bad. Trains run frequently, and if you have a serious delay, you even get part of your money back. They don't do it because they like the customer they do it because it's a law. My GF and I just got back from a holiday in Croatia. There, there is only a train every four hours, and then you're lucky. The track is so Croatia is hardley comparible to western europe. bad, going by bus is just as fast, except you can buy a ticket on the bus instead of having to buy a ticket + reservation in advance. On the way back, we used the ICE (intercity express) through Germany. It got delayed, so we missed our train to Amsterdam by 15 minutes. The Aah yes, ICE, always put in a extra half hour if you need to change trains, you don't wat to miss reserved trains, no realy you don't want to. It is just the same as with airplanes. delay was in Köln, because the pope paid a visit - well known to the Deutsche Bahn, but still they didn't do anything about it. We had to use another train which left two hours later. And we didn't get any compensation for this - not even for the reservation for the train we missed. Same as with airplanes. We had a delay of two hours. In The Netherlands you would at least get a significant percentage of your money back. Not in Germany. Strange, I very frequently go with rail like transportation across western europe and the only place where it sucks more then in the Netherlands is the UK or France when they doing another strike. I do not account major accidents like flooding, storm or earthquakes. After all, I think with the frequent trains (compared to Croatia) and reasonable refunds (compared to Germany), the NS isn't that bad after all. Comparing it to Belgium, France, Luxembourg, Germany, Spain, Norway, Swizz etc.etc. okay, but comparing it with a former Communistic country? They still have about 45 years of catching up to do and to there credits they develop much faster then the old western countries. I heard that in Swizz public transportation tend to leave on time and even arrive on time! Compare that with 12% delayed leaving and 27% delayed arrivals of trains in the Netherlands. A rule of thumb is that as soon as the weathere changes (it doesn't matter what from what and where too) you have at least a 15 minute delay between the major stations. Just don't plan to get anywhere special with public transportation after 2300h. There are night trains between the big cities in the Randstad. At least in Amsterdam busses go through the city all the night, every night. I don't know about other cities - I live in Amsterdam. There still alot of people living in cities like Gouda or surrounding villages in Het Groene Hart, and most of them can only get home after 23.00h when they go by car (or motorbike). cut Most people in here are non-believers or so lightly believers that you won't know the difference between them and the non-believers. The biggest part of the remaining believers are realistic and value life, moral and norms without compromising public safety, of course fanatics are every where in the world including the Netherlands. Here in Amsterdam, things are getting more nasty. A writer/critic/actor was killed in the name of Allah, just because he excercised his freedom of speech. Another man was seriously messed up while standing in his own front door opening, just because he's homosexual. In his street, sometimes people are shouting Go away you homo, you're not welcome here. This is a Macoccan street!. I'm not discriminating, but Maroccans telling Dutch people they aren't welcome in their own captial?
Re: minimalist regular expression
[EMAIL PROTECTED] wrote: Exists some tool, programs or some able to compute the minimal regular expression, namely ,taking a series of regular exoression, the minimal one that makes the same matching? thanx in advance m//; it matches everything. Perhaps you need to better define your problem statement. Sample input, desired output... Paul Lalli -- http://mail.python.org/mailman/listinfo/python-list
Re: DOM text
Richard Lewis wrote: I admit I haven't tried very much code yet, but I'm not sure how I'm going to handle situations like: the user wants to insert a link in the middle of a paragraph. How can I use the DOM to insert a node into the middle of some text? Am I right in thinking that the DOM will reference a whole text node but nothing smaller? You have to split the text-node, and add the two resulting noedes together with the new link-node (or whatever node you want there, can be a whole tree) in the correct order to the parent of the two node. If unsure what that means, create two simple documents and parse these to dom to see how that works. Diez -- http://mail.python.org/mailman/listinfo/python-list
problem with classes
I am having a strange problem with classes. I'm fairly sure the problem is with classes, anyway, because when I re-write the program without them, it works like I'd expect it to. When I run this program, at first, L[0].z[1] is 0, because z=[0,0]. But after I run that loop to assign different values to L[1].z[0] and L[1].z[1], somehow the value of L[0].z[1] has changed to 1. I have no idea why this is happening, can anyone help me? class Stuff: z=[0,0] L = [Stuff(),Stuff()] print L[0].z[1]=%i % L[0].z[1] for j in range(2): L[1].z[j] = j print L[0].z[1]=%i % L[0].z[1] -- http://mail.python.org/mailman/listinfo/python-list
Re: file access dialog
On Fri, 26 Aug 2005 07:52:06 GMT, Wouter van Ooijen (www.voti.nl) [EMAIL PROTECTED] wrote: I have a tool in Python to which I want to add a small GUI. The tools currently runs everywhere PySerial is supported. I need a file-access dialog. What is the preffered way to to this? Is there a platform-independent file-access dialog available, or should I use the windows native version when running on windows (and how do I do that)? Tkinter has a file acces dialog available with the same API on all platforms. It is also mapped to the standard dialog on Windows. Since Tkinter is certainly installed by default with Python, if a file dialog is everything you need, you probably don't have to look further. To use the dialog, just do: from Tkinter import Tk from tkFileDialog import askopenfilename ## Tk needs a main window to work, so create one and hide it root = Tk() root.withdraw() ## Ask the file name fileName = askopenfilename(filetypes=[('Python files', '*.py'), ('All files', '*')]) if fileName: print 'open', fileName else: print 'cancelled' ## Over root.destroy() HTH -- python -c print ''.join([chr(154 - ord(c)) for c in 'U(17zX(%,5.zmz5(17;8(%,5.Z65\'*9--56l7+-']) -- http://mail.python.org/mailman/listinfo/python-list
Re: Should I move to Amsterdam?
Martin P. Hellwig enlightened us with: Yes it is, and it sucks too In Amsterdam, it's the best way to go. or do you find it amusing to ride 15 clicks through rain and wind to get to your clients? Makes a man out of you ;-) Of course, rain sucks, but as long as it's not raining too hard it's not really an issue for me. By the way did you notice the travel across the Randstad part? Sure. I wouldn't want to bike from Amsterdam to Rotterdam either. Yes that reminds me that I had 2 quite expensive abus locks on my rather cheap bike, the day after a hack was published on the Internet how to open this lock without damaging, the locks where stolen but my bike was further untouched, that pretty badly hurt my bikes ego I guess. LOL :) if you have a serious delay, you even get part of your money back. They don't do it because they like the customer they do it because it's a law. I don't mind for what reason they do it. Fact is that they do it. Comparing it to Belgium, France, Luxembourg, Germany, Spain, Norway, Swizz etc.etc. okay, but comparing it with a former Communistic country? Hey, I just had a three week holiday in Croatia with transportation mostly by train. It made me a lot more positive about the NS. Yeah that sucks, but this is the work of fanatics and in no way by the average, anyone searching for a reason for murder, rape or opression can find them in any religious context that doesn't matter if it's one of various christian incarnations, islam or whatever mono/multi/none-god(s) believes people believe in. Oh I agree to that. The problem IMHO is that currently the name of Allah and/or the Islam are used a lot when people are killed, and we don't see a massive counter-move from other (not mentally insane like those fanatics) Islamitic people. Sybren -- The problem with the world is stupidity. Not saying there should be a capital punishment for stupidity, but why don't we just take the safety labels off of everything and let the problem solve itself? Frank Zappa -- http://mail.python.org/mailman/listinfo/python-list
Re: problem with classes
cfgauss wrote: I am having a strange problem with classes. I'm fairly sure the problem is with classes, anyway, because when I re-write the program without them, it works like I'd expect it to. When I run this program, at first, L[0].z[1] is 0, because z=[0,0]. But after I run that loop to assign different values to L[1].z[0] and L[1].z[1], somehow the value of L[0].z[1] has changed to 1. I have no idea why this is happening, can anyone help me? class Stuff: z=[0,0] This is a class attribute (shared by all instances of Stuff), not an instance attribute. To define instance attribute, the syntax is: class Stuff(object): def __init__(self): self.z = [0, 0] -- bruno desthuilliers python -c print '@'.join(['.'.join([w[::-1] for w in p.split('.')]) for p in '[EMAIL PROTECTED]'.split('@')]) -- http://mail.python.org/mailman/listinfo/python-list
Re: DOM text
On Fri, 26 Aug 2005 12:13:10 +0200, Diez B. Roggisch [EMAIL PROTECTED] said: Richard Lewis wrote: I admit I haven't tried very much code yet, but I'm not sure how I'm going to handle situations like: the user wants to insert a link in the middle of a paragraph. How can I use the DOM to insert a node into the middle of some text? Am I right in thinking that the DOM will reference a whole text node but nothing smaller? You have to split the text-node, and add the two resulting noedes together with the new link-node (or whatever node you want there, can be a whole tree) in the correct order to the parent of the two node. If unsure what that means, create two simple documents and parse these to dom to see how that works. Thanks. I was kind of worried it might be like that! I'm implementing a Cursor class now which keeps track of the current parent Element, text node and character position so that I can easily (I hope ;-) work out where the splitting and inserting needs to occur. Wish me luck!! Cheers, Richard -- http://mail.python.org/mailman/listinfo/python-list
ideas for university project ??
Hi I'm about to start my third, and final, year in computer science at cambridge uni, and i need to come up with an idea for a software project, but i'm really struggling for ideas, and i was wondering whether anyone here had any suggestions. I'd say i'm probably most experienced in Java, but I have started learning Python, and although i haven't got very far yet, I plan on doing some more in the next few weeks. Areas of interested include AI, distributed systems. Most of all i want something that is interesting, and actually useful (thats probably stating the obvious!) Cheers Jon -- http://mail.python.org/mailman/listinfo/python-list
Re: file access dialog
Wouter van Ooijen wrote: I have a tool in Python to which I want to add a small GUI. The tools currently runs everywhere PySerial is supported. I need a file-access dialog. What is the preffered way to to this? Is there a platform-independent file-access dialog available, or should I use the windows native version when running on windows (and how do I do that)? depends on what GUI toolkit you prefer to use. for Tkinter (which is available on most modern platforms), see File Dialogs on this page: http://www.pythonware.com/library/tkinter/introduction/x1164-data-entry.htm the following thread may also be helpful: http://tinyurl.com/b2zxb /F -- http://mail.python.org/mailman/listinfo/python-list
Re: variable hell
Adriaan Renting wrote: Not in my Python. for count in range(0, 10): ... value = count ... exec('a%s=%s' % (count, value)) But that's not what rafi suggested. rafi: why using the eval? exec ('a%s=%s' % (count, value)) See the difference? -- Robert Kern [EMAIL PROTECTED] In the fields of hell where the grass grows high Are the graves of dreams allowed to die. -- Richard Harter -- http://mail.python.org/mailman/listinfo/python-list
Re: Usenet, HTML (was Re: Jargons of Info Tech industry)
Ulrich Hobelmann [EMAIL PROTECTED] wrote: John Bokma wrote: Ulrich Hobelmann [EMAIL PROTECTED] wrote: On the information side (in contrast to the discussion side) RSS is replacing Usenet, LOL, how? I can't post to RSS feeds. Or do you mean for lurkers? I said information side, meaning stuff like RSS is used for. Nah, I wouldn't call it a replacement. Maybe of mailinglists with latest news. There is no real reason why NNTP couldn't be used like RSS (i.e. contain a small description and a web link as message text), It has been used like that for ages (or as long as I can remember). Yes, but for some reason people jumped onto the RSS hype. You think so? Like on push technology, VRML, and what more? Most of my friends have no clue what RSS is. Maybe in IE7, when it's more hidden, people will use it. But I wouldn't call it a hype, unless a hype is something many people shout you have to have it (hmm...) I wonder why. Heck, even I am subscribed to a bunch of RSSes, because those institutions don't offer NNTP ;) But they probably have (or had) a mailing list. or why a newsgroup shouldn't we written in HTML and contain a (default, or user-provided) CSS sheet. It's called www. It's already here (or there) Well, but forums only emulate the posting/reply structure. It would make more sense to use NNTP for that, Why? It now works in the browser, you don't need to install another client. Moreover, many people, especially where I live, don't have a computer at home. Same for many students I know, they use the computer at school. And many people I know with a job use the computer at work. And not everybody wants to install a client for each and every protocol. Hence why things like webmessenger are used. and use $WHATEVER, e.g. HTML, for markup inside the posts. WWW is something else; a bunch of pages with hyperlinks to each other. Maybe we shouldn't call web forums and other dynamic websites www, as they don't really follow that purpose. Nonsense. They are just abuses of HTTP/HTML/JS for thin clienting. ;) Like UUencode is abuse of ASCII? LOL! But why do you want that? (Oh, and you can't read news with Outlook). Why do you want more people on Usenet? No, I'm not talking about usenet. I'm glad if the SNR keeps as high (haha) as it is, and messages in plain text. I'm talking about using the technology for communication, instead of reinventing the wheel with crappy web forums. What is exactly crappy about those forums? Oh, and I've heard there are people reading our in-house newsgroup with Outlook. Amazing, since I always understood that it can't do NNTP. while today everything is just Browser+HTTP. And what's wrong with that? It's slow and pointless. The huge success of web based message boards seems so say something entirely different. When I post with X-news, there is a delay, when I post with my browser, there is a delay. I have no idea which delay is more significant. Maybe they are too close. All interaction that's more than clicking a link has to be emulated with Javascript (heard of Ajax already? Yes, I even mentioned it in this thread. And what's the problem? ) to make it more smooth. HTML was never a programming language, and will never be. Hence for fancy stuff you have to use a programming language. Nothing wrong with that. NNTP has advantages like giving you only the headlines first, so you can choose what to check out. Funny, I see the same when I use phpBB. Headlines. Then you can get the article if you like (in the communication case) Yup, same with phpBB, I click a link, and bzzzt.. there is the article, and the replies to it. or the news description (in the RSSoid case) Yup, there is a mod for phpBB that makes it possible to give each post besides a title a short description. and maybe click on a link inside. Saves bandwidth and is quite faster than waiting for some overloaded PHP server to send you a bunch of HTML tables. Hence, overloaded servers shouldn't use PHP, or use special caching tricks. I can't remember having seen slow boards, even not the ones with hundreds of simultaneous users (for example phpbb.com). Responding doesn't involve *any* HTTP requests, No, but it requires sending your post to an NNTP server. Which takes time (when I press send, I don't see this window close immediately). just a keypress and you're typing. Just a mouse click. Web forums are stone-age, as are most web-pages. Maybe you should visit one and check out for yourself. Age has little to do with it, Usenet is way older, works. IRC is way older, works. -- John Small Perl scripts: http://johnbokma.com/perl/ Perl programmer available: http://castleamber.com/ Happy Customers: http://castleamber.com/testimonials.html -- http://mail.python.org/mailman/listinfo/python-list
Re: DOM text
Richard Lewis wrote: Hello Pythoners, I'm currently writing some Python to manipulate a semi-structured XML document. I'm using DOM (minidom) and I've got working code for transforming the document to HTML files and for adding the 'structured' elements which populate the higher regions of the tree (i.e. near the root). What I have to do next is write some code for working with the 'less structured' elements towards the 'leaf ends' of the tree. These are rather like little sub-documents and contain a mixture of text with inline formatting (for links, font styles, headings, paragraphs etc.) and objects (images, media files etc.). You might find that the more Pythonic XML modules are better suited to handling mixed content. I've been using lxml and ElementTree quite successfully. Amara should also be particularly well-suited to handling mixed content, but I haven't used it in anger, yet. -- Robert Kern [EMAIL PROTECTED] In the fields of hell where the grass grows high Are the graves of dreams allowed to die. -- Richard Harter -- http://mail.python.org/mailman/listinfo/python-list
Re: ideas for university project ??
Jon Hewer enlightened us with: Areas of interested include AI, distributed systems. Most of all i want something that is interesting, and actually useful (thats probably stating the obvious!) You could help developing Dynamite (contact Dick van Albada from the University of Amsterdam for that), perhaps extend it to work with Python. It's a system to do process migration from node to node in a really nice way. Once a program is compiled with Dynamite, you can send it a signal and it'll write it's current state into a new ELF binary. You can then move that binary to another node in your distributed system, and execute it as any other executable. The program will continue to run from where it left off. Sybren -- The problem with the world is stupidity. Not saying there should be a capital punishment for stupidity, but why don't we just take the safety labels off of everything and let the problem solve itself? Frank Zappa -- http://mail.python.org/mailman/listinfo/python-list
Re: Jargons of Info Tech industry
[EMAIL PROTECTED] wrote: NNTP and its applications have evolved to provide a set of much more sophisticated means of accessing and giving information than any forum I've ever seen. Example(s). And do users need those sophisticated things? -- John Small Perl scripts: http://johnbokma.com/perl/ Perl programmer available: http://castleamber.com/ Happy Customers: http://castleamber.com/testimonials.html -- http://mail.python.org/mailman/listinfo/python-list
Re: classes and list as parameter, whats wrong?
Thanks for your help. * James [EMAIL PROTECTED] [2005-08-26 11:42]: No, the default paramter LL is only ever created once, not reinitialised every time the constructor is called - this is quite a common gotcha! But still, it is not absolutely clear for me, what is going on. So, at least just for my understanding: The parameter LL is created just once for the whole class and not for the object (because I del the object explicitly, which should destroy the object)? Thanks, Dirk -- http://mail.python.org/mailman/listinfo/python-list
Re: Jargons of Info Tech industry
[EMAIL PROTECTED] wrote: In comp.lang.perl.misc John Bokma [EMAIL PROTECTED] wrote: [ web based boards ] And which useful tools do you require? A choice of news readers to suit different people with different interfaces, - different browsers, different stylesheets, different board styles (themes). filtering, There is often a search function, which filters away everything that doesn't match. There are also things like word filters, etc. kill files, http://www.phpbb.com/phpBB/viewtopic.php?t=150586highlight=ignore etc. etc. http://www.phpbb.com/mods/ A forum provides a single, usually rather limited, interface for the user with no way for the user to change it radically. Does the user want this? And with a user stylesheet you can change it quite radically :-) And in return the user gets: colors, fonts, font sizes, embedding of images, flash, you name it. Moving avatars, even sounds. Oh, yes, I would love to see an XML interface on the board I use. Maybe I can just install a mod, or write one myself. -- John Small Perl scripts: http://johnbokma.com/perl/ Perl programmer available: http://castleamber.com/ Happy Customers: http://castleamber.com/testimonials.html -- http://mail.python.org/mailman/listinfo/python-list
Re: Jargons of Info Tech industry
Ulrich Hobelmann [EMAIL PROTECTED] wrote: What I hate about most are the sites that don't even *mention* that they want cookies. Often I have to wonder, reinput input fields etc. and then after ten minutes trying *bang*, the idea, maybe to allow cookies for that site. So your browser doesn't warn you? -- John Small Perl scripts: http://johnbokma.com/perl/ Perl programmer available: http://castleamber.com/ Happy Customers: http://castleamber.com/testimonials.html -- http://mail.python.org/mailman/listinfo/python-list
Re: Bug in string.find; was: Re: Proposed PEP: New style indexing, was Re: Bug in slice type
Bryan Olson [EMAIL PROTECTED] wrote in news:[EMAIL PROTECTED]: Steve Holden asked: Do you just go round looking for trouble? In the course of programming, yes, absolutly. As far as position reporting goes, it seems pretty clear that find() will always report positive index values. In a five-character string then -1 and 4 are effectively equivalent. What on earth makes you call this a bug? What you just said, versus what the doc says. And what are you proposing that find() should return if the substring isn't found at all? please don't suggest it should raise an exception, as index() exists to provide that functionality. There are a number of good options. A legal index is not one of them. Practically speaking, what difference would it make? Supposing find returned None for not-found. How would you use it in your code that would make it superior to what happens now? In either case you would have to test for the not-found state before relying on the index returned, wouldn't you? Or do you have a use that would eliminate that step? -- rzed -- http://mail.python.org/mailman/listinfo/python-list
Re: Jargons of Info Tech industry
Denis Kasak [EMAIL PROTECTED] wrote: Mike Schilling wrote: Threaded mail-readers too, screen-based editors , spell-checkers, all useless frills. Interestingly enough, I have explained my opinion in the part of the post you have trimmed. On the other hand, things you mentioned are far from being useless. They introduce no intrinsical slowdown due to increased bandwidth consumation, nor potential security problems. You can't be sure: errors in the handling of threads can cause a buffer overflow, same for spelling checking :-D They have no downsides I can possibly think of Some people never use them, and hence they use memory and add risks. and have many advantages. They are useful. HTML on Usenet is not. Of course can HTML be useful on Usenet. The problem is that it will be much more often abused instead of used. -- John Small Perl scripts: http://johnbokma.com/perl/ Perl programmer available: http://castleamber.com/ Happy Customers: http://castleamber.com/testimonials.html -- http://mail.python.org/mailman/listinfo/python-list
Re: ideas for university project ??
Jon Hewer [EMAIL PROTECTED] writes: Hi I'm about to start my third, and final, year in computer science at cambridge uni, and i need to come up with an idea for a software project, but i'm really struggling for ideas, and i was wondering whether anyone here had any suggestions. I'd say i'm probably most experienced in Java, but I have started learning Python, and although i haven't got very far yet, I plan on doing some more in the next few weeks. Areas of interested include AI, distributed systems. Most of all i want something that is interesting, and actually useful (thats probably stating the obvious!) Well, there's a dearth of good software for network management especially for medium to large networks. Traffic stats, configuration management, device status etc. It would certainly be useful but whether it rocks your boat interest wise ... Admittedly I personally would like to play with Erlang rather than Python for this. Eddie -- http://mail.python.org/mailman/listinfo/python-list
Re: Usenet, HTML (was Re: Jargons of Info Tech industry)
In comp.lang.perl.misc John Bokma [EMAIL PROTECTED] wrote: I'm talking about using the technology for communication, instead of reinventing the wheel with crappy web forums. What is exactly crappy about those forums? They are slow They are inflexible They are slow They don't allow the user to choose how to view them, the interface is imposed on the user. They are slow They don't have killfiles or scoring They are slow -- Chris Green -- http://mail.python.org/mailman/listinfo/python-list
Re: Command Line arguments
On Thu, 25 Aug 2005 11:39:48 -0700, Trent Mick wrote: [michael wrote] SOLVED! Thank you. I wonder why this was needed for 2.4 and not 2.2? I don't think it was lingering things from old installs because it happened on a persons computer that had never had any python installed before 2.4. It might be due to a bug in the Python 2.4 installer not setting the proper file associations. What installer package did you use? Trent I used the python2.4.MSI from python.org site (dated 3-6-05). I think this was the first time they went to MSI verses an exe based installer. it says Python 2.4 (#60 November 30th, 2004) when I start it. Michael -- http://mail.python.org/mailman/listinfo/python-list
Re: Jargons of Info Tech industry
In comp.lang.perl.misc John Bokma [EMAIL PROTECTED] wrote: [EMAIL PROTECTED] wrote: NNTP and its applications have evolved to provide a set of much more sophisticated means of accessing and giving information than any forum I've ever seen. Example(s). And do users need those sophisticated things? Kill files Selecting posts and threads based on a scoring system A huge variety of different newsreaders allowing different users to access the news in they way they want. I don't use all the possibilities (e.g. I don't use kill files) but I do use a 'minority' text based newsreader because it is ideal for me. I don't get the option of a text based forum reader - I doubt many forums work with lynx. -- Chris Green -- http://mail.python.org/mailman/listinfo/python-list
Re: Jargons of Info Tech industry
In comp.lang.perl.misc John Bokma [EMAIL PROTECTED] wrote: They have no downsides I can possibly think of Some people never use them, and hence they use memory and add risks. So they can choose a newsreader that doesn't have these facilities, no extra memory use, no risk. -- Chris Green -- http://mail.python.org/mailman/listinfo/python-list
Re: Jargons of Info Tech industry
John Bokma wrote: [EMAIL PROTECTED] wrote: In comp.lang.perl.misc John Bokma [EMAIL PROTECTED] wrote: [ web based boards ] And which useful tools do you require? A choice of news readers to suit different people with different interfaces, - different browsers, different stylesheets, different board styles (themes). But the UI is still *forced* on you by the website; no choice. There's only a very limited choice, and it invariably *includes* the UI. With NNTP *you* choose how to interpret and display the data you get. http://www.phpbb.com/mods/ Great. How can I, the user, choose, how to use a mod on a given web server? What if the web server runs another board than PHPBB? A forum provides a single, usually rather limited, interface for the user with no way for the user to change it radically. Does the user want this? And with a user stylesheet you can change it quite radically :-) The look, not the feel. And in return the user gets: colors, fonts, font sizes, embedding of images, flash, you name it. Moving avatars, even sounds. As I wrote earlier, you *could* run a web forum over NNTP, and use HTML posts instead of plain text. It would have the advantages of NNTP. Oh, yes, I would love to see an XML interface on the board I use. Maybe I can just install a mod, or write one myself. What would that XML be for? Any particular *use*? -- I believe in Karma. That means I can do bad things to people all day long and I assume they deserve it. Dogbert -- http://mail.python.org/mailman/listinfo/python-list
Re: Jargons of Info Tech industry
John Bokma wrote: Ulrich Hobelmann [EMAIL PROTECTED] wrote: What I hate about most are the sites that don't even *mention* that they want cookies. Often I have to wonder, reinput input fields etc. and then after ten minutes trying *bang*, the idea, maybe to allow cookies for that site. So your browser doesn't warn you? About what? I have cookies off, with explicit exception for sites where I want cookies. When the crappy website doesn't bother to MENTION that it wants cookies, i.e. give me an error page, how am I to know that it needs cookies? Do I want EVERY website to ask me do you allow XY to set a cookie? NO! -- I believe in Karma. That means I can do bad things to people all day long and I assume they deserve it. Dogbert -- http://mail.python.org/mailman/listinfo/python-list
Problems with kdecore...
When I run my Application it crashes at the following part: - [ code ] from kdecore import KLibLoader, KLibFactory def myApp (self): # ... offer = KTrader.self().query(text/html) # the offer can handle HTML - so try loading the library strOffer = offer[0].library().latin1() factory = KLibLoader().factory (strOffer) if factory : args = QStringList() args.append(in shell) html = factory.create ( self, 'nme', KParts::ReadOnlyPart, args ) - .. I tried it with an without arguments - everytime it crashes by trying factory.create with the answer: KCrash: Application 'myApp.py' crashing... -- http://mail.python.org/mailman/listinfo/python-list
Re: minimalist regular expression
[EMAIL PROTECTED] [EMAIL PROTECTED] wrote: the shortest description in regex way Which is? Oh, and please quote the previous message and author. Reply under the part you are replying too, etc. Even with Google this is possible. -- John Small Perl scripts: http://johnbokma.com/perl/ Perl programmer available: http://castleamber.com/ Happy Customers: http://castleamber.com/testimonials.html -- http://mail.python.org/mailman/listinfo/python-list
Excel Character object through COM
Hi! Maybe this question is already answared somewhere, but I could not find it: I want to modify one of the letters of a text of a Excel cell through COM; let's say to make it red. The VB reference tells that it can be managed with: With Worksheets(Sheet1).Range(A1) .Value = abcdefg .Characters(3, 1).Font.Bold = True End With However when I try the similar in Python (I used the 'COM Makepy utility' of Pythonwin) I got the following (Here 'A' is a class that wraps the 'com' things): A.book.Worksheets(1).Range(a1).Characters win32com.gen_py.Microsoft Excel 9.0 Object Library.Characters instance at 0x19420904 A.book.Worksheets(1).Range(a1).Characters(1,1) Traceback (most recent call last): File interactive input, line 1, in ? AttributeError: Characters instance has no __call__ method So my question is that am I doing something wrong or there is a different way to modify the color of a charater through COM. Thank you. Regards, Krisztian -- http://mail.python.org/mailman/listinfo/python-list
Re: classes and list as parameter, whats wrong?
Dirk Zimmermann wrote: But still, it is not absolutely clear for me, what is going on. So, at least just for my understanding: The parameter LL is created just once for the whole class and not for the object Yes. And because a lists are mutable, you can alter that one instance of the list - and teh following instances of your class ill see the changes. This is really a common mistake. Diez -- http://mail.python.org/mailman/listinfo/python-list
Opportunity in Open-Source Development
Hi Madhu, I came across your reference on the net and wanted to get in touch with you regarding an interesting possibility in the open-source space. We are working with one of our client, which is starting its engineering operations in Bangalore. The focus is on building open source solutions. The challenge for open source software is to provide the chain of accountability that IT organizations require for mission-critical systems. Open source offers direct access to source code and the engineers who wrote it, but the availability and cost of accessing such expert support varies widely. Enterprise IT customers need on-demand support, up-to-date documentation, and extreme reliability. Our client offers integrated, validated, and certified open source stacks with ongoing maintenance and enterprise-class support services. It also offers open source interoperability testing and management tools. They value and honor the efforts of the open source community, and are proud to contribute by extending open source efforts and by productizing open source solutions. This makes open source even more reliable, easy, and safe to deploy. I would like to discuss this opportunity with you in detail. Please let me know if I can reach you on any number to discuss this. You can reach me at +91-9880731941 Looking forward to your response. Regards,Rohit+91-9880731941 Contact us: [EMAIL PROTECTED]Visit us at www.careernet.co.in BANGALORECareerNet Technologies Pvt. Ltd# 8, SBI Colony, 7th "A" Main3rd Block, Koramangala ( On Sarjapur Road). Bangalore -- 560 034. Voice :+91-80-51991599 (Board Number)HYDERABADPlot #60, Chikoti Gardens, Begumpet, Hyderabad. Voice: +91-40-55332825. +91-93464-86575. -- http://mail.python.org/mailman/listinfo/python-list
Re: DOM text
Robert Kern wrote: You might find that the more Pythonic XML modules are better suited to handling mixed content. I've been using lxml and ElementTree quite successfully. fwiw, here's an ET snippet that inserts an anchor element inside a paragraph element: # from lxml.etree import * # or # from cElementTree import * # or from elementtree.ElementTree import * p = XML(pa link and some bbold/b text/p) a = Element(a, href=link) text = p.text # a link and some p.text = text[:2] # a is left after p a.text = text[2:6] # link goes inside a a.tail = text[6:] # and some goes after /a p.insert(0, a) print tostring(p) # pa a href=linklink/a and some bbold/b text/p (this works with ET, cET, lxml.etree, and any other ET-com- patible library, of course) /F -- http://mail.python.org/mailman/listinfo/python-list
Re: file access dialog
For simple, it's hard to beat EasyGUI: http://www.ferg.org/easygui/ Bob -- http://mail.python.org/mailman/listinfo/python-list
Re: ideas for university project ??
On 8/26/05, bruce [EMAIL PROTECTED] wrote: 1st question, can this be part of a startup? 2nd question, does your university expect to own the rights/IP of your efforts 3rd question, are you serious, or just looking for a 'project' for a grade I am pretty sure the university will hold any rights. I am not just looking for a project for a grade, I want to do something interesting and useful, and I also need to start thinking about the future, and if I really enjoy my project then maybe it's something I'd consider focusing on in the future. if you're serious, we can use your help! we're starting a project to create a business dealing with used texbooks for universities on US/Canadian college campuses. think ebay/craigslist meets the college campus. the project will invlove a great deal of distributed/parallel processing as we build the grid/spidering functionality to create the underlying databases.. I don't think my university would be too keen on this, because any work I do will, I expect, largely depend on the work of othersif something falls through then I'd be a bit screwed. But thanks anyway for the suggestion. It would, however, be perfectly acceptable to build upon a well established piece of open source software - this is very common. Thanks for all of the other suggestions, I'll research them a little bit more, and I may email some of you directly for more info if that's ok. Keep the ideas rolling :-) -- http://mail.python.org/mailman/listinfo/python-list
Re: Should I move to Amsterdam?
On Wed, 24 Aug 2005, Wade wrote: Nice little series by Seth Stevenson for Americans daydreaming about emigration. Somewhere, anywhere ... maybe Amsterdam? For a Python newsgroup, I'm surprised no one has mentioned yet that Guido van Rossum developed Python at the CWI in Amsterdam (called Stichting Mathematisch Centrum at the time). Type 'copyright' at the Python prompt some time. regards, -- Reinout van Schouwen *** student of Artifical Intelligence email: [EMAIL PROTECTED]*** mobile phone: +31-6-44360778 www.vanschouwen.info *** help mee met GNOME vertalen: nl.gnome.org -- http://mail.python.org/mailman/listinfo/python-list
Re: algorithm for non-dimensionalization
[EMAIL PROTECTED] wrote: Hi, I am trying to non-dimensionalize some data I have obtained. There are no 'standard' dimensionless groups for my application, so I would like to obtain the 'best' non-dimensional groups based on some statistical measures of the resulting transformed data. At this point, I am looking for a way to generate dimensionless groupings from a set of base units. I would like to have a way to output all dimensionless groups that comprise no more than some specified number of fundamental (or base) units. For instance, if I have data like the following: dat1(length), dat2(time), dat3(length), dat4(length/time), dat5(length^2) and I want dimensionless groups with no more than four base units, I would like a result like the following: dat1/dat3, dat1/(dat2*dat4), dat5/(dat1*dat3), dat5/(dat2*dat4*dat1), ... I plan to code this in Python, and would appreciate any thoughts you might have about algorithms or approaches to carry out this task. Thank you. -g Thinking more,it's an eigenvector problem. Where all dat* magnitudes are expressed as a vector of integers in the dimensions space,and the result vector is all 0. IE E=[m][L^2][T^-2] v=[L][T^-1] f=[T^-1] p=[m][L][T^-1] .. in the mass,lenght,time space are [1,2,-2] [0,1,-1] [0,0,-1] [1,1,-1] say matrix D then D*[x1,x2,x3,x4]=[0,0,0] (looking for adimensionals) So you are looking for an eigenvector formed by only integers. Ciao Paolino ___ Yahoo! Mail: gratis 1GB per i messaggi e allegati da 10MB http://mail.yahoo.it -- http://mail.python.org/mailman/listinfo/python-list
Re: Jargons of Info Tech industry
In comp.lang.perl.misc Mike Schilling [EMAIL PROTECTED] wrote: Denis Kasak [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] Mike Schilling wrote: I see a difference between X would be useful for A, B, and C and Y will always be the only proper way. Don't you? Y would not be useful because of the bandwidth it consumes, the malware it would introduce, the additional time spent focusing on the format rather than quality of the content and, frankly, because it's useless. Threaded mail-readers too, screen-based editors , spell-checkers, all useless frills. All dependent on and only affecting the user who employs them. It does not require other users to do anything. It is none of my business whether you used vi, emacs, ed or whatever to compose your message; whether you ran a spell checker over it; or how you read messages and respond to them - perhaps you telnet'd to the news server and made your transactions manually. Axel -- http://mail.python.org/mailman/listinfo/python-list
Re: Usenet, HTML (was Re: Jargons of Info Tech industry)
[EMAIL PROTECTED] wrote: In comp.lang.perl.misc John Bokma [EMAIL PROTECTED] wrote: I'm talking about using the technology for communication, instead of reinventing the wheel with crappy web forums. What is exactly crappy about those forums? They are slow I have no problems with it. Moreover, since I use an NNTP server which is a bit remote, it's way slower compared to the web forums I use. They are inflexible Examples? They don't allow the user to choose how to view them, the interface is imposed on the user. False. The user can pick themes, often several. The user can use a user stylesheet or several. And you can always write your own client :-D. They don't have killfiles or scoring You can install a mod to kill people. And I have no doubt that there is a scoring mod, or one can be written in a few hours. -- John Small Perl scripts: http://johnbokma.com/perl/ Perl programmer available: http://castleamber.com/ Happy Customers: http://castleamber.com/testimonials.html -- http://mail.python.org/mailman/listinfo/python-list
Re: Jargons of Info Tech industry
[EMAIL PROTECTED] wrote: In comp.lang.perl.misc John Bokma [EMAIL PROTECTED] wrote: [EMAIL PROTECTED] wrote: NNTP and its applications have evolved to provide a set of much more sophisticated means of accessing and giving information than any forum I've ever seen. Example(s). And do users need those sophisticated things? Kill files there is a mod for that (at least for phpBB) Selecting posts and threads based on a scoring system If there is no mod, one can be easily written. A huge variety of different newsreaders allowing different users to access the news in they way they want. Different browsers, stylesheets, themes. I don't use all the possibilities (e.g. I don't use kill files) but I do use a 'minority' text based newsreader because it is ideal for me. I don't get the option of a text based forum reader - I doubt many forums work with lynx. But have you tested it? You just blurb out random statements, based on gut feelings. Yes, phpBB works with lynx. And I doubt it's a rare exception. -- John Small Perl scripts: http://johnbokma.com/perl/ Perl programmer available: http://castleamber.com/ Happy Customers: http://castleamber.com/testimonials.html -- http://mail.python.org/mailman/listinfo/python-list
Re: Jargons of Info Tech industry
Ulrich Hobelmann [EMAIL PROTECTED] wrote: John Bokma wrote: [EMAIL PROTECTED] wrote: In comp.lang.perl.misc John Bokma [EMAIL PROTECTED] wrote: [ web based boards ] And which useful tools do you require? A choice of news readers to suit different people with different interfaces, - different browsers, different stylesheets, different board styles (themes). But the UI is still *forced* on you by the website; no choice. There's only a very limited choice, and it invariably *includes* the UI. With NNTP *you* choose how to interpret and display the data you get. With a web based forum too. Example: http://johnbokma.com/perl/phpbb-remote-backup.html http://www.phpbb.com/mods/ Great. How can I, the user, choose, how to use a mod on a given web server? Ask the admin? What if the web server runs another board than PHPBB? Check if there is a mod, and ask the admin. Does the user want this? And with a user stylesheet you can change it quite radically :-) The look, not the feel. Wild guess: (signed) javascript and iframes? on your local computer? Otherwise: fetch HTML, parse it, restructure it, and have the application run a local webserver. Python, Perl, piece of cake. And in return the user gets: colors, fonts, font sizes, embedding of images, flash, you name it. Moving avatars, even sounds. As I wrote earlier, you *could* run a web forum over NNTP, and use HTML posts instead of plain text. It would have the advantages of NNTP. Oh, yes, I would love to see an XML interface on the board I use. Maybe I can just install a mod, or write one myself. What would that XML be for? Any particular *use*? RSS feeds? XML-RPC? Access to the board with a better mark up then HTML supports? -- John Small Perl scripts: http://johnbokma.com/perl/ Perl programmer available: http://castleamber.com/ Happy Customers: http://castleamber.com/testimonials.html -- http://mail.python.org/mailman/listinfo/python-list
Re: Jargons of Info Tech industry
Ulrich Hobelmann [EMAIL PROTECTED] wrote: John Bokma wrote: Ulrich Hobelmann [EMAIL PROTECTED] wrote: What I hate about most are the sites that don't even *mention* that they want cookies. Often I have to wonder, reinput input fields etc. and then after ten minutes trying *bang*, the idea, maybe to allow cookies for that site. So your browser doesn't warn you? About what? That the site wants to set a cookie? Lynx does that. I have cookies off, with explicit exception for sites where I want cookies. When the crappy website doesn't bother to MENTION that it wants cookies, i.e. give me an error page, how am I to know that it needs cookies? Do I want EVERY website to ask me do you allow XY to set a cookie? NO! So what do you want? An error page for every site that wants to set a cookie? -- John Small Perl scripts: http://johnbokma.com/perl/ Perl programmer available: http://castleamber.com/ Happy Customers: http://castleamber.com/testimonials.html -- http://mail.python.org/mailman/listinfo/python-list
Re: Jargons of Info Tech industry
[EMAIL PROTECTED] wrote: In comp.lang.perl.misc John Bokma [EMAIL PROTECTED] wrote: They have no downsides I can possibly think of Some people never use them, and hence they use memory and add risks. So they can choose a newsreader that doesn't have these facilities, no extra memory use, no risk. That's besides the point, the point was that extra functionality has no downsides. They have. -- John Small Perl scripts: http://johnbokma.com/perl/ Perl programmer available: http://castleamber.com/ Happy Customers: http://castleamber.com/testimonials.html -- http://mail.python.org/mailman/listinfo/python-list
Re: ideas for university project ??
Am Fri, 26 Aug 2005 11:49:34 +0100 schrieb Jon Hewer: Hi I'm about to start my third, and final, year in computer science at cambridge uni, and i need to come up with an idea for a software project, but i'm really struggling for ideas, and i was wondering whether anyone here had any suggestions. Hi, you could port Python to the WRT54. The Linksys WRT54 is a WLAN-Router which runs Linux. See http://openwrt.org/ I think it is a good project for a university. It is software and hardware related. Thomas -- Thomas Güttler, http://www.thomas-guettler.de/ -- http://mail.python.org/mailman/listinfo/python-list
Re: DOM text
On Fri, 26 Aug 2005 13:59:09 +0200, Fredrik Lundh [EMAIL PROTECTED] said: Robert Kern wrote: You might find that the more Pythonic XML modules are better suited to handling mixed content. I've been using lxml and ElementTree quite successfully. fwiw, here's an ET snippet that inserts an anchor element inside a paragraph element: # from lxml.etree import * # or # from cElementTree import * # or from elementtree.ElementTree import * p = XML(pa link and some bbold/b text/p) a = Element(a, href=link) text = p.text # a link and some p.text = text[:2] # a is left after p a.text = text[2:6] # link goes inside a a.tail = text[6:] # and some goes after /a p.insert(0, a) print tostring(p) # pa a href=linklink/a and some bbold/b text/p (this works with ET, cET, lxml.etree, and any other ET-com- patible library, of course) Thanks for this suggestion. I've not come accress ElementTree before, but it looks really useful (plus there are Debian packages :-) The only thing is that I've already written quite a lot of my code using minidom and mixing the two sounds like a recipe for disaster. But I'll certainly keep ET in mind for my next Python/XML project! Cheers, Richard -- http://mail.python.org/mailman/listinfo/python-list
Integrate C source in a Python project
Hi all. I was wondering if it ispossible to integrate C source in a python project. Best regards -- http://mail.python.org/mailman/listinfo/python-list
Re: Jargons of Info Tech industry
Dragan Cvetkovic [EMAIL PROTECTED] wrote: John Bokma [EMAIL PROTECTED] writes: A forum provides a single, usually rather limited, interface for the user with no way for the user to change it radically. Does the user want this? And with a user stylesheet you can change it quite radically :-) And in return the user gets: colors, fonts, font sizes, embedding of images, flash, you name it. Moving avatars, even sounds. Sounds scary. When I want to read a text, I don't need the whole multimedia experience. so use Lynx :-) One forum I visit is about scorpions. And really, it talks a bit easier about scorpions if you have an image to look at :-D. In short: Usenet = Usenet, and www = www. Why some people want to move people from www to Usenet or vice versa is beyond me. If 80% of the current Usenet users stop posting, Usenet is not going to die :-D -- John Small Perl scripts: http://johnbokma.com/perl/ Perl programmer available: http://castleamber.com/ Happy Customers: http://castleamber.com/testimonials.html -- http://mail.python.org/mailman/listinfo/python-list
Re: Embedding Python in other programs
Thomas Bartkus wrote: Name: lib64python2.4-devel Summary: The libraries and header files needed for Python development Description: The Python programming language's interpreter can be extended with dynamically loaded extensions and can be embedded in other programs. This package contains the header files and libraries needed to do these types of tasks. -- *** The Python programming language's interpreter ... can be embedded in other programs. *** That's very intriguing! But I can't seem to locate much information about this. Can anyone direct me to greater enlightenment? Thomas Bartkus There is a section of the official documentation devoted to extending and embedding python: http://docs.python.org/ext/ext.html There are a few articles on this topics on the web, as well. Search embedding python with Google. --- Alessandro Bottoni -- http://mail.python.org/mailman/listinfo/python-list
Re: Jargons of Info Tech industry
John Bokma [EMAIL PROTECTED] writes: A forum provides a single, usually rather limited, interface for the user with no way for the user to change it radically. Does the user want this? And with a user stylesheet you can change it quite radically :-) And in return the user gets: colors, fonts, font sizes, embedding of images, flash, you name it. Moving avatars, even sounds. Sounds scary. When I want to read a text, I don't need the whole multimedia experience. Bye, Dragan -- Dragan Cvetkovic, To be or not to be is true. G. Boole No it isn't. L. E. J. Brouwer !!! Sender/From address is bogus. Use reply-to one !!! -- http://mail.python.org/mailman/listinfo/python-list
How to know if connection is active when using telnetlib?
How to know if connection is active after telnetlib.Telnet.open(host,port)? -- http://mail.python.org/mailman/listinfo/python-list
Re: Integrate C source in a Python project
billiejoex wrote: Hi all. I was wondering if it ispossible to integrate C source in a python project. There is ofcourse Python/C API http://docs.python.org/api/api.html But you will probably be easier off with Pyrex or Swig. Good summary on when to use which http://www.rexx.com/~dkuhlman/python_201/python_201.html#SECTION00650 James -- http://mail.python.org/mailman/listinfo/python-list
Re: Jargons of Info Tech industry
John Bokma wrote: You can't be sure: errors in the handling of threads can cause a buffer overflow, same for spelling checking :-D Yes, they can, provided they are not properly coded. However, those things only interact locally with the user and have none or very limited interaction with the user on the other side of the line. As such, they can hardly be exploitable. Some people never use them, and hence they use memory and add risks. On a good newsreader the memory use difference should be irrelevantly small, even if one does not use the features. I would call that a nitpicky argument. Also, the risk in question is not comparable because of the reasons stated above. The kind of risk you are talking about happens with /any/ software. To stay away from that we shouldn't have newsreaders (or any other software, for that matter) in the first place. Of course can HTML be useful on Usenet. The problem is that it will be much more often abused instead of used. No, you missed the point. I am arguing that HTML is completely and utterly /useless/ on Usenet. Time spent for writing HTML in Usenet posts is comparable to that spent on arguing about coding style or writing followups to Xah Lee. It adds no further insight on a particular subject, but _does_ add further delays, spam, bandwidth consumation, exploits, and is generally a pain in the arse. It's redundant. -- Denis -- http://mail.python.org/mailman/listinfo/python-list
Re: Usenet, HTML
John Bokma [EMAIL PROTECTED] writes: [EMAIL PROTECTED] wrote: They don't have killfiles or scoring You can install a mod to kill people. Gee, didn't know that it's that powerful. One more reason not to use web forums :-) Dragan -- Dragan Cvetkovic, To be or not to be is true. G. Boole No it isn't. L. E. J. Brouwer !!! Sender/From address is bogus. Use reply-to one !!! -- http://mail.python.org/mailman/listinfo/python-list
Re: minimalist regular expression
Google for optimized regexp returns: http://laurent.riesterer.free.fr/regexp/make-regexp.html http://search.cpan.org/~dankogai/Regexp-Optimizer-0.15/ There are several more links, but all appear to be written in languages other than Python. Perhaps you could port one of them. It also seems that a similar thread came up here recently, at least in the special form of converting a list of words to a single regexp. In general, this seems to be a difficult problem, not only to implement, but to test. At least the conversion of a list of words to a single regexp is easily tested against the input set, although as some of the other clever posters have noted, it is possible to create a regexp that is *too* matchable. -- Paul -- http://mail.python.org/mailman/listinfo/python-list
Re: Excel Character object through COM
Krisz [EMAIL PROTECTED] wrote in news:[EMAIL PROTECTED]: A.book.Worksheets(1).Range(a1).Characters(1,1) Traceback (most recent call last): File interactive input, line 1, in ? AttributeError: Characters instance has no __call__ method So my question is that am I doing something wrong or there is a different way to modify the color of a charater through COM. try GetCharacters(1,1) max -- http://mail.python.org/mailman/listinfo/python-list
Re: Integrate C source in a Python project
Than you James. I'll take a look as soon as possible. It is possible do the contrary (integrates python source in a C project)? James [EMAIL PROTECTED] ha scritto nel messaggio news:[EMAIL PROTECTED] billiejoex wrote: Hi all. I was wondering if it ispossible to integrate C source in a python project. There is ofcourse Python/C API http://docs.python.org/api/api.html But you will probably be easier off with Pyrex or Swig. Good summary on when to use which http://www.rexx.com/~dkuhlman/python_201/python_201.html#SECTION00650 James -- http://mail.python.org/mailman/listinfo/python-list
Re: Jargons of Info Tech industry
[EMAIL PROTECTED] wrote: ... snip ... Same applies to most newsfeeds, depending on retention. If you want to look a long way back in a thread, use Google Groups. Except for those anti-social zealots who use an X-noarchive header. -- If you want to post a followup via groups.google.com, don't use the broken Reply link at the bottom of the article. Click on show options at the top of the article, then click on the Reply at the bottom of the article headers. - Keith Thompson -- http://mail.python.org/mailman/listinfo/python-list
Re: Jargons of Info Tech industry
John Bokma wrote: Ulrich Hobelmann [EMAIL PROTECTED] wrote: John Bokma wrote: http://www.phpbb.com/mods/ Great. How can I, the user, choose, how to use a mod on a given web server? Ask the admin? And that is, in your opinion, completely comparable to running your own, private client? Is the admin obliged to install the mod? Is the admin even reachable? What if the web server runs another board than PHPBB? Check if there is a mod, and ask the admin. See above. Does the user want this? And with a user stylesheet you can change it quite radically :-) The look, not the feel. Wild guess: (signed) javascript and iframes? on your local computer? Otherwise: fetch HTML, parse it, restructure it, and have the application run a local webserver. Python, Perl, piece of cake. You seem to be forgetting that we are mainly talking about end users here who most probably will not have the sufficient expertise to do all that. And even if they do, it's still time consuming. -- http://mail.python.org/mailman/listinfo/python-list
Re: Jargons of Info Tech industry
John Bokma wrote: so use Lynx :-) One forum I visit is about scorpions. And really, it talks a bit easier about scorpions if you have an image to look at :-D. In short: Usenet = Usenet, and www = www. Why some people want to move people from www to Usenet or vice versa is beyond me. If 80% of the current Usenet users stop posting, Usenet is not going to die :-D Agreed. This is actually your first post with which content I agree totally. From your other posts I got the impression that you are one of those people that are trying to make Usenet and WWW more similar to one another. -- Denis -- http://mail.python.org/mailman/listinfo/python-list
Re: Integrate C source in a Python project
billiejoex wrote: Hi all. I was wondering if it ispossible to integrate C source in a python project. Best regards Yes, of course. Have a look here: http://docs.python.org/ext/ext.html There are two nice tools for this: SWIG http://www.swig.org/Doc1.1/HTML/Python.html SIP http://www.river-bank.demon.co.uk/docs/sip/sipref.html HTH --- Alessandro Bottoni -- http://mail.python.org/mailman/listinfo/python-list
Integrate C source in a Python project
Hi all. I was wondering if it ispossible to integrate C source in a python project. Yes it is. Which tool you use depends on your requirements: http://starship.python.net/crew/theller/ctypes/ ctypes allowes loading dlls/shared libs and calling functions in that lib. www.swig.org is a wrapper for wrapping c/c++ to several languages as php, python, ... www.boost.org includes the boost pyhton library. this is my favorite for wrapping c++ code. Greetings, Uwe -- http://mail.python.org/mailman/listinfo/python-list
Re: Jargons of Info Tech industry
John Bokma wrote: T Beck [EMAIL PROTECTED] wrote: If we argue that people are evolving the way e-mail is handled, and adding entire new feature sets to something which has been around since the earliest days of the internet, then that's perfectly feasable. HTML itself has grown. We've also added Javascript and Shockwave. They are not additions to HTML, like PNG is no addition to HTML, or wav, mp3, etc. [snip] Wasn't the point... I never said they were. HTML is at version 4.0(I think?) now, AND we've added extra layers of stuff you can use alongside of it. The internet is a free-flowing evolving place... to try to protect one little segment like usenet from ever evolving is just ensuring it's slow death, IMHO. That's all... --T Beck -- http://mail.python.org/mailman/listinfo/python-list
Re: Fighting Spam with Python
On Thu, 25 Aug 2005 13:22:53 -0400, François Pinard wrote: [David MacQuigg] The key new features needed in a spam filter are the ability to extract the sender's identity (not that of the latest forwarder), and to factor into the spam score the reputation of that identity. This will only work if your system is immune to forgeries, while being largely widespread. Stopping forgery is what the new authentication methods are all about. Getting these methods widely and effectively used is our big challenge, and one that I hope to accomplish with my efforts. There are a bunch of pieces that need to work together more smoothly. That's where Python comes in. There are some challenging constraints, like the system has to work without government regulation. I've got a first draft of a website for open-mail.org - temporarily at http://purl.net/macquigg/email/registry Suggestions are welcome. In the flow we envision, the spam filter is the final process, used only on the 5% that is hard to classify. 80% will get an immediate reject. 15% will get an immediate accept without filtering, because the sender is authenticated and has a good reputation. Eventually, all reputable senders will join the 15%, and the 5% will shrink to where we can ignore it. It's fun to read statistics about a vision! :-) The 80% is real. http://messagelabs.com/emailthreats As to how the remaining 20% will split, that's a guess, but one that I think is realistic. See http://www.spamhaus.org/effective_filtering.html for comparable numbers using only IP blacklists and spam filtering. The 5% still needing filtering will be those senders that don't offer any authentication or that authenticate with an identity that has not yet acquired a reputation. You might find www.spambayes.org of interest, in several ways. Spambayes is surprisingly good as it already stands. I haven't used Spambayes, but my experience with Spamnix (an offshoot of Spam Assassin) is that statistical filters always have a few false rejects. In my case, that's about two per week. The solution to this problem is a reliable system allowing receivers to determine the identity and reputation of an unknown sender. Then we can safely ignore the spam. -- Dave -- http://mail.python.org/mailman/listinfo/python-list
Re: MacPython 2.2 on Mac OS X 10.3.8 - configurePython error
Robert Kern wrote: Paul Miller wrote: I have a user who is is having trouble getting MacPython on his OS X 10.3.8 system. When he runs ConfigurePythonCarbon, he gets this error: [terminated] 'import site' failed; use -v for traceback traceback )most recent call last): File Moes:SWdev:Jack:Python2.2:Mac:script:configurePython.py, line 11 , in ? Import error: No module named os I have had no trouble on my system (same version). What can cause this? os.py got deleted from its home, probably. I doubt anyone is going to help fix the problem though. MacPython 2.2 has been long abandoned. The official OS X binary for Python 2.4.1 can be found here: http://www.python.org/ftp/python/2.4.1/MacPython-OSX-2.4.1-1.dmg I realize that, but I have an application that is linked with MacPython 2.2. I can't just drop 2.4 in. He claims the only thing that has changed is his preferences were wiped out. There must be some solution for what is probably a not too uncommon problem. -- http://mail.python.org/mailman/listinfo/python-list
need a little help with time
Hey there. i have a time string (created with strftime) then read from a file, i am having some trouble understanding how to get the difference between times. i know i can structime(timestring) and get a time value, but i dont know how to manipulate it. basically, if i have string 2005-08-24 09:25:58 and another string 2005-08-24 09:28:58 how can i tell how many minutes, hours, seconds, days, months etc.. have passed between the first string and the second ? or, if there is a good tutorial on this kind of thing, please post a url. thanks shawn -- http://mail.python.org/mailman/listinfo/python-list
Re: a dummy python question
If that were so, Pythonistas could never write a recursive function! No, presumably at the writing of the edition of _Learning Python_ that he is reading, Python did not have nested scopes in the language, yet. One could always write a recursive function provided it was at the top-level of the module. One could not write a recursive function inside another function because inside inner(), it could only access two namespaces, the one local to inner() and the module's namespace, not the namespace of outer() where inner() is defined. Ah, that makes sense. Thanks for the clarification. -- http://mail.python.org/mailman/listinfo/python-list