[Tutor] help with running perl script that writes to a text file

Alan Gauld alan.gauld at btinternet.com
Wed Feb 6 01:52:46 CET 2013


On 05/02/13 23:44, 3n2 Solutions wrote:

> I want to automate the following manual process from DOS promp:
>
> c:/scripts/perl>perl fix.pl base.gtx >base.txt

Use a DOS batch file, that's what they are there for.

If you are not doing any other processing Python is inefficient and 
overkill for this task. Unless you just want to learn how to use Popen I 
suppose...


> path="c:/scripts/perl/"
> subprocess.call(['perl','fix.pl','base.gtx >base.txt',path])

Do you get any error messages on the console?
How are you running the python script?

-- 
Alan G
Author of the Learn to Program web site
http://www.alan-g.me.uk/



More information about the Tutor mailing list