Nice documentation Python / SWIG / C++

2005-04-25 Thread Alexander Eisenhuth
Hi alltogether, I found a nice and useful article for extenting python with C++ using SWIG. It describe from the scratch especially for Windows. Maybe this can be included somewhere on www.python.org. Here is the link: http://www.geocities.com/foetsch/python/extending_python.htm Alexander

help needed :-pgdb givig error

2005-04-25 Thread Ram
Dear All I am very new to python . i would appreciate any help from you all on this problem which i am facing. I am trying to connect to postgres from python.for this i am using something like " import pgdb". i am able to connect to postgres and fetch data , if i execute the python file directly

Re: Python or PHP?

2005-04-25 Thread Alan Little
Steve Holden <[EMAIL PROTECTED]> wrote: >Your statement then becomes > >select * from foo where bar=1; drop table foo > >which is clearly not such a good idea. I'm sure Steve is very well aware of this and was just providing a simple and obvious example, nevertheless it might be worth pointing ou

Re: pygtk and long running process

2005-04-25 Thread Robert
On Sun, 24 Apr 2005 19:46:52 -0600, Daniel Cer wrote: > Daniel Cer wrote: >> Robert wrote: >> >>> I have a command line app that can take up to 20 minutes to complete and >>> every minute or so updates it's status (spits it out to console). I am >>> writing a front end for this app in python/gtk

Re: HTML cleaner?

2005-04-25 Thread M.-A. Lemburg
Ivan Voras wrote: > Is there a HTML clean/tidy library or module written in pure python? I > found mxTidy, but it's a interface to command-line tool. Not true: mxTidy integrates tidy as C lib. It's not an interface to the command line tool. > What I'm searching is something that will accept a lis

Re: HTML cleaner?

2005-04-25 Thread Fuzzyman
I *just* wrote something that does this. It uses the htmldata module - you can find that using pypi. It only allows a specific set of html tags and attempts to close tags not closed. : from htmldata import tagextract, tagjoin allowed_tags = ['br', 'b', 'strong', 'em', 'i', 'u', 'tt', 'a', 'big',

Re: bytecode non-backcompatibility

2005-04-25 Thread Fuzzyman
Maurice LING wrote: > Hi, > > I've been using Python for about 2 years now, for my honours project and > now my postgrad project. I must say that I am loving it more and more > now. From my knowledge, Python bytecodes are not back-compatible. I must > say that my technical background isn't strong

Re: filename used by shelve

2005-04-25 Thread Nemesis
Mentre io pensavo ad una intro simpatica "Fredrik Lundh" scriveva: >> So the real filename may be different from the argument passed to >> "open". I have this problem, I want to delete (in some circustances) the >> file created by shelve.open, how can I know which is the name of this >> file (or f

Re: Getting into Python, comming from Perl.

2005-04-25 Thread Nick Craig-Wood
Miguel Manso <[EMAIL PROTECTED]> wrote: > I'm a programmer with 5 year of experience into Perl. I'm on that point > where you resolve problems without thinking on HOW you'll do it with > that language but only on the problem itself. > > Since Perl 6 started I've been following it. The conclu

Changing a line in a text file

2005-04-25 Thread kah
How do I change a line in a file?? For example I have the follwing text in my file: line1 line2 line3 line4 How do I replace 'line2' with 'newline'. Since the write operation in python will overwrite everything. Regards, Kah -- http://mail.python.org/mailman/listinfo/python-list

Re: Changing a line in a text file

2005-04-25 Thread Michael Hoffman
kah wrote: How do I change a line in a file?? For example I have the follwing text in my file: line1 line2 line3 line4 How do I replace 'line2' with 'newline'. Since the write operation in python will overwrite everything. This is the best I can figure out what you mean: lines = [] for line in fil

Re: Getting into Python, comming from Perl.

2005-04-25 Thread Gurpreet Sachdeva
I also coded for more than 3 years and eventually I got that I was not coding but writting poems in perl... Even after 3 months, I go back and check my hand written code, I had to think twice about the logic used... Now its pretty much systematic which incode dcoumentation and programming structure

RE: Changing a line in a text file

2005-04-25 Thread Vishnu
Hi, Here is the program for replacing 'line2' with 'newline'. inp_file.txt contains, line1 line2 line3 line4 EOF #-- Program starts #Get the inp file in to a list inp_file_list = [x for x in open('inp_file.txt')] #modify the desired line, Note: you should include newline inp_file_list[1] = 'xxx

Re: What's do list comprehensions do that generator expressions don't?

2005-04-25 Thread jfj
Robert Kern wrote: Mike Meyer wrote: Ok, we've added list comprehensions to the language, and seen that they were good. We've added generator expressions to the language, and seen that they were good as well. I'm left a bit confused, though - when would I use a list comp instead of a generator expr

Re: Changing a line in a text file

2005-04-25 Thread kah
Hi, the example provided by Vishnu is quite close to what I want but it still required me to write all the data back to the file. Is there any way where I can just write a particular line? Regards, Kah -- http://mail.python.org/mailman/listinfo/python-list

Re: Getting into Python, comming from Perl.

2005-04-25 Thread Daniel Dittmar
Miguel Manso wrote: I've tryed to use python some times but I get frustrated very quick. I get myself many times needing to figure out how to loop through a list, declare an associative array, checking how to pass named parameters to functions, and simple things like that. Create a cheat sheet w

Re: What's do list comprehensions do that generator expressions don't?

2005-04-25 Thread Robert Kern
jfj wrote: Robert Kern wrote: Mike Meyer wrote: Ok, we've added list comprehensions to the language, and seen that they were good. We've added generator expressions to the language, and seen that they were good as well. I'm left a bit confused, though - when would I use a list comp instead of a gen

Re: How to "generalize" a function?

2005-04-25 Thread jfj
Thomas Köllmann wrote: Hi, everybody! I'm teaching myself Python, and I have no experience in programming apart from some years of shell scripting. So, please bear with me. These two funktions are part of an administrative script I've set myself as a first lesson, and, as you will see, they're prac

Re: Changing a line in a text file

2005-04-25 Thread Steve Holden
kah wrote: Hi, the example provided by Vishnu is quite close to what I want but it still required me to write all the data back to the file. Is there any way where I can just write a particular line? If you are asking whether you can update a file in place, the answer is "yes" - look up "lseek" in

Re: HTML cleaner?

2005-04-25 Thread Leif K-Brooks
Ivan Voras wrote: Is there a HTML clean/tidy library or module written in pure python? I found mxTidy, but it's a interface to command-line tool. What I'm searching is something that will accept a list of allowed tags and/or attributes and strip the rest from HTML string. Here's a module I wrote

Re: What's do list comprehensions do that generator expressions don't?

2005-04-25 Thread jfj
I jfj wrote: make_fractal_with_seed (x for x in range(1) if fibonacci_prime (x)) and this is stupendus. At least range should be xrange. jfj -- http://mail.python.org/mailman/listinfo/python-list

Re: Python 2.4 killing commercial Windows Python development ?

2005-04-25 Thread [EMAIL PROTECTED]
It would be *really* nice if it worked for Python itself for making an RPM distribution of Python. -- http://mail.python.org/mailman/listinfo/python-list

Re: Python licence again

2005-04-25 Thread Nick Craig-Wood
has <[EMAIL PROTECTED]> wrote: > licence, practice = noun > license, practise = verb Tick ;-) -- Nick Craig-Wood <[EMAIL PROTECTED]> -- http://www.craig-wood.com/nick -- http://mail.python.org/mailman/listinfo/python-list

Injecting code into a function

2005-04-25 Thread George Sakkis
Is there a general way of injecting code into a function, typically before and/or after the existing code ? I know that for most purposes, an OO solution, such as the template pattern, is a cleaner way to get the same effect, but it's not always applicable (e.g. if you have no control over the desi

Re: What's do list comprehensions do that generator expressions don't?

2005-04-25 Thread jfj
Robert Kern wrote: jfj wrote: 2) to convert a list/tuple/string to a list, which is done extremely fast. Add "any iteratable". Genexps are iterables. The thing is that when you want to convert a tuple to a list you know already the size of it and you can avoid using append() and expanding the list

Re: HTML cleaner?

2005-04-25 Thread Ivan Voras
M.-A. Lemburg wrote: Not true: mxTidy integrates tidy as C lib. It's not an interface to the command line tool. Thanks, I'll look at it again! -- http://mail.python.org/mailman/listinfo/python-list

Re: Changing a line in a text file

2005-04-25 Thread Miki Tebeka
Hello kah, > How do I change a line in a file?? > > For example I have the follwing text in my file: > > line1 > line2 > line3 > line4 > > How do I replace 'line2' with 'newline'. Since the write operation in > python will overwrite everything. See http://docs.python.org/lib/module-fileinput.h

Re: What's do list comprehensions do that generator expressions don't?

2005-04-25 Thread Robert Kern
jfj wrote: Robert Kern wrote: jfj wrote: 2) to convert a list/tuple/string to a list, which is done extremely fast. Add "any iteratable". Genexps are iterables. The thing is that when you want to convert a tuple to a list you know already the size of it and you can avoid using append() and expandin

Re: Injecting code into a function

2005-04-25 Thread [EMAIL PROTECTED]
use eval. eval will accept any string and treat the string as a code. pujo -- http://mail.python.org/mailman/listinfo/python-list

Re: A smallish Tkinter question

2005-04-25 Thread Miki Tebeka
Hello Nick, > """ > What I want: A little window to open with a 0 in it. Every second, the > 0 should increment by 1. > What I get: A one second delay, see the window with a 1 in it, and then > nothing appears to happen. Never see the 0, never see a 2. Any quick > clues? Thanks. Nick. (Python 2.4

Re: Is there a package with convolution and related methods?

2005-04-25 Thread Miki Tebeka
Hello Charles, > Is there a Python package with Convolution and related methods? > > I'm working on modeling some DSP processes in Python. I've rolled one > up, but don't feel much like reinventing the wheel, especially if > there's already something like "Insanely Efficient FFT for Python" > al

Squezing in replacements into strings

2005-04-25 Thread Peter Bengtsson
I've got a regular expression that finds certain words from a longer string. >From "Peter Bengtsson PETER, or PeTeR" it finds: 'Peter','PETER','PeTeR'. What I then want to do is something like this: def _ok(matchobject): # more complicated stuff happens here return 1 def _massage(wor

Re: Squezing in replacements into strings

2005-04-25 Thread Peter Otten
Peter Bengtsson wrote: > I've got a regular expression that finds certain words from a longer > string. >>From "Peter Bengtsson PETER, or PeTeR" it finds: 'Peter','PETER','PeTeR'. > The problem is when there are more than one matches. The match.start() and > match.end() are for the original strin

Re: figuring out # of bytes

2005-04-25 Thread codecraig
so each character in the string is 1 byte? if so, can u point me to somewhere that states that perhaps? thanks -- http://mail.python.org/mailman/listinfo/python-list

Re: Squezing in replacements into strings

2005-04-25 Thread Adriano Ferreira
As Peter Otten said, sub() is probably what you want. Try: --- import re def _ok(matchobject): # more complicated stuff happens here return 1 def _massage(word): return "_" + word + "_" def _massage_or_not(matchobj): if not _ok(ma

Re: help needed :-pgdb givig error

2005-04-25 Thread Maxim Kasimov
Please try to check out permisions on the library. Perhaps there is no permissions for reading the library with uid of web-server "Ram" <[EMAIL PROTECTED]> ???/ ? ?: news:[EMAIL PROTECTED] Dear All I am very new to python . i would appreciate any help from you all on

ANN: Tao Scripting Language 0.9.0 beta released!

2005-04-25 Thread Limin Fu
Dear all, I am glad to announce in this mailing list that the lastest version of Tao scripting language has come out. Welcome to try it out! === Here are some details: === Summary: Tao is an object-oriented scripting language with dynamic typing variable

Re: figuring out # of bytes

2005-04-25 Thread Jaime Wyant
On 4/22/05, Jaime Wyant <[EMAIL PROTECTED]> wrote: > On 22 Apr 2005 13:28:57 -0700, codecraig <[EMAIL PROTECTED]> wrote: > > i want to the number of bytes in a string... > > > > is, len(x) accurate? > > > > so, x = "hi" > > len(x) == 2 so that means two bytes? > > > > thanks > > No, that means

Re: Multiple tuples for one for statement

2005-04-25 Thread R. C. James Harlow
On Monday 25 April 2005 04:20, James Stroud wrote: > for a,b,c in zip(tup1, tup2, tup3): >print a >print b >print c or just: for a,b,c in (tup1, tup2, tup3): print a print b print c pgpJ0RNTnCUA3.pgp Description: PGP signature -- http://mail.python.org/mailman/listinfo/

Re: Squezing in replacements into strings

2005-04-25 Thread Peter Bengtsson
Peter Otten <__peter__ web.de> writes: > > > How can I do this this concatenation correctly? > > I think sub() is more appropriate than finditer() for your problem, e. g.: > > >>> def process(match): > ... return "_%s_" % match.group(1).title() > ... > >>> re.compile("(peter)", re.I).sub(p

Exception in Python 2.3.3 Interpreter

2005-04-25 Thread Saravanan
Hello, Im running Python Application as a Windows Service (using windows extensions). But, sporadically the application crashes (crash in Python23.dll) and this stops the service. This problem cann't be reproduced easily in my system and the call stack generated by the application is given below

Re: Injecting code into a function

2005-04-25 Thread Steffen Glückselig
Perhalps metaclasses are of interest to you. You can decorate existing methods with additional behavior using metaclasses. A simple example can be found at http://soiland.no/software/logmeta I've gathered some more links under http://www.gungfu.de/facts/wiki/field.php?pagename=Main.MetaProgramming

Python, Perl & PDF files

2005-04-25 Thread rbt
Are there any plans in the near future to support PDF files in Python as thoroughly and completely as Perl does? http://cpan.uwinnipeg.ca/search?query=pdf&mode=dist I love Python's clean syntax and ease of use, etc. But on some things (PDF for example) as barbaric as Perl's syntax is, it does

Re: Multiple tuples for one for statement

2005-04-25 Thread Ivan Van Laningham
Hi All-- "R. C. James Harlow" wrote: > > or just: > > for a,b,c in (tup1, tup2, tup3): > print a > print b > print c > And this works in Python version??? Metta, Ivan -- Ivan Van Laningham God N Locomotive Works http://www.andi-holmes.co

what is the best way to determine system OS?

2005-04-25 Thread googleboy
Hi there. I am writing a little app tha tI would like to make cross-platform (debian, RH, Fedora, Solaris, AIX, etc) Originally I decided to check what uname returned, as I didn't think it mattered beyond the detail of Linux or SunOS etc. Recently I have learned that FC3 breaks my script, so I

Re: Changing a line in a text file

2005-04-25 Thread Larry Bates
You might be able to use "edge" case to make this simple. 1) If the line you are replacing is unique in the file and 2) File can easily fit in memory you can write: fp=open(filename, 'r') contents=fp.read() fp.close() newcontents=newline.join(contents.split(line2)) fp=open(filename, 'w') fp.wr

Re: Why is Python not supporting full derivation of built-in file class?

2005-04-25 Thread Pierre Rouleau
Jeff Epler wrote: This issue was discussed in another recent python-list thread, called "Writing to stdout and a log file". My second post includes a patch to Python's "fileobject.c" that made the code that started that thread work, but for reasons I mentioned in that post I didn't want to push for

Re: How to run Python in Windows w/o popping a DOS box?

2005-04-25 Thread pyguy2
>I am objecting to embeddeding metadata in data. >I think we were just looking a different aspects of the elephant ;-) I think you are right on both counts. Given current filesystems, I like the #! method. I tend to like approaches that have very low entrance access fees and can scale up. Ki

Re: Multiple tuples for one for statement

2005-04-25 Thread R. C. James Harlow
On Monday 25 April 2005 14:34, Ivan Van Laningham wrote: > Hi All-- > > "R. C. James Harlow" wrote: > > or just: > > > > for a,b,c in (tup1, tup2, tup3): > > print a > > print b > > print c > > And this works in Python version??? Ah, reading the replies to the original post, this works

Re: What's do list comprehensions do that generator expressions don't?

2005-04-25 Thread Mike Meyer
jfj <[EMAIL PROTECTED]> writes: > I think a better question would be "What do *generator expressions* do > that list comprehensions don't?". And always use list comprehensions > unless you want the extra bit. As the OP, I can say why I didn't ask those questions. Generator expressions don't bui

Re: what is the best way to determine system OS?

2005-04-25 Thread Philippe C. Martin
How about popen of 'uname -r' ? Regards, Philippe googleboy wrote: > Hi there. > > I am writing a little app tha tI would like to make cross-platform > (debian, RH, Fedora, Solaris, AIX, etc) > > Originally I decided to check what uname returned, as I didn't think it > mattered beyond the de

Re: Multiple tuples for one for statement

2005-04-25 Thread Ivan Van Laningham
Hi All-- "R. C. James Harlow" wrote: > > On Monday 25 April 2005 14:34, Ivan Van Laningham wrote: > > Hi All-- > > > > "R. C. James Harlow" wrote: > > > or just: > > > > > > for a,b,c in (tup1, tup2, tup3): > > > print a > > > print b > > > print c > > > > And this works in Python ver

Re: Injecting code into a function

2005-04-25 Thread Ron
George Sakkis wrote: Is there a general way of injecting code into a function, typically before and/or after the existing code ? I know that for most purposes, an OO solution, such as the template pattern, is a cleaner way to get the same effect, but it's not always applicable (e.g. if you have no

Re: HTML cleaner?

2005-04-25 Thread Walter Dörwald
Ivan Voras wrote: M.-A. Lemburg wrote: Not true: mxTidy integrates tidy as C lib. It's not an interface to the command line tool. Thanks, I'll look at it again! Another option might be the HTML parser (libxml2.htmlReadMemory()) from libxml2 (http://www.xmlsoft.org) Bye, Walter Dörwald -- http:

Re: How to run Python in Windows w/o popping a DOS box?

2005-04-25 Thread Ron
Bengt Richter wrote: I don't know what pythonw.exe does with std i/o that hasn't been intercepted, but I would think it could be handy to have it force a console window, and maybe have a pythonw.exe command line option to dump either or both stdout and stderr silently. That way by default you'd see

Re: Python, Perl & PDF files

2005-04-25 Thread Mike Meyer
rbt <[EMAIL PROTECTED]> writes: > Are there any plans in the near future to support PDF files in Python > as thoroughly and completely as Perl does? > > http://cpan.uwinnipeg.ca/search?query=pdf&mode=dist Claiming that CPAN represents Perl "supporting" something isn't really accurate. Those are

Re: Multiple tuples for one for statement

2005-04-25 Thread Peter Hansen
Ivan Van Laningham wrote: "R. C. James Harlow" wrote: On Monday 25 April 2005 14:34, Ivan Van Laningham wrote: "R. C. James Harlow" wrote: or just: for a,b,c in (tup1, tup2, tup3): print a print b print c And this works in Python version??? Ah, reading the replies to the original post, thi

Python23.pdb

2005-04-25 Thread Saravanan
Hello, 1) Is is possible to get the pdb files for the Python version 2.3.3? Python 2.3.3 (#51, Dec 18 2003, 20:22:39) [MSC v.1200 32 bit (Intel)] on win32 2) Is there way to enable symptom collection/traces in the Python Core modules? Thanks in advance. - Saravanan D -- http://mail.python.or

Re: what is the best way to determine system OS?

2005-04-25 Thread Robert Kern
googleboy wrote: Hi there. I am writing a little app tha tI would like to make cross-platform (debian, RH, Fedora, Solaris, AIX, etc) Originally I decided to check what uname returned, as I didn't think it mattered beyond the detail of Linux or SunOS etc. Recently I have learned that FC3 breaks my

Re: what is the best way to determine system OS?

2005-04-25 Thread Mike Meyer
"googleboy" <[EMAIL PROTECTED]> writes: > Hi there. > > I am writing a little app tha tI would like to make cross-platform > (debian, RH, Fedora, Solaris, AIX, etc) > > Originally I decided to check what uname returned, as I didn't think it > mattered beyond the detail of Linux or SunOS etc. > > R

Re: What's do list comprehensions do that generator expressions don't?

2005-04-25 Thread jfj
Mike Meyer wrote: jfj <[EMAIL PROTECTED]> writes: I think a better question would be "What do *generator expressions* do that list comprehensions don't?". And always use list comprehensions unless you want the extra bit. As the OP, I can say why I didn't ask those questions. Sorry. I was referri

Re: Python, Perl & PDF files

2005-04-25 Thread TZOTZIOY
On Mon, 25 Apr 2005 09:23:43 -0400, rumours say that rbt <[EMAIL PROTECTED]> might have written: >Are there any plans in the near future to support PDF files in Python as >thoroughly and completely as Perl does? Before we let you know about our plans, what are *your* plans on this subject? :

New versions of numarray?

2005-04-25 Thread Matt Feinstein
Hi-- I notice that there are some new versions of numarray available for download-- is there any documentation on what's new/fixed/broken? Matt Feinstein -- There is no virtue in believing something that can be proved to be true. -- http://mail.python.org/mailman/listinfo/python-list

Re: Python, Perl & PDF files

2005-04-25 Thread rbt
Christos TZOTZIOY Georgiou wrote: On Mon, 25 Apr 2005 09:23:43 -0400, rumours say that rbt <[EMAIL PROTECTED]> might have written: Are there any plans in the near future to support PDF files in Python as thoroughly and completely as Perl does? Before we let you know about our plans, what are *

Re: what is the best way to determine system OS?

2005-04-25 Thread Fredrik Lundh
"googleboy" <[EMAIL PROTECTED]> wrote: > I am writing a little app tha tI would like to make cross-platform > (debian, RH, Fedora, Solaris, AIX, etc) > > Originally I decided to check what uname returned, as I didn't think it > mattered beyond the detail of Linux or SunOS etc. > > Recently I have

Re: Python callbacks & PyGILState_Release()

2005-04-25 Thread David E. Konerding DSD staff
In article <[EMAIL PROTECTED]>, Randall Hopper wrote: > Thomas Heller: > |> Python -> C++ -> Python Callback > |> > |> (example attached) an exception raised in the callback doesn't make it back > |> across C++ to Python. > ... > |> void callback_wrapper( void *user_data ) > |> { > |> // Acq

Re: what is the best way to determine system OS?

2005-04-25 Thread Sion Arrowsmith
Philippe C. Martin <[EMAIL PROTECTED]> wrote: >How about popen of 'uname -r' ? os.uname()[2] is probably a better way (ie it doesn't spawning another process) of getting this information. I don't think it will help the original poster though (depending on *what* it is about FC3 which is breaking t

RE: What do list comprehensions do that generator expressions don't?

2005-04-25 Thread Mark English
> Date: Mon, 25 Apr 2005 08:51:17 -0500 > From: Mike Meyer <[EMAIL PROTECTED]> > Which means that the real rule should be always use generator expressions, > unless you *know* the expression will always fit in memory. > Which leads to the obvious question of why the exception. >>> l = [(1, 2), (

Re: figuring out # of bytes

2005-04-25 Thread Fredrik Lundh
"codecraig" wrote: > so each character in the string is 1 byte? if so, can u point me to > somewhere that states that perhaps? the documentation, perhaps? http://www.python.org/doc/ref/types.html Strings The items of a string are characters. There is no separate character type; a

Re: Python, Perl & PDF files

2005-04-25 Thread TZOTZIOY
On Mon, 25 Apr 2005 10:32:11 -0400, rumours say that rbt <[EMAIL PROTECTED]> might have written: >I do not seek to provoke. Sorry if my question comes across that way to you. Thanks for giving attention to my post, no need for apologies. By the way, you didn't say in which way ReportLab and pdfl

Re: Python, Perl & PDF files

2005-04-25 Thread Robin Becker
rbt wrote: .. I just want to read PDF files in a portable way (windows, linux, mac) from within Python. .. I suppose you mean extract PDF pages and do something with them. http://www.reportlab.com does have a tool that handles that in Python. It's not free though. There are indeed a nu

Re: New versions of numarray?

2005-04-25 Thread Robert Kern
Matt Feinstein wrote: Hi-- I notice that there are some new versions of numarray available for download-- is there any documentation on what's new/fixed/broken? You could ask on the numarray list. When you do, you should specify what version you're coming from so you can get the appropriate answer

Re: What do list comprehensions do that generator expressions don't?

2005-04-25 Thread Robert Kern
Mark English wrote: Date: Mon, 25 Apr 2005 08:51:17 -0500 From: Mike Meyer <[EMAIL PROTECTED]> Which means that the real rule should be always use generator expressions, unless you *know* the expression will always fit in memory. Which leads to the obvious question of why the exception. l = [(1,

regex over files

2005-04-25 Thread Robin Becker
Is there any way to get regexes to work on non-string/unicode objects. I would like to split large files by regex and it seems relatively hard to do so without having the whole file in memory. Even with buffers it seems hard to get regexes to indicate that they failed because of buffer terminati

Re: Python, Perl & PDF files

2005-04-25 Thread Alex
rbt wrote: I just want to read PDF files in a portable way (windows, linux, mac) from within Python. reportlab is an excelent tool for generating pdf files, but as far as I know, it doesn't "read" pdf's. http://www.reportlab.org/rl_toolkit.html there's a project in sourceforge called pdf playgr

Re: regex over files

2005-04-25 Thread Gerald Klix
Map the file into RAM by using the mmap module. The file's contents than is availabel as a seachable string. HTH, Gerald Robin Becker schrieb: Is there any way to get regexes to work on non-string/unicode objects. I would like to split large files by regex and it seems relatively hard to do so wi

ACCU Conference (PyUK) 2005

2005-04-25 Thread Michele Simionato
This should go in a blog, but I do not have one, nor any intention to start one, so I thought I will post here instead. Warning: this is a long post! ACCU Conference (PyUK) 2005: a personal view === Maybe not everybody knows that last week (19-

Re: Variables

2005-04-25 Thread Donn Cave
Quoth Richard Blackwood <[EMAIL PROTECTED]>: ... | Would you agree that the concept of variables differs in very important | ways between the domains of math and programming? No, if "math" means the elementary notions that I have been exposed to and "very important" means "important to implemento

Re: cross platform printing

2005-04-25 Thread dcrespo
Hi Dennis... Then, what would be your solution? Print a PDF? If so, how you do that without assuming that an application is available to print it? Daniel -- http://mail.python.org/mailman/listinfo/python-list

Re: regex over files

2005-04-25 Thread Robin Becker
Gerald Klix wrote: Map the file into RAM by using the mmap module. The file's contents than is availabel as a seachable string. that's a good idea, but I wonder if it actually saves on memory? I just tried regexing through a 25Mb file and end up with 40Mb as working set (it rose linearly as the l

PyGTK vs. wxPython

2005-04-25 Thread dcrespo
Hi all... I think wxPython is much better than PyGTK. First of all, PyGTK needs the GTK runtime installed, whereas wxPython is entirely Python's modules, so It facilitates the apps' distribution. Also, PyGTK uses specific controls or widgets of GTK, while wxPython uses native controls of the platf

Re: bytecode non-backcompatibility

2005-04-25 Thread Terry Reedy
I think the OP is confusing three different CPython implementation features -- bytecodes, marshal format, and C API, all of which change pretty slowly -- and a MS Windows/C (dis)feature. CPython bytecodes only concern code written in Python but are mostly not a concern because recompilation is

Re: PyGTK vs. wxPython

2005-04-25 Thread Grant Edwards
On 2005-04-25, dcrespo <[EMAIL PROTECTED]> wrote: > Hi all... > > I think wxPython is much better than PyGTK. First of all, PyGTK needs > the GTK runtime installed, whereas wxPython is entirely Python's > modules, Huh? wxPythonGTK requires GTK runtimes as well: $ ldd libwx_gtk2_core-2.5.so> /tmp

Re: Exception in Python 2.3.3 Interpreter

2005-04-25 Thread Terry Reedy
"Saravanan" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > Any clue about the problem? None except to suggest that you upgrade to 2.3.5 and see if it has been fixed. tjr -- http://mail.python.org/mailman/listinfo/python-list

Re: Python, Perl & PDF files

2005-04-25 Thread Robin Becker
Dennis Lee Bieber wrote: ... The most commonly known phrasing would likely be "God only helps those who help themselves". Of course for politicians and others with troughed snouts it should read "God punish those that help themselves", never seems to work out in practice though :( -g

Re: Injecting code into a function

2005-04-25 Thread Paddy
Try searching for: 'python aspect-oriented' as aspect oriented programming is about modifying existing class-methods (not exactly functions which is what you asked for). You might also do a search for "AOP considered harmful" http://www.infosun.fmi.uni-passau.de/st/papers/EIWAS04/stoerzer04aop_harm

Re: Multiple tuples for one for statement

2005-04-25 Thread Ivan Van Laningham
Hi All-- Peter Hansen wrote: > > > Define "works": > > >>> a = (1,2,3) > >>> b = ('a','b','c') > >>> c = (None, 'foo', 3.14) > >>> tup1 = (1,2,3) > >>> tup2 = ('a','b','c') > >>> tup3 = (None, 'foo', 3.14) > >>> for a,b,c in (tup1,tup2,tup3): > ... print a > ... print b > ... print

Re: PyGTK vs. wxPython

2005-04-25 Thread Neil Benn
Grant Edwards wrote: On 2005-04-25, dcrespo <[EMAIL PROTECTED]> wrote: Hi all... I think wxPython is much better than PyGTK. First of all, PyGTK needs the GTK runtime installed, whereas wxPython is entirely Python's modules, Huh? wxPythonGTK requires GTK runtimes as well: Hello,

Re: PyGTK vs. wxPython

2005-04-25 Thread Ivan Voras
Grant Edwards wrote: Huh? wxPythonGTK requires GTK runtimes as well: He was probably talking about Windows, where wx toolkit uses native (more or less...) controls. But then, installing GTK runtime libraries on Windows is a one-click job, there are automated installers for it. -- http://mail.py

Re: Python23.pdb

2005-04-25 Thread olsongt
Saravanan wrote: > Hello, > > 1) Is is possible to get the pdb files for the Python version 2.3.3? > > Python 2.3.3 (#51, Dec 18 2003, 20:22:39) [MSC v.1200 32 bit (Intel)] > on win32 > These don't exist. If you have access to VC 6.0 you could check out the appropriate tag from cvs and do your o

Re: PyGTK vs. wxPython

2005-04-25 Thread Grant Edwards
On 2005-04-25, Ivan Voras <[EMAIL PROTECTED]> wrote: > Grant Edwards wrote: > >> Huh? wxPythonGTK requires GTK runtimes as well: > > He was probably talking about Windows, where wx toolkit uses native > (more or less...) controls. Ah -- I forgot that GTK was an option under Windows. The last ti

Re: PyGTK vs. wxPython

2005-04-25 Thread Maciej Dziardziel
dcrespo wrote: > Hi all... > > I think wxPython is much better than PyGTK. First of all, PyGTK needs > the GTK runtime installed, whereas wxPython is entirely Python's > modules, so It facilitates the apps' distribution. As already mentioned, it is not true. You will still need GTK (on Linux, no

Python consulting opportunity

2005-04-25 Thread Gary Robinson
We'd like to find an experienced Python programmer for a full-time, three-month consulting contract to help us with our product, Goombah (http://www.goombah.com). Experience with wxPython and/or PyObjC would be a big plus. More importantly we're looking for someone who can get up to speed very

Re: Injecting code into a function

2005-04-25 Thread Steve Holden
George Sakkis wrote: Is there a general way of injecting code into a function, typically before and/or after the existing code ? I know that for most purposes, an OO solution, such as the template pattern, is a cleaner way to get the same effect, but it's not always applicable (e.g. if you have no

Re: Multiple tuples for one for statement

2005-04-25 Thread Peter Hansen
Ivan Van Laningham wrote: I can see that now. I had three hours sleep last night and my brain hurts, so I don't get it. I seek enlightenment. So do I: did you mean you don't even "get" what my code is doing, or you don't get what the OP really wanted, or something else? (My sample works only beca

Re: Python, Perl & PDF files

2005-04-25 Thread Peter Hansen
Dennis Lee Bieber wrote: On Mon, 25 Apr 2005 17:24:36 +0300, Christos "TZOTZIOY" Georgiou: I don't know any related myth of anglo-saxon origin to quote. The most commonly known phrasing would likely be "God only helps those who help themselves". Google suggests that removing the word "only" pro

web based file manager in python

2005-04-25 Thread Ksenia Marasanova
Hi, I didn't suceed in finding any kind of standard web based file manager, written in Python. There are quite a lot for PHP (the nicest I found is phpXplorer: http://www.phpxplorer.org) , but I'd rather use Python. I don't mind installing one of the millions webframeworks for this (well, except f

Re: Python, Perl & PDF files

2005-04-25 Thread Peter Hansen
Peter Hansen wrote: Dennis Lee Bieber wrote: On Mon, 25 Apr 2005 17:24:36 +0300, Christos "TZOTZIOY" Georgiou: I don't know any related myth of anglo-saxon origin to quote. The most commonly known phrasing would likely be "God only helps those who help themselves". Google suggests that removin

Dr. Dobb's Python-URL! - weekly Python news and links (Apr 25)

2005-04-25 Thread Simon Brunning
QOTW: "Sure, but what about the case where his program is on paper tape and all he has for an editor is an ice pick?" - Grant Edwards "And in this case, you get improved usability *and* improved speed at the same time. That's the way it should be." - Fredrik Lundh The Simplest Possible Metac

Re: what is the best way to determine system OS?

2005-04-25 Thread Cameron Laird
In article <[EMAIL PROTECTED]>, Mike Meyer <[EMAIL PROTECTED]> wrote: . . . >Anyway, checking the system name is the wrong way to build portable >programs. For one thing, as you've discovered, new systems won't work >properly.

  1   2   3   >