Python scripts in TextPipe?

Get help with installation and running here.

Moderators: DataMystic Support, Moderators, DataMystic Support, Moderators, DataMystic Support, Moderators

Post Reply
dfhtextpipe
Posts: 988
Joined: Sun Dec 09, 2007 2:49 am
Location: UK

Python scripts in TextPipe?

Post by dfhtextpipe »

Can one use Python scripts within the TextPipe scripts filter?

cf. Currently, the two choices offered in the drop-down are VBScript and JScript.

Yet the contextual help lists, "VBScript, JScript, VBA, PerlScript, Python, Lisp, REXX etc."

Moreover, it goes on to say, "The script language to use. Default values are VBScript, JScript and VBA, but you can download and install others (they will not appear in the list - you must enter them manually)."

btw. If VBA is one of the default values, why is it absent from the dropdown selector?

If so, is there a template for the required IO functions for Python?

Are there any examples available?

David
David
User avatar
DataMystic Support
Site Admin
Posts: 2227
Joined: Mon Jun 30, 2003 12:32 pm
Location: Melbourne, Australia
Contact:

Re: Python scripts in TextPipe?

Post by DataMystic Support »

Sorry, VBA is not a default - the help has now been updated.

We're not experts in those other languages, so we don't have any samples available - but we'd be happy to include them if a contribution was available.

Below are the 5 functions that TextPipe requires, with documentation.

Code: Select all

'Called for every line in the file
'EOL contains the end of line characters (Unix, DOS or Mac) that must be
'appended to each line
function processLine(line, EOL)
  processLine = line & EOL
end function


'Called at the start of a processing job -
'perform one-time initialisation here
sub startJob()
  'do nothing
end sub


'Called at the end of a processing job -
'destroy any declared objects here
sub endJob()
  'do nothing
end sub


'Called before each file is opened -
'perform per-file initialisation here
function startFile()
  startFile = ""
end function


'Called before each file is closed -
'flush all pending file output here
function endFile()
  endFile = ""
end function
dfhtextpipe
Posts: 988
Joined: Sun Dec 09, 2007 2:49 am
Location: UK

Re: Python scripts in TextPipe?

Post by dfhtextpipe »

The help was not updated! It still says,
The script language to use. Default values are VBScript, JScript and VBA, but you can download and install others (they will not appear in the list - you must enter them manually). TextPipe will display an error message if the language you specified is not installed. You can download the Microsoft VBScript and JScript engines and reference documentation from the Microsoft web site at http://msdn.microsoft.com/scripting/default.htm
David
David
User avatar
DataMystic Support
Site Admin
Posts: 2227
Joined: Mon Jun 30, 2003 12:32 pm
Location: Melbourne, Australia
Contact:

Re: Python scripts in TextPipe?

Post by DataMystic Support »

Thanks - updated.
Post Reply