initial commit

This commit is contained in:
Mathias Panzenböck
2014-11-21 00:27:42 +01:00
commit 58e11e4efe
3 changed files with 38 additions and 0 deletions
+2
View File
@@ -0,0 +1,2 @@
.*
*~
+27
View File
@@ -0,0 +1,27 @@
#!/usr/bin/python3
import os
import sys
import distutils.spawn
import subprocess
import tempfile
blender = distutils.spawn.find_executable("blender")
tempscript = tempfile.mktemp()+"_blender_ipython.py"
with open(tempscript,"w") as f:
f.write("""\
import sys
sys.argv[:] = [sys.executable]
from IPython.zmq.ipkernel import IPKernelApp
app = IPKernelApp.instance()
app.initialize(%r)
app.start()
""" % sys.argv[1:])
try:
print("starting:", blender, '-b', '-P', tempscript)
sys.exit(subprocess.call([blender, '-b', '-P', tempscript]))
finally:
os.remove(tempscript)
+9
View File
@@ -0,0 +1,9 @@
#!/usr/bin/python3
import sys
from os.path import abspath, dirname, join as pathjoin
from IPython.frontend.html.notebook.notebookapp import launch_new_instance
sys.executable = pathjoin(dirname(abspath(__file__)), 'blender_ipython_kernel.py')
launch_new_instance()