Re: Shift Confusion

2005-02-24 Thread John Machin
On 23 Feb 2005 22:06:54 -0800, "Kamilche" <[EMAIL PROTECTED]> wrote: >I'm trying to pack two characters into a single byte, and the shifting >in Python has me confused. > >Essentially, it should be possible to use a 'packed string' format in >Python, where as long as the characters you're sending

Re: Communication between JAVA and python

2005-02-24 Thread Ulrich Schaefer
Jacques Daussy wrote: Hello How can I transfert information between a JAVA application and a python script application. I can't use jython because, I must use python interpreter.I think to socket or semaphore, but can I use it on Windows plateform ? Try XML-RPC (a simple implementation of remot

Re: Style guide for subclassing built-in types?

2005-02-24 Thread Just
In article <[EMAIL PROTECTED]>, [EMAIL PROTECTED] wrote: > Thank you but your advice doesn't fit in my case since I want to keep > the memory usage and the initial time minimum. iterable[::-1] would > build another list and it would take big memory and time during > reversing if iterable were hug

Re: Style guide for subclassing built-in types?

2005-02-24 Thread Serge Orlov
[EMAIL PROTECTED] wrote: > Thank you but your advice doesn't fit in my case since I want to keep > the memory usage and the initial time minimum. iterable[::-1] would > build another list and it would take big memory and time during > reversing if iterable were huge. (and the "iterable" wouldn't be

Re: Selective HTML doc generation

2005-02-24 Thread Graham Ashton
Thanks Brian, much appreciated. Looks quite straightforward. Graham -- http://mail.python.org/mailman/listinfo/python-list

Re: Style guide for subclassing built-in types?

2005-02-24 Thread Nick Coghlan
[EMAIL PROTECTED] wrote: Thank you but your advice doesn't fit in my case since I want to keep the memory usage and the initial time minimum. iterable[::-1] would build another list and it would take big memory and time during reversing if iterable were huge. (and the "iterable" wouldn't be garbage

email-adress

2005-02-24 Thread Courtis Joannis
Hello Python-team, please could you delete my email-adress from your mailing list. Thanks Joannis -- DSL Komplett von GMX +++ Supergünstig und stressfrei einsteigen! AKTION "Kein Einrichtungspreis" nutzen: http://www.gmx.net/de/go/dsl -- http://mail.python.org/mailman/listinfo/python-list

Re: python tutorial/projects

2005-02-24 Thread Fuzzyman
I'm looking for people to work on a couple of projects... online bookmarks manager for example Regards, Fuzzy http://www.voidspace.org.uk/python/index.shtml -- http://mail.python.org/mailman/listinfo/python-list

Re: Dynamically pass a function arguments from a dict

2005-02-24 Thread Nick Coghlan
Python 2.4 (#60, Nov 30 2004, 11:49:19) [MSC v.1310 32 bit (Intel)] on win32 Type "help", "copyright", "credits" or "license" for more information. Running startup script Py> import inspect Py> help(inspect.getargspec) Help on function getargspec in module inspect: getargspec(func) Get the name

Re: LC_ALL and os.listdir()

2005-02-24 Thread Duncan Booth
Martin v. Löwis wrote: > Serge Orlov wrote: >> Shouldn't os.path.join do that? If you pass a unicode string >> and a byte string it currently tries to convert bytes to characters >> but it makes more sense to convert the unicode string to bytes >> and return two byte strings concatenated. > > Sou

MDaemon Warning - virus found: Returned mail: see transcript for details

2005-02-24 Thread gdbki
*** WARNING ** This message has been scanned by MDaemon AntiVirus and was found to contain infected attachment(s). Please review the list below. AttachmentVirus name Action taken --

Compile time evaluation (aka eliminating default argument hacks)

2005-02-24 Thread Nick Coghlan
Time for another random syntax idea. . . So, I was tinkering in the interactive interpreter, and came up with the following one-size-fits-most default argument hack: Py> x = 1 Py> def _build_used(): ... y = x + 1 ... return x, y ... Py> def f(_used = _build_used()): ... x, y = _used ... p

Re: Problem with minidom and special chars in HTML

2005-02-24 Thread and-google
Horst Gutmann wrote: > I currently have quite a big problem with minidom and special chars > (for example ü) in HTML. Yes. Ignoring the issue of the wrong doctype, minidom is a pure XML parser and knows nothing of XHTML and its doctype's entities 'uuml' and the like. Only the built-in entities (

[perl-python] generic equivalence partition

2005-02-24 Thread Xah Lee
another functional exercise with lists. Here's the perl documentation. I'll post a perl and the translated python version in 48 hours. =pod parti(aList, equalFunc) given a list aList of n elements, we want to return a list that is a range of numbers from 1 to n, partition by the predicate funct

ANN: SPE 0.7.2.C Python IDE with wxGlade, UML & Blender support

2005-02-24 Thread http://www.stani.be
Spe is a python IDE with auto-indentation, auto completion, call tips, syntax coloring, uml viewer, syntax highlighting, class explorer, source index, auto todo list, sticky notes, integrated pycrust shell, python file browser, recent file browser, drag&drop, context help, ... Special is its blende

Re: LC_ALL and os.listdir()

2005-02-24 Thread Serge Orlov
Duncan Booth wrote: > Martin v. Löwis wrote: > > > Serge Orlov wrote: > >> Shouldn't os.path.join do that? If you pass a unicode string > >> and a byte string it currently tries to convert bytes to > >> characters > >> but it makes more sense to convert the unicode string to bytes > >> and return t

Re: email-adress

2005-02-24 Thread Kartic
Courtis Joannis said the following on 2/24/2005 5:06 AM: Hello Python-team, please could you delete my email-adress from your mailing list. Thanks Joannis Courtis On emails sent to the python mailing list, the signature should contain an unsubscribe email address. Please follow instructions on the

Re: Working FTP server based on Twisted framework.

2005-02-24 Thread Kartic
Mateusz SoÅtysek said the following on 2/23/2005 4:45 AM: Hi call, Does anybody know, if there is any opensource, working FTP server implementation based on Twisted framework? Greetings Mateusz, I don't believe there is a ready-to-go FTP server in Twisted (actually google did not return anything

Re: PyEphem on Win32 -- 2nd try

2005-02-24 Thread drobinow
[EMAIL PROTECTED] wrote: > Has anyone run the PyEphem ephemeris application under WinXP? > http://rhodesmill.org/brandon/projects/pyephem.html > I have compiled it with Visual Studio 6 and it crashes Python with a > simple > > >>> import ephem > >>> ephem.date('1994/7/16') > > Identical code works

wanted: C++ parser written in Python

2005-02-24 Thread Franz Steinhaeusler
Hello NG, has anyone written such a thing in python? Where could I look for? (I need it for an editor written in wxPython to display function names, include, global variables, classes, ... in a sidepanel). kind regards, -- Franz Steinhaeusler -- http://mail.python.org/mailman/listinfo/python-

Re: Attaching to a Python Interpreter a la Tcl

2005-02-24 Thread Jeff Epler
Cameron Laird mentioned Tk's send working with Python; if you are writing your app with Tkinter, here is some code to let you use tcl commands like send python for remote control. You could build a more sophisticated front-end for this, and you'll probably also want to add stuff like sending

what are PyObject *globals and PyObject *locals ?

2005-02-24 Thread Olivier Sessink
Hi all, I want to make a value available to the global namespace of an embedded python interpreter. Several functions of the Python/C API feature a PyObject *globals and a PyObject *locals, so my guess is that these can be used for this purpose. Unfortunately, the Python/C API does not describe ho

Re: Shift Confusion

2005-02-24 Thread qwweeeit
At programming level it seems correct (a part a "return" closure needed for the "main" function). But the error is IMHO conceptual: for a char you need 7 bits (from 0 to 127 or in hex from x00 to x7F) and you can't accomodate the other char in only one bit! The other 128 symbols (from 128 to 255 o

Re: Compile time evaluation (aka eliminating default argument hacks)

2005-02-24 Thread Steven Bethard
Nick Coghlan wrote: Time for another random syntax idea. . . So, I was tinkering in the interactive interpreter, and came up with the following one-size-fits-most default argument hack: [snip] But consider a syntax like the following: def f(): use x, y from: y = x + 1 # [

Re: python tutorial/projects

2005-02-24 Thread Tom Willis
On 24 Feb 2005 02:06:24 -0800, Fuzzyman <[EMAIL PROTECTED]> wrote: > I'm looking for people to work on a couple of projects... online > bookmarks manager for example > > Regards, > > Fuzzy > http://www.voidspace.org.uk/python/index.shtml > > -- > http://mail.python.org/mailman/listinfo/pytho

Re: Shift Confusion

2005-02-24 Thread Richard Brodie
"John Machin" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > >Essentially, it should be possible to use a 'packed string' format in > >Python, where as long as the characters you're sending are in the ASCII > >range 0 to 127, two will fit in a byte. > > It should be possible, but o

Re: Trouble with mysql-python 1.2.0 on Solaris 8 sparc

2005-02-24 Thread Alec Wysoker
Hi Andy, Thanks for your message. It turned out that I had installed 64-bit mySql on a 32-bit machine. I'm amazed it worked at all. Anyway, I finally got mysql-python built, but I'm unable to connect to a machine on a remote host. The problem doesn't seem to be with the python code, because I'

Re: rounding problem

2005-02-24 Thread Thomas Bartkus
"Dan Bishop" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > tom wrote: > > That last digit will *always* contain some arithmetic slop. > > Your statement is misleading, because it suggests that your processor > stores digits. It doesn't; it stores *bits*. Your explanation is much

Re: LC_ALL and os.listdir()

2005-02-24 Thread "Martin v. Löwis"
Duncan Booth wrote: Windows (when using NTFS) stores all the filenames in unicode, and Python uses the unicode api to implement listdir (when given a unicode path). This means that the filename never gets encoded to a byte string either by the OS or Python. If you use a byte string path than the

Re: How to write a ping client

2005-02-24 Thread Nick Vargish
"Harlin Seritt" <[EMAIL PROTECTED]> writes: > ? #!/bin/sh ping $1 Enjoy, Nick -- # sigmask || 0.2 || 20030107 || public domain || feed this to a python print reduce(lambda x,y:x+chr(ord(y)-1),' Ojdl!Wbshjti!=obwAcboefstobudi/psh?') -- http://mail.python.org/mailman/listinfo/python-

Need some Python help

2005-02-24 Thread Matt Upton
Hello, I am new to Python and am trying to produce script to run batch processes for ArcGIS 9.0 (ArcView). I have upgraded to Phython 2.4 from 2.1 and am using the Pythonwin to try to code but am running into a problem. Whenever I try to debug my program or run any code past the following code i

Re: Dynamically pass a function arguments from a dict

2005-02-24 Thread Scott David Daniels
Mark McEahern wrote: Dan Eloff wrote: How can you determine that func2 will only accept bar and zoo, but not foo and call the function with bar as an argument? Let Python answer the question for you: ... Please be aware the "normal" way to do this is go ahead and call the function. Many "functio

Dr. Dobb's Python-URL! - weekly Python news and links (Feb 24)

2005-02-24 Thread Cameron Laird
QOTW: "Who's 'Guido'?" -- Ilias Lazaridis "I know this document. It has no relevance to me." -- Ilias Lazaridis, on http://www.catb.org/~esr/faqs/smart-questions.html > "Nobody asked them to do this (AFAIK), it's more that nobody could _stop_ them from doing it." -- timbot, on the work of Jason

Python Modules for Various Internet Protocols?

2005-02-24 Thread Efrat Regev
Hello, I was wondering whether there are any Python modules for various Internet protocols, e.g., is there something similar to import ftp client = ftpopen(...) and so on. Thanks, Efrat -- http://mail.python.org/mailman/listinfo/python-list

Re: Python Modules for Various Internet Protocols?

2005-02-24 Thread Kartic
Efrat Regev wrote: > Hello, > > I was wondering whether there are any Python modules for various > Internet protocols, e.g., is there something similar to > Erfat...yes...batteries included! http://docs.python.org/lib/internet.html Thanks, -Kartic -- http://mail.python.org/mailman/listinf

Re: Python Modules for Various Internet Protocols?

2005-02-24 Thread Christopher De Vries
On Thu, Feb 24, 2005 at 11:11:07AM -0600, Efrat Regev wrote: > I was wondering whether there are any Python modules for various > Internet protocols, ... Twisted (http://twistedmatrix.com/products/twisted) is an event driven framework for writing network applications. It includes many internet

Re: Python Modules for Various Internet Protocols?

2005-02-24 Thread Efrat Regev
"Kartic" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > Efrat Regev wrote: > > Hello, > > > > I was wondering whether there are any Python > Erfat...yes...batteries included! > > http://docs.python.org/lib/internet.html > > Thanks, > -Kartic > Excellent! more like generator inc

Re: Font size

2005-02-24 Thread Tobiah
from random import randint rand = randint(0,36) print rand Don't forget about the double zero slot. Tobiah -- http://mail.python.org/mailman/listinfo/python-list

what is wrong?

2005-02-24 Thread neutrinman
I cannot find out why the following code generates the error: (BTraceback (most recent call last): (B File "D:/a/Utilities/python/ptyhon22/test.py", line 97, in ? (Bmain() (B File "D:/a/Utilities/python/ptyhon22/test.py", line 60, in main (Bcrit = Critter(crit_name) (B File "D:/a/U

what is wrong?

2005-02-24 Thread neutrinman
I cannot find out why the following code generates the error: (BTraceback (most recent call last): (B File "D:/a/Utilities/python/ptyhon22/test.py", line 97, in ? (Bmain() (B File "D:/a/Utilities/python/ptyhon22/test.py", line 60, in main (Bcrit = Critter(crit_name) (B File "D:/a/U

Re: duplicate file finder (was: how can I make this script shorter?)

2005-02-24 Thread TZOTZIOY
On Wed, 23 Feb 2005 01:56:02 -0800, rumours say that Lowell Kirsh <[EMAIL PROTECTED]> might have written: >Good idea about hashing part of the file before comparing entire files. >It will make the script longer but the speed increase will most likely >make it worth it. My dupefind module was on

Re: what is wrong?

2005-02-24 Thread deelan
[EMAIL PROTECTED] wrote: (B(...) (B> self.feed = feed# I wrote this (B> AttributeError: can't set attribute (B> (B> I add some codes to a program on a book. The lines that have "I wrote (B> this" comment is the added codes. Could anyone tell me what is worng (B> here? (B (

Re: Canonical way of dealing with null-separated lines?

2005-02-24 Thread Christopher De Vries
On Wed, Feb 23, 2005 at 10:54:50PM -0500, Douglas Alan wrote: > Is there a canonical way of iterating over the lines of a file that > are null-separated rather than newline-separated? I'm not sure if there is a canonical method, but I would recommending using a generator to get something like this

Re: what is wrong?

2005-02-24 Thread TZOTZIOY
On 24 Feb 2005 08:34:09 -0800, rumours say that [EMAIL PROTECTED] might have written: >I cannot find out why the following code generates the error: >Traceback (most recent call last): > File "D:/a/Utilities/python/ptyhon22/test.py", line 97, in ? >main() > File "D:/a/Utilities/python/ptyhon

Re: Canonical way of dealing with null-separated lines?

2005-02-24 Thread Scott David Daniels
Douglas Alan wrote: Is there a canonical way of iterating over the lines of a file that are null-separated rather than newline-separated? Sure, I can implement my own iterator using read() and split(), etc., but considering that using "find -print0" is so common, it seems like there should be a mo

Re: Selective HTML doc generation

2005-02-24 Thread Brian van den Broek
Graham Ashton said unto the world upon 2005-02-24 04:54: Thanks Brian, much appreciated. Looks quite straightforward. Graham Hi Graham, glad it helped -- I think this marks the first time I've given a useful answer to a non-trivial question on comp.lang.python. :-) G: Hi. I'm looking for a docum

Re: Vectors in Visual Python

2005-02-24 Thread FLChamp
Thanks for all your help everyone, if only it had addressed what I had asked I may have actually learned something about Python!! If anything was addressed to my problem then it has completely passed me by as most points were clearly made by a computer scientist and I am not one of those in the sl

Re: arrow keys bug

2005-02-24 Thread Daniel Alexandre
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Hi there, On Feb 24, 2005, at 16:25, A.T. Hofkamp wrote: and for home, end, etc. Does anyone here knows how I can strip those keys? Thanks in advance. One solution is to read the input yourself character by character, and delete anything that is not pri

update images inside a mysql database

2005-02-24 Thread Jonas Meurer
hello, i develop a project with a mysql interface. one mysql table holds all the images for my project. everything works quite well so far, except i'm not able to upload images into the database. the following function does the mysql UPDATE, it requires the image and the image ID as arguments. a

Re: what is wrong?

2005-02-24 Thread neutrinman
I appreciate all of your help. I learned a lot form your adovice. Thanks. Mr. Bieber, it worked fine. Thanks again. -- http://mail.python.org/mailman/listinfo/python-list

Re: Shift Confusion

2005-02-24 Thread James Kew
"Dennis Lee Bieber" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > On 23 Feb 2005 22:06:54 -0800, "Kamilche" <[EMAIL PROTECTED]> > declaimed the following in comp.lang.python: > >> >> Essentially, it should be possible to use a 'packed string' format in >> Python, where as long as t

Re: Need some Python help

2005-02-24 Thread Roger Upole
There's a bug in python's tokenizer that's triggered when the generated wrapper code for a COM object has lines longer than 512. See below link for a workaround: https://sourceforge.net/tracker/?func=detail&atid=551954&aid=1085454&group_id=78018 Roger "Matt Upton" <[EMAIL PROTECTED]> wr

Re: update images inside a mysql database

2005-02-24 Thread Gabriel Cooper
Jonas Meurer wrote: def i_update(image, imgid): image = "%s" % (image) sql_exec = """UPDATE Images SET Image='%s' WHERE ImgID = '%s' """ % (image, imgid) o = open("/tmp/file.jpg", "w") o.write(image) o.close() db_connect.cursor.execute(sql_e

Re: Trouble with mysql-python 1.2.0 on Solaris 8 sparc

2005-02-24 Thread Steve Holden
Alec Wysoker wrote: Hi Andy, Thanks for your message. It turned out that I had installed 64-bit mySql on a 32-bit machine. I'm amazed it worked at all. Anyway, I finally got mysql-python built, but I'm unable to connect to a machine on a remote host. The problem doesn't seem to be with the pyth

[ANN] dateutil 0.9

2005-02-24 Thread Gustavo Niemeyer
https://moin.conectiva.com.br/DateUtil Description --- The dateutil module provides powerful extensions to the standard datetime module, available in Python 2.3+. Features - Computing of relative deltas (next month, next year, next monday, last week of month, etc); - Comp

Mapping operator tokens to special methods

2005-02-24 Thread jamesthiele . usenet
I was starting to write a dictionary to map operator strings to their equivalent special methods such as: { '+' : 'add', '&' : 'and_' } The idea is to build a simple interactive calculator. and was wondering if there is already something like this builtin? Or is there a better way to do what

Re: Canonical way of dealing with null-separated lines?

2005-02-24 Thread Douglas Alan
Christopher De Vries <[EMAIL PROTECTED]> writes: > I'm not sure if there is a canonical method, but I would > recommending using a generator to get something like this, where 'f' > is a file object: Thanks for the generator. It returns an extra blank line at the end when used with "find -print0"

[ANN] TamTam collaboration software

2005-02-24 Thread Aleksandar Erkalovic
Hi, on address (temporary): http://tamtam.mi2.hr:/NoviTam/ you can find TamTam collaborative software. This is new version (rewrite) using Twisted and Nevow. This is not official announcement just a small notice for people who are interested to check it, give me some critics, help in id

Interesting decorator use.

2005-02-24 Thread Scott David Daniels
I have started doing the following to watch for exceptions in wxPython. I'd like any input about (A) the interface, and (B) the frame before I throw it in the recipes book. import wx, os, sys errorframe = None def watcherrors(function): '''function decorator to display Exception

Re: Mapping operator tokens to special methods

2005-02-24 Thread Steven Bethard
[EMAIL PROTECTED] wrote: I was starting to write a dictionary to map operator strings to their equivalent special methods such as: { '+' : 'add', '&' : 'and_' } The idea is to build a simple interactive calculator. and was wondering if there is already something like this builtin? Or is there a

Re: Canonical way of dealing with null-separated lines?

2005-02-24 Thread Scott David Daniels
Douglas Alan wrote: ... In any case, as a suggestion to the whomever it is that arranges for stuff to be put into the standard library, there should be something like this there, so everyone doesn't have to reinvent the wheel (even if it's an easy wheel to reinvent) for something that any sysadmin

Re: Canonical way of dealing with null-separated lines?

2005-02-24 Thread Christopher De Vries
On Thu, Feb 24, 2005 at 02:03:52PM -0500, Douglas Alan wrote: > Thanks for the generator. It returns an extra blank line at the end > when used with "find -print0", which is probably not ideal, and is > also not how the normal file line iterator behaves. But don't worry > -- I can fix it. Sorry.

Re: Shift Confusion

2005-02-24 Thread Steve Holden
Dennis Lee Bieber wrote: On Thu, 24 Feb 2005 14:22:59 -, "Richard Brodie" <[EMAIL PROTECTED]> declaimed the following in comp.lang.python: "John Machin" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] Essentially, it should be possible to use a 'packed string' format in Python, wh

Re: Trouble with mysql-python 1.2.0 on Solaris 8 sparc

2005-02-24 Thread Steve Holden
Alec Wysoker wrote: Hi Steve, Thanks for the response. I don't think this is the problem. When I connect to the remote machine, it says this: Your MySQL connection id is 58 to server version: 4.1.0-alpha-standard When I connect to the local server, I get this: Your MySQL connection id is 6 to se

Re: Trouble with mysql-python 1.2.0 on Solaris 8 sparc

2005-02-24 Thread Alec Wysoker
Do you mean the python glue code? I am having this problem when python is not in the picture at all, just running mysql command-line client. Presumably my client is 4.1.10, as it came in a built package along with the 4.1.10 server. In fact, the following seems to indicate that it is the righ

Re: Interesting decorator use.

2005-02-24 Thread Tom Willis
On Thu, 24 Feb 2005 11:15:07 -0800, Scott David Daniels <[EMAIL PROTECTED]> wrote: > > I have started doing the following to watch for exceptions in wxPython. > I'd like any input about (A) the interface, and (B) the frame before I > throw it in the recipes book. > > import wx, os, sys >

Re: Canonical way of dealing with null-separated lines?

2005-02-24 Thread John Machin
On Thu, 24 Feb 2005 11:53:32 -0500, Christopher De Vries <[EMAIL PROTECTED]> wrote: >On Wed, Feb 23, 2005 at 10:54:50PM -0500, Douglas Alan wrote: >> Is there a canonical way of iterating over the lines of a file that >> are null-separated rather than newline-separated? > >I'm not sure if there is

Python Online Programming Contest

2005-02-24 Thread Varun
Hi Friends, Department of Information Technology, Madras Institute of Technology, Anna University, India is conducting a technical symposium, Samhita. As a part of samhita, an Online Programming Contest is scheduled on Sunday, 27 Feb 2005. This is the first Online Programming Contest in India to s

Re: Mapping operator tokens to special methods

2005-02-24 Thread John Machin
On 24 Feb 2005 10:57:58 -0800, [EMAIL PROTECTED] wrote: >I was starting to write a dictionary to map operator strings to their >equivalent special methods such as: >{ > '+' : 'add', > '&' : 'and_' >} > >The idea is to build a simple interactive calculator. > >and was wondering if there is alread

More newbie macosx user questions

2005-02-24 Thread Timothy Grant
I think I'm mis-understanding something about how PYTHONPATH works (at least on OSX I didn't have this trouble on Linux). I have a directory where I store libraries that I'm playing around with. However, for some reason python can't find the library. Since I'm using PyQt, I use pythonw, but the re

Re: Mapping operator tokens to special methods

2005-02-24 Thread jamesthiele . usenet
John Machin wrote: >>> eval('1+2') 3 -- Yeah, that's what I decided to do. -- http://mail.python.org/mailman/listinfo/python-list

Re: Canonical way of dealing with null-separated lines?

2005-02-24 Thread John Machin
On Thu, 24 Feb 2005 14:51:07 -0500, Christopher De Vries <[EMAIL PROTECTED]> wrote: > >The other modification would be an option to ignore multiple nulls in a row, >rather than returning empty strings, which could be done in a similar way. > Why not leave this to the caller? Efficiency?? Filterin

Re: Python and "Ajax technology collaboration"

2005-02-24 Thread Chris
Does anyone else have any Nevow examples? In article <[EMAIL PROTECTED]>, [EMAIL PROTECTED] says... > aurora <[EMAIL PROTECTED]> wrote: > > > It was discussed in the last Bay Area Python Interest Group meeting. > > > > Thursday, February 10, 2005 > > Agenda: Developing Responsive GUI Applicati

Re: [perl-python] exercise: partition a list by equivalence

2005-02-24 Thread Paul McGuire
A slightly better version, only walks the set of cumulative list of sets once per pairing. -- Paul .import sets . .input = [[1, 2], [3, 4], [2, 3], [4, 5]] .input = [[1, 2], [3, 4], [4, 5]] .input = [[1, 2],[2,1], [3, 4], [4, 5],[2,2],[2,3],[6,6]] . .def merge(pairings): .ret

Re: Canonical way of dealing with null-separated lines?

2005-02-24 Thread Christopher De Vries
On Fri, Feb 25, 2005 at 07:56:49AM +1100, John Machin wrote: > Try this: > !def readweird(f, line_end='\0', bufsiz=8192): > !retain = '' > !while True: > !instr = f.read(bufsiz) > !if not instr: > !# End of file > !break > !splitstr = ins

Re: Interesting decorator use.

2005-02-24 Thread Steven Bethard
Tom Willis wrote: Question on decorators in general. Can you parameterize those? If I wanted to something and after the function call for example, I would expect something like this would work. def prepostdecorator(function,pre,post): def wrapper(*args,**kwargs): pre() result =

Re: Interesting decorator use.

2005-02-24 Thread Steven Bethard
I wrote: Tom Willis wrote: Question on decorators in general. Can you parameterize those? [snip] If you want to call prepostdecorator with 2 arguments, you need to write it this way. A few options: Sorry, I forgot my favorite one: (4) Use a class and functional.partial: py> class prepostdecorato

Re: update images inside a mysql database

2005-02-24 Thread Jonas Meurer
On 24/02/2005 Gabriel Cooper wrote: > I've never tried extensively to use images inside a database (too slow > for most of my uses), but I thought I'd drop in to point out that you > should, for security reasons, be using place holders on your sql. It > might just fix your image problem as well,

Re: Interesting decorator use.

2005-02-24 Thread Tom Willis
On Thu, 24 Feb 2005 15:00:46 -0700, Steven Bethard <[EMAIL PROTECTED]> wrote: > Tom Willis wrote: > > Question on decorators in general. Can you parameterize those? > > > > If I wanted to something and after the function call for example, I > > would expect something like this would work. > > > > d

Re: Python Online Programming Contest

2005-02-24 Thread Will Stuyvesant
> [Varun] > For details about samhita http://www.samhita.info/ "The Madras Institute of Technology (MIT)" it says there. The MIT acronym is taken already guys.. -- no scheme no glory -- http://mail.python.org/mailman/listinfo/python-list

Re: Python Online Programming Contest

2005-02-24 Thread Terry Reedy
"Varun" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > Hi Friends, > Department of Information Technology, Madras Institute of Technology, > Anna University, India > is conducting a technical symposium, Samhita. As a part of samhita, an > Online Programming Contest is scheduled on

Re: Interesting decorator use.

2005-02-24 Thread Steven Bethard
Tom Willis wrote: Question on decorators in general. Can you parameterize those? Wow thanks for the explanation!! Some of it is a bit mind bending to me at the moment , but I'm going to mess with it a bit. Oh, I also should have mentioned that there's some explanation at: http://www.python.org/peps

Re: pyGoogle is fun and easy to use, and thinks Python is the best programming language

2005-02-24 Thread Andy Robinson
Regrettably, inserting "Visual Basic" into the list produces a different winner. I think you want some very subtle hard coding which limits it to on-space-delimited languages :-( - Andy -- http://mail.python.org/mailman/listinfo/python-list

Re: Python and "Ajax technology collaboration"

2005-02-24 Thread Valentino Volonghi aka Dialtone
Chris <[EMAIL PROTECTED]> wrote: > Does anyone else have any Nevow examples? Nevow SVN is full of examples ranging from a simple hello world to a complete blog engine with xml-rpc, smtp and web interfaces for adding new posts and an atom feed, or even a live chat or a pastebin or an image uploade

Re: Python and "Ajax technology collaboration"

2005-02-24 Thread Evan Simpson
John Willems wrote: Interesting GUI developments, it seems. Anyone developed a "Ajax" application using Python? Very curious Not what you meant, perhaps, but http://weboggle.shackworks.com has a Javascript/HTML/CSS one-page client that uses XMLHttpRequest to talk to a Python back-end. The re

Re: Python Online Programming Contest

2005-02-24 Thread Kartic
Will Stuyvesant said the following on 2/24/2005 5:10 PM: [Varun] For details about samhita http://www.samhita.info/ "The Madras Institute of Technology (MIT)" it says there. The MIT acronym is taken already guys.. Will - It is a local acronym! -- http://mail.python.org/mailman/listinfo/python-list

Re: Canonical way of dealing with null-separated lines?

2005-02-24 Thread John Machin
On Thu, 24 Feb 2005 16:51:22 -0500, Christopher De Vries <[EMAIL PROTECTED]> wrote: [snip] >I think this is a definite improvement... especially putting the buffer size >and line terminators as optional arguments, and handling empty files. I think, >however that the if splitstr[-1]: ... else: ...

Re: Interesting decorator use.

2005-02-24 Thread Tom Willis
On Thu, 24 Feb 2005 15:20:30 -0700, Steven Bethard <[EMAIL PROTECTED]> wrote: > Tom Willis wrote: > >>> Question on decorators in general. Can you parameterize those? > > > > Wow thanks for the explanation!! Some of it is a bit mind bending to > > me at the moment , but I'm going to mess with it a

Re: duplicate file finder

2005-02-24 Thread Lowell Kirsh
It looks pretty good, but I'll have to take a better look later. Out of curiosity, why did you convert the first spaces to pipes rather than add the code as an attachment? Lowell Christos TZOTZIOY Georgiou wrote: On Wed, 23 Feb 2005 01:56:02 -0800, rumours say that Lowell Kirsh <[EMAIL PROTECTED

Nevow examples

2005-02-24 Thread Travis Oliphant
There was a request for nevow examples. Nevow is a fantastic web-development framework for Python. I used nevow to create http://www.scipy.org/livedocs/ This site uses nevow and self introspection to produce (live) documentation for scipy based on the internal docstrings. It would be nice to

Re: searching pdf files for certain info

2005-02-24 Thread Follower
rbt <[EMAIL PROTECTED]> wrote in message news:<[EMAIL PROTECTED]>... > Not really a Python question... but here goes: Is there a way to read > the content of a PDF file and decode it with Python? I'd like to read > PDF's, decode them, and then search the data for certain strings. I've had succes

Converting HTML to ASCII

2005-02-24 Thread gf gf
Hi. I'm looking for a Python lib to convert HTML to ASCII. Of course, a quick Google search showed several options (although, I must say, less than I would expect, considering how easy this is to do in *other* languages... :| ), but, I have 2 requirements, which none of them seem to meet: 1) Be

Best IDe

2005-02-24 Thread Jubri Siji
Please i am new to python , whats the best IDE to start with -- http://mail.python.org/mailman/listinfo/python-list

Re: Python Online Programming Contest

2005-02-24 Thread Harlin Seritt
Actually MIT is an abbreviation and not an acronym in the true sense of the word :) -- http://mail.python.org/mailman/listinfo/python-list

Re: Best IDe

2005-02-24 Thread Harlin Seritt
IDLE, PytonWin and SPE are all free and offer all of the important features you'll see even in commercial IDE's. -- http://mail.python.org/mailman/listinfo/python-list

web status display for long running program

2005-02-24 Thread Brian Roberts
I have a command line Python program that sometimes takes a bit (several minutes) to run. I want to provide an optional method for an impatient user (me!) to check the status of the program. The type and amount of status information doesn't fit nicely into a --verbose or logger -- either too litt

Re: user interface for python

2005-02-24 Thread Peter Hansen
Mike Meyer wrote: "There are no portable programs, only ported programs." -- John Gilmore (?) This doesn't really ring true, unless one insists on defining "portable" to include the idea of "universally". I've got dozens of Python utilities that run equally well on my Linux machines and my W

Re: [perl-python] generic equivalence partition

2005-02-24 Thread Bryan
Xah Lee wrote: another functional exercise with lists. Here's the perl documentation. I'll post a perl and the translated python version in 48 hours. =pod parti(aList, equalFunc) given a list aList of n elements, we want to return a list that is a range of numbers from 1 to n, partition by the pred

Flushing print()

2005-02-24 Thread gf gf
Is there any way to make Python's print() flush automatically, similar to...mmm...that other language's $|=1 ? If not, how can I flush it manually? sys.stdout.flush() didn't seem to work. __ Do you Yahoo!? Yahoo! Mail - now with 250MB free stor

Re: A few q's on python files.

2005-02-24 Thread Peter Hansen
Tim Roberts wrote: There are packages (like py2exe) that can convert your script into an executable, but they are essentially installers. They package your script, and all the scripts and libraries it needs, into a single file along with the interpreter. When the .exe is executed, it extracts the

  1   2   >