I am using Python on Mac OSX Leopard.
I am trying to run the program 'dot' (part of Graphviz) from Python:
# -*- coding: utf-8 -*-
import os
print os.environ['PATH']
print os.system("ls >> a.txt")
print os.system("dot -o9.png -Tpng ./6.dot")
The command "ls" is there just to make sure that python is in the correct directory. It is. The result that I get is:
/usr/bin:/bin:/usr/sbin:/sbin 0 32512
My understanding is that 32512 error means that python could not find the file, and since the file 6.dot is there (If I run "dot -o9.png -Tpng ./6.dot" from the terminal I receive no error, and 9.png gets produced), I assume Python can't find the dot file.
I probably need to add the dot file to the path. But I don't know where is it. If I run:
whereis dot
I receive no answer.
How can I find the dot executable?
Alternatively, can I run the dot program as a command from inside Python?