Quite a simple question here. I want to import webkit2png into another script, but I can’t get it to work.
import feedparser, webkit2png
d = feedparser.parse('http://example.com/rss')
link = d.entries[0].link
title = d.entries[0].title
webkit2png link
This gives me a syntax error on line 5. What do I do wrong?
File "example.py", line 5
webkit2png link
^
SyntaxError: invalid syntax
webkit2pngseems to only have a command line interface, so importing the module won’t help much, unless you try to replicate the code that is issued in themainfunction inwebkit2png.I’d suggest to use the
subprocessmodule to call the file directly, e.g.In case the
webkit2png.pyis in the same directory of your script, replace thesubprocess.callwith