Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Python > [NEWBIE] How to call an external program

Reply
Thread Tools

[NEWBIE] How to call an external program

 
 
Philipp Neuhaus
Guest
Posts: n/a
 
      09-18-2003
Hi,
I want to convert an image file, so I have to call an external
program.
How can I do this?

(i want to call "sfftobmp -tifs input tempfile" and "tiff2ps tempfile*
| ps2pdf [output]")

Philipp
 
Reply With Quote
 
 
 
 
Ulrich Petri
Guest
Posts: n/a
 
      09-18-2003
"Philipp Neuhaus" <mailto(E-Mail Removed)> schrieb im
Newsbeitrag news:(E-Mail Removed)...
> Hi,
> I want to convert an image file, so I have to call an external
> program.
> How can I do this?
>
> (i want to call "sfftobmp -tifs input tempfile" and "tiff2ps tempfile*
> | ps2pdf [output]")
>


-----code---cut here----
import os

def convertImage(infile, outfile):
os.system('sfftobmp -tifs %s tempfile' % infile)
os.system('tiff2ps tempfile* | ps2pdf %s' % outfile)

convertImage('/home/user/in.tif', '/home/user/out.pdf')
-----code---cut here----

HTH

Ciao Ulrich


 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Re: How include a large array? Edward A. Falk C Programming 1 04-04-2013 08:07 PM
How to call external c++ program guest7 C++ 0 01-04-2009 06:07 PM
call an external c++ program Deb.Fang@gmail.com Perl Misc 8 06-19-2006 09:12 PM
how to call an external program? Sanyi Benczik C++ 10 12-16-2003 01:34 PM
How to call an external program (with parameters) and receive its exit notification? Tobias Merler Java 0 09-24-2003 09:37 PM



Advertisments