Re: highlight words by regex in pdf files using python

2010-03-16 Thread Aahz
In article , Peng Yu wrote: > >I don't find a general pdf library in python that can do any >operations on pdfs. > >I want to automatically highlight certain words (using regex) in a >pdf. Could somebody let me know if there is a tool to do so in python? Did you Google at all? "python pdf" find

Re: Conditional based on whether or not a module is being used

2010-03-16 Thread Aahz
In article , Pete Emerson wrote: > >Excellent, this is what I finally discovered, although I was looking >for 'foo' in sys.modules.keys(), which apparently isn't necessary. Actually, `foo in sys.modules.keys()` is double-slow, because first the dict must be scanned to create a list, and then the

Re: Conditional based on whether or not a module is being used

2010-03-16 Thread Aahz
In article <42062deb-785a-4955-9ce0-d9fb7a264...@j27g2000yqn.googlegroups.com>, Vinay Sajip wrote: > >I'm reviewing the documentation at the moment, as it happens, and it >still seems hard to be able to put together a structure which is good >for everyone. A full treatment, it seems to me, would

Re: cycling through options

2010-03-16 Thread Gabriel Genellina
En Tue, 16 Mar 2010 11:30:51 -0300, Dieter Faulbaum escribió: is there a better way for cycling through all options than this: (options, args) = parser.parse_args() for opt in options.__dict__.keys(): print opt, ":", options.__dict__[opt] (I assume parser is an optparse.OptionParser

Re: import antigravity

2010-03-16 Thread Michael Rudolf
Am 16.03.2010 21:44, schrieb Mark Lawrence: Who actually *IS* running the time machine? Are there any bugs?? My is. And as I'm a lazy hacker: sure. there are bugs. lets just call them features and move on. nothing to see here ;) -- http://mail.python.org/mailman/listinfo/python-list

Re: How to add a library path to pythonpath ?

2010-03-16 Thread Mark Hammond
On 17/03/2010 1:26 AM, Barak, Ron wrote: Thanks for the suggestion Pable. However, I really need the $PYTHONPATH to include this additional library, so all Python scripts could use it. In Windows I have defined PYTHONPATH as c:\views\cc_view\TS_svm_ts_tool\SVMInspector\lib\, and also in the Windo

C++ code generation

2010-03-16 Thread Dan Goodman
Hi all, I'm doing some C++ code generation using Python, and would be interested in any comments on the approach I'm taking. Basically, the problem involves doing some nested loops and executing relatively simple arithmetic code snippets, like: for i in xrange(len(X)): X[i] += 5 Actually

Re: Python bindings tutorial

2010-03-16 Thread CHEN Guang
> Is there any tutorial how to write a bindings for a exe ( dos) > program? > I would like to run it from a Python directly > ( using import command and a particular function from the binding) > not using os.system command. An example: PythoidC ( http://pythoidc.googlecode.com ), look at import

Re: C++ code generation

2010-03-16 Thread CHEN Guang
PythoidC ( http://pythoidc.googlecode.com ) is a C code generator (not C++) - Original Message - From: "Dan Goodman" To: Sent: Wednesday, March 17, 2010 9:00 AM Subject: C++ code generation > Hi all, > > I'm doing some C++ code generation using Python, and would be interested > in

Re: How to handle file uploads with http.server

2010-03-16 Thread Gabriel Genellina
En Thu, 11 Mar 2010 07:30:24 -0300, Neil Blue escribió: I have a basic http.server instance running (class HTTPHandler(http.server.BaseHTTPRequestHandler), with python 3.1, and I would like to upload files with multipart forms. def do_POST(self): ctype, pdict = cgi.parse_header(self.

Re: Exiting gracefully from ThreadingTCPServer

2010-03-16 Thread Gabriel Genellina
En Fri, 12 Mar 2010 12:15:16 -0300, Pete Emerson escribió: I'm trying to get threading going for the first time in python, and I'm trying to modify code I found so that I can have the server close the TCP connections and exit gracefully. Two problems: Which Python version? 1) While the Ke

Re: datetime string conversion error

2010-03-16 Thread Gabriel Genellina
En Tue, 16 Mar 2010 20:31:11 -0300, Josh English escribió: On Mar 16, 11:56 am, Jordan Apgar wrote: here's what I'm doing: date = "2010-03-16 14:46:38.409137" olddate = datetime.strptime(date,"%Y-%m-%j %H:%M:%S.%f") Due to circumstances, I'm using Python 2.5.4 on one machine (2.6 on th

Re: C-API PyObject_Call

2010-03-16 Thread moerchendiser2k3
At first thanks for your answers!!! On 16 Mrz., 21:16, Carl Banks wrote: > Here you raise an exception with a C statement, > and catch and print it in the very next line.  The exception doesn't > exit from Python code so there are no lines to print. Exactly, I dont expect any line/file informati

Web Hosting Python 3

2010-03-16 Thread hidura
Hello list, i am in a project what need hosting, who give hosting to python3? -- http://mail.python.org/mailman/listinfo/python-list

Re: highlight words by regex in pdf files using python

2010-03-16 Thread Patrick Maupin
On Mar 4, 6:57 pm, Peng Yu wrote: > I don't find a general pdf library in python that can do any > operations on pdfs. > > I want to automatically highlight certain words (using regex) in a > pdf. Could somebody let me know if there is a tool to do so in python? The problem with PDFs is that they

Data entry Work available

2010-03-16 Thread pothuri ramesh
Data entry works Available At No need to pay DEposite http://trading7000.blogspot.com/ Adposting Jobs Availble http://trading7000.blogspot.com/ No need to work Hard Earn Money From Home 7000 in Minutes http://trading7000.blogspot.com/ -- http://mail.python.org/mailman/listinfo/python-lis

Re: to pass self or not to pass self

2010-03-16 Thread Lie Ryan
On 03/17/2010 05:59 AM, Jason Tackaberry wrote: > On Tue, 2010-03-16 at 10:04 +0100, Bruno Desthuilliers wrote: >> Answer here: >> >> http://wiki.python.org/moin/FromFunctionToMethod > > I have a sense I used to know this once upon a time, but the question > came to my mind (possibly again) and I

Re: Converting Python CGI to WSGI scripts

2010-03-16 Thread Sebastian Bassi
On Tue, Mar 16, 2010 at 2:18 PM, wrote: > I have a few dozen simple Python CGI scripts. > Are there any advantages or disadvantages to rewriting these CGI scripts as > WSGI scripts? It depends of the script. WSGI should be faster since you don't start a Python instance for each call (as in CGI).

Re: to pass self or not to pass self

2010-03-16 Thread Steven D'Aprano
On Wed, 17 Mar 2010 15:57:17 +1100, Lie Ryan wrote: > Most people probably would never need to use > descriptor protocol directly, since the immediate benefit of descriptor > protocol are property(), classmethod(), and instancemethod() decorators > which, without descriptor protocol, would never b

Re: to pass self or not to pass self

2010-03-16 Thread Patrick Maupin
On Mar 16, 1:59 pm, Jason Tackaberry wrote: > Why not create the bound methods at instantiation time, rather than > using the descriptor protocol which has the overhead of creating a new > bound method each time the method attribute is accessed? Well, for one thing, Python classes are open. They

Re: Dynamic Class Creation

2010-03-16 Thread Josh English
Chris, Thanks. This worked for the attributes, but I think the tactic is still misleading. There are child elements I can't quite determine how to deal with: Analog Science Fiction and Fact Analog Science Fiction First Contact Hard Science Fiction Stanley Schmidt

Re: Converting Python CGI to WSGI scripts

2010-03-16 Thread John Nagle
Sebastian Bassi wrote: On Tue, Mar 16, 2010 at 2:18 PM, wrote: I have a few dozen simple Python CGI scripts. Are there any advantages or disadvantages to rewriting these CGI scripts as WSGI scripts? It depends of the script. WSGI should be faster since you don't start a Python instance for e

Re: C-API PyObject_Call

2010-03-16 Thread Stefan Behnel
moerchendiser2k3, 16.03.2010 19:25: Hi, currently I am not at home, I will post some stuff when I am back. Just the note: I throw an exception with the C API. Looks like that PyObject *result = PyObject_Call(my_isntance, "", NULL); if(result==NULL) { PyErr_Print(); //when this happens, th

Re: import antigravity

2010-03-16 Thread Stefan Behnel
Michael Rudolf, 17.03.2010 00:48: Am 16.03.2010 21:44, schrieb Mark Lawrence: Who actually *IS* running the time machine? Are there any bugs?? My is. And as I'm a lazy hacker: sure. there are bugs. lets just call them features and move on. nothing to see here ;) I'll know it, I'll just know

Re: C++ code generation

2010-03-16 Thread Stefan Behnel
CHEN Guang, 17.03.2010 02:54: - Original Message - From: "Dan Goodman" I'm doing some C++ code generation using Python, and would be interested in any comments on the approach I'm taking. PythoidC ( http://pythoidc.googlecode.com ) is a C code generator (not C++) It would be nice if

<    1   2