[newbie] Read file, and append?

2007-12-25 Thread Gilles Ganault
Hello I'd just like to open each file in a directory with a given extension, read it to search for a pattern, and, if not found, append data to this file. The following doesn't work: == import glob,re f = open("activate.tmpl", "r") template = f.read() template = "\r\n" + template f.clos

Re: Python DLL in Windows Folder

2007-12-25 Thread Markus Gritsch
On 25/12/2007, Tim Roberts <[EMAIL PROTECTED]> wrote: > Ross Ridge <[EMAIL PROTECTED]> wrote: > > >Chris Mellon <[EMAIL PROTECTED]> wrote: > >>What the python installer is doing is the Right Thing for making the > >>standard python dll available to third party applications. > >>Applications that wa

Re: [newbie] Read file, and append?

2007-12-25 Thread Gary Herron
Gilles Ganault wrote: > Hello > > I'd just like to open each file in a directory with a given extension, > read it to search for a pattern, and, if not found, append data to > this file. The following doesn't work: > > == > import glob,re > > f = open("activate.tmpl", "r") > template = f.

Re: Python DLL in Windows Folder

2007-12-25 Thread Markus Gritsch
On 24/12/2007, Lie <[EMAIL PROTECTED]> wrote: > > (good programs are not DLL implementation specific Assume an application embedding Python being compiled with MSVC 8.0. It uses the runtime msvcr80.dll. If you now pass objects created in your application to the Python interpreter which is compile

Re: Python DLL in Windows Folder

2007-12-25 Thread Ross Ridge
Chris Mellon <[EMAIL PROTECTED]> wrote: >What the python installer is doing is the Right Thing for making the >standard python dll available to third party applications. >Applications that want a specific version of a specific DLL should use >the mechanisms available for doing so, instead of relyin

Re: Python DLL in Windows Folder

2007-12-25 Thread Markus Gritsch
On 24/12/2007, Markus Gritsch <[EMAIL PROTECTED]> wrote: > On 24/12/2007, Thorsten Kampe <[EMAIL PROTECTED]> wrote: > > * Markus Gritsch (Sun, 23 Dec 2007 18:28:41 +0100) > > > On 23/12/2007, Thorsten Kampe <[EMAIL PROTECTED]> wrote: > > > > * Markus Gritsch (Sun, 23 Dec 2007 15:52:50 +0100) > > >

How to detect when a user switches between windows (in WinXP)?

2007-12-25 Thread mangoldproject
Hi everyone, I'm a beginning-to-intermediate Python programmer with some experience in other languages. At the moment I am trying to write a Python program that will run in the background and execute a series of commands whenever I switch between windows (my OS is Windows XP). For example, I want

Re: Python DLL in Windows Folder

2007-12-25 Thread Stef Mientki
Markus Gritsch wrote: > On 25/12/2007, Tim Roberts <[EMAIL PROTECTED]> wrote: > >> Ross Ridge <[EMAIL PROTECTED]> wrote: >> >> >>> Chris Mellon <[EMAIL PROTECTED]> wrote: >>> What the python installer is doing is the Right Thing for making the standard python dll available

Re: Python DLL in Windows Folder

2007-12-25 Thread Neil Hodgson
Markus Gritsch: > I assume that your Python applications are .py files. To be able to > run them it would be perfectly ok if the Python DLL would be located > beside the python.exe in the Python installation folder. Your Python application may not be being run by python.exe but as an in-pro

Re: Python DLL in Windows Folder

2007-12-25 Thread Markus Gritsch
On 25/12/2007, Neil Hodgson <[EMAIL PROTECTED]> wrote: > Markus Gritsch: > > > I assume that your Python applications are .py files. To be able to > > run them it would be perfectly ok if the Python DLL would be located > > beside the python.exe in the Python installation folder. > > Your Pyth

CPython and a C extension using Boehm GC

2007-12-25 Thread malkarouri
Hi everyone, Is it possible to write a Python extension that uses the Boehm garbage collector? I have a C library written that makes use of boehm-gc for memory management. To use that, I have to call GC_INIT() at the start of the program that uses the library. Now I want to encapsulate the library

Re: Pexpect and a Linux Terminal

2007-12-25 Thread [EMAIL PROTECTED]
Yes it's work ! :-D I use prompt = '.*#' to detect the prompt expect. Thank you for you'r help ! Vive Python et TK :-D -- http://mail.python.org/mailman/listinfo/python-list

Re: why does a disabled button respond to clicks

2007-12-25 Thread damonjulian
thank you for the reply..that solves my problem damon -- http://mail.python.org/mailman/listinfo/python-list

Re: Pexpect and a Linux Terminal

2007-12-25 Thread [EMAIL PROTECTED]
On 25 déc, 09:41, "[EMAIL PROTECTED]" <[EMAIL PROTECTED]> wrote: > Yes it's work ! :-D > > I use prompt = '.*#' to detect the prompt expect. Thank you for you'r > help ! > > Vive Python et TK :-D I have another probleme, not directly from Pexpect() function. There is my code : from Tkinter impor

Re: convert pdf to png

2007-12-25 Thread Diez B. Roggisch
Carl K schrieb: > Grant Edwards wrote: >> On 2007-12-24, Carl K <[EMAIL PROTECTED]> wrote: >> If it is a multi page pdf Imagemagick will do: convert file.pdf page-%03d.png >>> I need python code to do this. It is going to be run on a >>> someone else's shared host web server, securi

Re: Pexpect and a Linux Terminal

2007-12-25 Thread [EMAIL PROTECTED]
On 25 déc, 10:14, "[EMAIL PROTECTED]" <[EMAIL PROTECTED]> wrote: > On 25 déc, 09:41, "[EMAIL PROTECTED]" <[EMAIL PROTECTED]> wrote: > > > Yes it's work ! :-D > > > I use prompt = '.*#' to detect the prompt expect. Thank you for you'r > > help ! > > > Vive Python et TK :-D > > I have another proble

Re: Pexpect and a Linux Terminal

2007-12-25 Thread [EMAIL PROTECTED]
On 25 déc, 10:14, "[EMAIL PROTECTED]" <[EMAIL PROTECTED]> wrote: > On 25 déc, 09:41, "[EMAIL PROTECTED]" <[EMAIL PROTECTED]> wrote: > > > Yes it's work ! :-D > > > I use prompt = '.*#' to detect the prompt expect. Thank you for you'r > > help ! > > > Vive Python et TK :-D > > I have another proble

Re: [newbie] Read file, and append?

2007-12-25 Thread Gilles Ganault
On Tue, 25 Dec 2007 01:14:37 -0800, Gary Herron <[EMAIL PROTECTED]> wrote: >Here's what I'd end up with. (This is untested.) Thanks a lot. It worked. I didn't suspect there could be so many errors in such a small sript :-D -- http://mail.python.org/mailman/listinfo/python-list

Re: convert pdf to png

2007-12-25 Thread Rob Wolfe
Carl K <[EMAIL PROTECTED]> writes: > I need to take the take the pdf output from reportlab and create a > preview image for a web page. so png or something. I am sure > ghostscript will be involved. I am guessing PIL or ImageMagic ? > > all sugestions welcome. Did you try to use `reportPM` from

Re: convert pdf to png

2007-12-25 Thread Carl K
Diez B. Roggisch wrote: > Carl K schrieb: >> Grant Edwards wrote: >>> On 2007-12-24, Carl K <[EMAIL PROTECTED]> wrote: >>> > If it is a multi page pdf Imagemagick will do: > > convert file.pdf page-%03d.png I need python code to do this. It is going to be run on a someone els

Re: convert pdf to png

2007-12-25 Thread Carl K
Rob Wolfe wrote: > Carl K <[EMAIL PROTECTED]> writes: > >> I need to take the take the pdf output from reportlab and create a >> preview image for a web page. so png or something. I am sure >> ghostscript will be involved. I am guessing PIL or ImageMagic ? >> >> all sugestions welcome. > > Did

how to generate html table from "table" data?

2007-12-25 Thread petr . jakes . tpc
Hi group, I would like to convert the output of the SQL query, or more generally I would like to convert any "table" data to the html table. I would like to set some rules to format cells, columns or rows (font, colour etc.) of the html table, according to the values in the specific cells. Googl

Re: convert pdf to png

2007-12-25 Thread Grant Edwards
On 2007-12-25, Diez B. Roggisch <[EMAIL PROTECTED]> wrote: > Carl K schrieb: >> Grant Edwards wrote: >>> On 2007-12-24, Carl K <[EMAIL PROTECTED]> wrote: >>> > If it is a multi page pdf Imagemagick will do: > > convert file.pdf page-%03d.png I need python code to do this. It is go

Re: Python DLL in Windows Folder

2007-12-25 Thread Thorsten Kampe
* Stef Mientki (Tue, 25 Dec 2007 11:39:47 +0100) > Another reason "not to put the DLL in win/wys32": > on a lot of computers writing to win/sys32 or even the whole C-drive > is prohibited ! No, definitely not. It's just not allowed for everyone. Thorsten -- http://mail.python.org/mailman/listinf

Re: CPython and a C extension using Boehm GC

2007-12-25 Thread MrJean1
Perhaps, you can pre-load the extension library when Python is invoked. It is probably trying. Pre-loading is commonly done done for memory management and profiling libraries and it may (or may not) work for libraries including the Boehm-GC. And if it does work, call GC_INIT inside the initializa

Re: SWbemObjectEx not found

2007-12-25 Thread kyosohma
On Dec 24, 1:01 pm, jmgmail <[EMAIL PROTECTED]> wrote: > I have a working VBScript and failed to convert it to Python. Can > someone help? > > ==VBScript:== > Set locator = CreateObject("WbemScripting.SWbemLocator") > Set Services = locator.ConnectServer("smsroot1","root/SMS/site_A") > Set instColl

Re: How to detect when a user switches between windows (in WinXP)?

2007-12-25 Thread kyosohma
On Dec 25, 4:31 am, [EMAIL PROTECTED] wrote: > Hi everyone, > > I'm a beginning-to-intermediate Python programmer with some experience > in other languages. At the moment I am trying to write a Python > program that will run in the background and execute a series of > commands whenever I switch bet

ctypes based bindings for ImageMagick

2007-12-25 Thread Achim Domma
I have uploaded a very early alpha version of python bindings for ImageMagick to our blog. ImageMagick is a library to do all kind of image processing. MagickWand is a reduced API to common manipulation tasks like resizing and composing of images. My bindings are a ctypes based wrapper around this

Gluon 1.15 is out

2007-12-25 Thread mdipierro
Hello everybody, Gluon 1.15 is out. This is a free open source framework for agile development of secure database driven web applications, written in Python, programmable in Python. Stable API and supported since October 1st 2007. http://mdp.cti.depaul.edu http://www.vimeo.com/428474 (video tutor

Re: CPython and a C extension using Boehm GC

2007-12-25 Thread MrJean1
Correction. The second line should be ... It is probably worth trying. /Jean Brouwers On Dec 25, 12:19 pm, MrJean1 <[EMAIL PROTECTED]> wrote: > Perhaps, you can pre-load the extension library when Python is > invoked. It is probably trying. > > Pre-loading is commonly done done for memory manage

Re: Pexpect and a Linux Terminal

2007-12-25 Thread prikar20
On Dec 25, 8:42 am, "[EMAIL PROTECTED]" <[EMAIL PROTECTED]> wrote: > On 25 déc, 10:14, "[EMAIL PROTECTED]" <[EMAIL PROTECTED]> wrote: > > > > > On 25 déc, 09:41, "[EMAIL PROTECTED]" <[EMAIL PROTECTED]> wrote: > > > > Yes it's work ! :-D > > > > I use prompt = '.*#' to detect the prompt expect. Tha

Re: list in a tuple

2007-12-25 Thread Steven D'Aprano
On Mon, 24 Dec 2007 18:01:53 -0800, Raymond Hettinger wrote: >> Currently, Python raises an error *and* changes the first element of >> the tuple. Now, this seems like something one would want to change - >> why raise an error *and* execute the thing it was complaining about? > > Yawn. Multiple

Re: OMG please help

2007-12-25 Thread Steven D'Aprano
On Mon, 24 Dec 2007 17:14:58 +0100, Martin P. Hellwig wrote: > As Dennis already pointed out I like to use dictionaries in these cases, > so I would use sand = dict() instead of sands = list() and would do > sand[i] = pygame.image.load(name) > > Then you can retrieve the content by doing sand[you

Re: how to protect directory traversal in mod_python based custom apps

2007-12-25 Thread Graham Dumpleton
On Dec 24, 10:34 pm, "Ravi Kumar" <[EMAIL PROTECTED]> wrote: > hi :) > I was trying to develop a custommod_pythonbased web-site, just > today. the problem I got > though i liked themod_python'sfeature of mapping and calling > functions in python script by parsing the url. > I mean,http://localhost/

Re: OMG please help

2007-12-25 Thread Martin P. Hellwig
Steven D'Aprano wrote: > On Mon, 24 Dec 2007 17:14:58 +0100, Martin P. Hellwig wrote: > >> As Dennis already pointed out I like to use dictionaries in these cases, >> so I would use sand = dict() instead of sands = list() and would do >> sand[i] = pygame.image.load(name) >> >> Then you can retriev

Re: convert pdf to png

2007-12-25 Thread Andrew MacIntyre
Carl K wrote: > Andrew MacIntyre wrote: >> Grant Edwards wrote: >>> On 2007-12-24, Carl K <[EMAIL PROTECTED]> wrote: >>> > If it is a multi page pdf Imagemagick will do: > > convert file.pdf page-%03d.png I need python code to do this. It is going to be run on a someone else'

Re: CPython and a C extension using Boehm GC

2007-12-25 Thread Andrew MacIntyre
malkarouri wrote: > Is it possible to write a Python extension that uses the Boehm garbage > collector? > I have a C library written that makes use of boehm-gc for memory > management. To use that, I have to call GC_INIT() at the start of the > program that uses the library. Now I want to encapsul

Re: very newbie question about exception handling

2007-12-25 Thread Louis . Soninhu
Thanks guys! It worked. Merry Christmas! -- http://mail.python.org/mailman/listinfo/python-list

Python for web...

2007-12-25 Thread thushianthan15
Hi everyone, I have to develop a web based enterprise application for my final year project. Since i am interested in open source, i searched the net. Almost 90% of them were PHP and MySQL. Cant we use python for that ? I tried several sites, but there is not enough tutorial for beginners [mod_py

Re: Python for web...

2007-12-25 Thread gordyt
Howdy Thushanthan, Here is one that is hot off the press: The Definitive Guide to Django: Web Development Done Right http://www.apress.com/book/view/1590597257 --gordon -- http://mail.python.org/mailman/listinfo/python-list

Re: mike lalonde

2007-12-25 Thread wilson . smith9
http://wanderer.artificial-stupidity.net/ On Dec 15, 3:21 am, Michael Lalonde <[EMAIL PROTECTED]> wrote: > Michael Lalonde traveled with Mr Harnwell in an icy cave and went > around killing rats with a jackhammer because his leg hurt and fell > violently ill. Michael Lalonde just dodged three bul

[no subject]

2007-12-25 Thread 8282918521
(FREE Porn, without membership!!! No pop-ups!!! Everythings FREE!!) *future Star* -- http://mail.python.org/mailman/listinfo/python-list

Re: Python for web...

2007-12-25 Thread Matt Nordhoff
[EMAIL PROTECTED] wrote: > Hi everyone, > > I have to develop a web based enterprise application for my final year > project. Since i am interested in open source, i searched the net. > Almost 90% of them were PHP and MySQL. Cant we use python for that ? I > tried several sites, but there is not e