Re: [Tutor] using lists as values for key in dictionary?

2008-10-14 Thread Marc Tompkins
Dictionary keys must be immutable - in other words, they must be objects that aren't allowed to change. Lists can change, so the answer is no. However, tuples are immutable, so if you turn your list into a tuple (I can never remember, is that a cast or a coercion?), you can use it as a dictionary

Re: [Tutor] using lists as values for key in dictionary?

2008-10-14 Thread Rajeev Nair
hi. Is it possible to use and how to acess it? regards rajeev ___ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor

[Tutor] Use Regular Expressions

2008-10-14 Thread Basil B Thoppil
Hi everyone, I am using the cPAMIE library for automation of websites. It has a function findTextbox(name) , which takes the name(a string) of the text box and searches for it and return True if it exists. Now I dont have a static name and so I wanted to use regular expression. I cannot pass regul

[Tutor] Looking for Clues to Make a Program Produce avi Files Instead ...

2008-10-14 Thread Wayne Watson
Title: Signature.html ... of mov files. (See Subject). Our meteor software program uses a py program to produce a movie from images taken by an all-sky camera. The frames are in a simple but different format than likely used anywhere else. From these, it produces a mov file. As I understand it,

Re: [Tutor] Edit a Word document programmatically

2008-10-14 Thread Mark Tolonen
These two lines connect to Word. The EnsureDispatch makes sure Word constants work later: >>> import win32com.client >>> word = win32com.client.gencache.EnsureDispatch('Word.Application') Then record a Word macro to do what you want (this was a find/replace all): Selection.Find.ClearFormat

Re: [Tutor] Edit a Word document programmatically CORRECTION Open not open

2008-10-14 Thread bob gailer
Alan Gauld wrote: "bob gailer" <[EMAIL PROTECTED]> wrote docOrig = app.Documents.Open('n:\\MetroPlanners\\2006\\MCHResearchProject.doc') range = docOrig.Content() Try range = docOrig.Range() But don't use range as a variable name or you will hide the builtin function range(). And

Re: [Tutor] Edit a Word document programmatically CORRECTION Open not open

2008-10-14 Thread Alan Gauld
"bob gailer" <[EMAIL PROTECTED]> wrote docOrig = app.Documents.Open('n:\\MetroPlanners\\2006\\MCHResearchProject.doc') range = docOrig.Content() Try range = docOrig.Range() But don't use range as a variable name or you will hide the builtin function range(). And that will make many

[Tutor] Learning to extract information from ABAQUS .dat and .rpt files using Python

2008-10-14 Thread Telmo Andres Sanchez
Hello folks, This is something that must have been asked several times. I want to post process data obtained after running a FEM in ABAQUS. The requested results are usually printed to the .dat file or .rpt file. I would like to learn how to extract the information that I need (i.e. displacements

Re: [Tutor] Edit a Word document programmatically CORRECTION Open not open

2008-10-14 Thread bob gailer
Marc Tompkins wrote: On Tue, Oct 14, 2008 at 9:23 AM, URBAN LANDREMAN <[EMAIL PROTECTED] > wrote: Thanks for the suggestion. When I ran the slightly modified code: import win32com.client app = win32com.client.Dispatch('Word.Application') docOrig =

Re: [Tutor] Edit a Word document programmatically CORRECTION Open not open

2008-10-14 Thread Marc Tompkins
On Tue, Oct 14, 2008 at 9:23 AM, URBAN LANDREMAN <[EMAIL PROTECTED]> wrote: > Thanks for the suggestion. > > When I ran the slightly modified code: > import win32com.client > app = win32com.client.Dispatch('Word.Application') > docOrig = > app.Documents.Open('n:\\MetroPlanners\\2006\\MCHResearchPr

Re: [Tutor] Edit a Word document programmatically CORRECTION Open not open

2008-10-14 Thread URBAN LANDREMAN
Thanks for the suggestion. When I ran the slightly modified code: import win32com.client app = win32com.client.Dispatch('Word.Application') docOrig = app.Documents.Open('n:\\MetroPlanners\\2006\\MCHResearchProject.doc') range = docOrig.Content() range.Find.Text = "e" range.Find.Replacement.Text =

[Tutor] twill module

2008-10-14 Thread heinrich . massmann
Hi all, I'm new to this list (and python ;-)) and working on a small personal project. I'm basically using the twill to browse a website (weather reports) and do a re search for a specific string that once found, needs to be printed in a web page on it's own. The problem I found with twill is th

Re: [Tutor] Edit a Word document programmatically CORRECTION Open not open

2008-10-14 Thread bob gailer
bob gailer wrote: Brian C. Lane wrote: -BEGIN PGP SIGNED MESSAGE- Hash: SHA1 URBAN LANDREMAN wrote: Good morning, I'm trying to write some Python code to programmatically do a Find and Replace of a string within a Microsoft Word document. Any suggestions on wh

Re: [Tutor] Edit a Word document programmatically

2008-10-14 Thread bob gailer
Brian C. Lane wrote: -BEGIN PGP SIGNED MESSAGE- Hash: SHA1 URBAN LANDREMAN wrote: Good morning, I'm trying to write some Python code to programmatically do a Find and Replace of a string within a Microsoft Word document. Any suggestions on where I could look to find how t

Re: [Tutor] Edit a Word document programmatically

2008-10-14 Thread Brian C. Lane
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 URBAN LANDREMAN wrote: > Good morning, > > I'm trying to write some Python code to programmatically do a Find and > Replace of a string within a Microsoft Word document. > Any suggestions on where I could look to find how to do such a function? > Ta

[Tutor] Fwd: Technical aspect of os.path.isfile()

2008-10-14 Thread Luke Paireepinart
Oops, replied off-list accidentally. -- Forwarded message -- From: Luke Paireepinart <[EMAIL PROTECTED]> Date: Tue, Oct 14, 2008 at 9:10 AM Subject: Re: [Tutor] Technical aspect of os.path.isfile() To: W W <[EMAIL PROTECTED]> File renames are much faster than file copies. So ju

[Tutor] Edit a Word document programmatically

2008-10-14 Thread URBAN LANDREMAN
Good morning, I'm trying to write some Python code to programmatically do a Find and Replace of a string within a Microsoft Word document. Any suggestions on where I could look to find how to do such a function? Thank you. Urban Landreman ___ Tutor

[Tutor] Technical aspect of os.path.isfile()

2008-10-14 Thread W W
I suppose this is really more of a technical aspect, dealing with the possibility of a race condition (although in my personal case, the probability is infinitely small). I'm writing a program that uses the ConfigParser module to open a config file, and if that file isn't present, I'd like to crea