[Tutor] find and replace relative to an nearby search string in a file

2009-07-12 Thread Pete O'Connell
Hi, I am trying to do a find and replace in a text file (a nuke script). Here are a couple excerpts from the file that demonstrate what I want to do. I am always looking for the line " name Write1" as my starting point. In the first example below, I want to replace the path, which is 2 lines above

Re: [Tutor] mac os x executable

2009-07-12 Thread pedro
Hi, the way I do this on mac os x is to use applescript like so. --start of applescript tell application "Terminal" do script "python /Volumes/Seagate750/drive_01/myPythonScript.py" end tell --end of applescript Where you simply point the terminal to the python script using applescri

Re: [Tutor] thesaurus

2009-07-12 Thread Pete Froslie
> > You don't seem to understand functions. Part of the point is to *avoid* > global variables. If everything a function uses is passed in as arguments, > and if everything it produces is returned as return value(s), it's much > easier to see its effect. And to make sure it doesn't have bugs.

Re: [Tutor] thesaurus

2009-07-12 Thread Dave Angel
Pete Froslie wrote: so, I've been playing with the functions a bit-- took a little time to get the hang of them after I started that other mess. Initially, I've done the opposite suggested here by creating functions without the input values. I do see the where it will pay off in re-usability that

Re: [Tutor] segmentation fault

2009-07-12 Thread Alan Gauld
"Rick Pasotto" wrote using daily. Suddenly when I try to run it I get a segmentation fault. I'm running debian testing so probably some recent update caused the breakage. How can I find out what's gone wrong? Have you got the core file? If so you should be able to use gdb to examine the st

Re: [Tutor] thesaurus

2009-07-12 Thread Emile van Sebille
On 7/12/2009 12:01 PM Pete Froslie said... (2)not sure why this function doesn't work: word_count = 0 #set up variable to increment through text def increment(x): return x+1 increment(word_count) You need to capture and assign the result (or possibly restructure to work

Re: [Tutor] thesaurus

2009-07-12 Thread Pete Froslie
so, I've been playing with the functions a bit-- took a little time to get the hang of them after I started that other mess. Initially, I've done the opposite suggested here by creating functions without the input values. I do see the where it will pay off in re-usability that route.. Alan, I'll re

Re: [Tutor] segmentation fault

2009-07-12 Thread Chris Fuller
On Sunday 12 July 2009 11:09, Rick Pasotto wrote: > I've got a script that I wrote several years ago and have been happily > using daily. Suddenly when I try to run it I get a segmentation fault. > > I'm running debian testing so probably some recent update caused the > breakage. How can I find out

Re: [Tutor] segmentation fault

2009-07-12 Thread Rick Pasotto
On Sun, Jul 12, 2009 at 09:54:26AM -0700, Emile van Sebille wrote: > On 7/12/2009 9:09 AM Rick Pasotto said... >> I've got a script that I wrote several years ago and have been happily >> using daily. Suddenly when I try to run it I get a segmentation fault. >> >> I'm running debian testing so prob

Re: [Tutor] segmentation fault

2009-07-12 Thread Emile van Sebille
On 7/12/2009 9:09 AM Rick Pasotto said... I've got a script that I wrote several years ago and have been happily using daily. Suddenly when I try to run it I get a segmentation fault. I'm running debian testing so probably some recent update caused the breakage. How can I find out what's gone wr

[Tutor] segmentation fault

2009-07-12 Thread Rick Pasotto
I've got a script that I wrote several years ago and have been happily using daily. Suddenly when I try to run it I get a segmentation fault. I'm running debian testing so probably some recent update caused the breakage. How can I find out what's gone wrong? -- "Happiness is having a large, lovi

Re: [Tutor] String manipulation: Pig latin translator

2009-07-12 Thread Emile van Sebille
On 7/12/2009 5:52 AM Eike Welk said... This method exploits the fact that not each character combination is a valid English word. But there may be collisions: two different English words that have the same Pig Latin translation. stop -- opstay tops -- opstay Emile _

Re: [Tutor] String manipulation: Pig latin translator

2009-07-12 Thread Eike Welk
Hello Eddie! On Sunday 12 July 2009, Eddie wrote: > Hi guys, > > What I have here is more of a logic problem that I can't get my > head around than a programming problem. I am trying to program an > English to Pig Latin translator. I've got the English to Pig Latin > part down and its working grea

Re: [Tutor] String manipulation: Pig latin translator

2009-07-12 Thread Dave Angel
Eddie wrote: Hi guys, What I have here is more of a logic problem that I can't get my head around than a programming problem. I am trying to program an English to Pig Latin translator. I've got the English to Pig Latin part down and its working great. The part I am having difficulty with is the

[Tutor] String manipulation: Pig latin translator

2009-07-12 Thread Eddie
Hi guys, What I have here is more of a logic problem that I can't get my head around than a programming problem. I am trying to program an English to Pig Latin translator. I've got the English to Pig Latin part down and its working great. The part I am having difficulty with is the Pig Latin to E

Re: [Tutor] thesaurus

2009-07-12 Thread Alan Gauld
"Pete Froslie" wrote This seems the basic form for a function: *def** hello*(): *print* "Hello World!" *return* That is a very limited form that encourages bad practice. The more general form is: def aFunction(inputValue1, inputValue2,...): # do some processing here retu