Inkscape Python
最終更新日16 May 2015 06:18
読むライブラリ
/Applications/Inkscape.app/Contents/Resources/extensions',
'/Applications/Inkscape.app/Contents/Resources/python/site-packages/i386/2.7',
あらかじめ入っている便利モジュール
/Applications/Inkscape.app/Contents/Resources/extensions
以下にあるものは
sys.path.append("/Applications/Inkscape.app/Contents/Resources/extensions")
と書いておけばそれ以降の行でimportすることができます
- cubicsuperpath
- simplepath
- cspsubdiv
- simplestyle
- from subprocess import Popen, PIPE
- voronoi
- bezmisc
- pathmodifier
- simpletransform
- voronoi2svg
- from future import division
- from numpy import matrix
/Applications/Inkscape.app/Contents/Resources/python/site-packages/i386/2.7
この下にPILもは行ってる
書き方の注意!
xml.etreeやPILは予め入っているので、自分からわざわざインストールして使おうとすると謎のエラーに陥ります。次のように置き換えて使います
一般的なpython | Inkscape Extention内での書き方 |
---|---|
xml.etree. | inkex.etree |
PyCharmで開発する場合
import inkexを有効にするには
Preference >Project:プロジェクト名 > Project Structure > Add Content Root
で
/Applications/Inkscape.app/Contents/Resources/extensions
を加えましょう(Macの場合)