The old-fashioned way to do what Yaroslav suggested is to simply call the kernel ( math ) using a script switch, for example math -script graph.m . Where graph.m either pre-engineered, or loads a csv file, or is created on the fly by your python program.
May I ask why you want to use Mathematica to create a graph? There are many python utilities (and others) that will do this for you. Many options are presented here: chart overview .
source share