New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
False AttributeError. #164
Comments
The dict has an I think the problem here may be that the conversion to a Julia nbf = pyimport("IPython.nbformat.current")
nb = pycall(nbf["new_notebook"], PyDict) or even |
@stevengj I did what you told me, but now in this part: fname = "test.ipynb"
open(fname, "w") do f
nbf[:write](nb, f, "ipynb")
end I have this error: PyError (:PyObject_Call) <type 'exceptions.TypeError'>
TypeError("'unicode' does not have the buffer interface",)
File "/usr/local/lib/python2.7/dist-packages/IPython/nbformat/current.py", line 191, in write
return fp.write(s)
while loading In[6], in expression starting on line 3
in pyerr_check at /home/juser/.julia/v0.3/PyCall/src/exception.jl:58
in pycall at /home/juser/.julia/v0.3/PyCall/src/PyCall.jl:91
in fn at /home/juser/.julia/v0.3/PyCall/src/conversions.jl:188
in anonymous at In[6]:4
in open at iostream.jl:137 I don't know hot to convert an function PyCall.PyObject(s::ASCIIString)
PyCall.@pyinitialize
PyObject(PyCall.@pycheckn ccall(pystring_fromstring,
PyPtr, (Ptr{Uint8},), bytestring(s)))
end but then I get: PyObject(ascii("test"))
s not defined
while loading In[15], in expression starting on line 1
in PyObject at In[12]:88 I haven't been able to figure out why. |
@Ismael-VC I checked the python source and AFAICT the issue is not passing a bytestring to python, rather python is passing a string (unicode) to julia and julia don't know how to write it to the file object. My working example here Also note that the interface is deprecated (You can see the deprecation warning from a ipython notebook) and AFAICT it is encouraged to specify the version of the notebook format directly. |
Also, to convert a python |
I was trying to answer this question at StackOverflow:
So I try to use
PyCall
:And I get this error at
Out [7]
:But the dictionary in question indeed does have a
worksheets
key, as can be seen atOut [8]
.The text was updated successfully, but these errors were encountered: