Comments (3)
@fperez, how am I supposed to call the _repr_foo_
methods to get the corresponding data? I did:
using PyCall
@pyimport IPython.display as d
image = d.Image(url="http://127.0.0.1:8998/static/base/images/ipynblogo.png")
and then image[:_repr_png_]()
, but it returns nothing
(i.e. Python None
). The same thing happens in ipython
with
import IPython.display as d
image = d.Image(url="http://127.0.0.1:8998/static/base/images/ipynblogo.png")
image._repr_png_()
What am I doing wrong?
from pycall.jl.
Sorry, since that particular image comes from a remote URL, it is being rendered via html:
image._repr_html_()
produces
u'<img src="http://127.0.0.1:8888/static/base/images/ipynblogo.png"/>'
If you had an image coming from a file, it would then call _repr_png_
:
In [1]: from IPython.display import Image
In [2]: a=Image('logo/logo.png')
In [3]: a._repr_png_()[:20] # just show the first 20 characters
Out[3]: '\x89PNG\r\n\x1a\n\x00\x00\x00\rIHDR\x00\x00\x02\x08'
from pycall.jl.
Ah, great. display("text/html", image[:_repr_html_]())
works in IJulia.
from pycall.jl.
Related Issues (20)
- notable startup latency HOT 3
- How to detect if Python object is class/function/property
- Incompatible with PythonCall.jl HOT 5
- Pkg.build("PyCall"), json.decoder.JSONDecodeError: Extra data
- ERROR: LoadError: syntax: invalid interpolation syntax: "$\"
- the ENV["PYTHON"]="path/to/python.exe" not work for python3.12.0 HOT 4
- LoadError: Couldn't find libpython while building PyCall HOT 5
- PyCall 1.96.2 breaks tests at Imbalance.jl HOT 5
- Error on building 'PyCall' argument not expected: --satisfied-skip-solve HOT 1
- buildutils.jl broken on Python 3.12 HOT 1
- Remove support for Python <=3.7
- Reproducible garbage collection-related segfaults on Python 3.12 HOT 3
- How can I use rospy through PyCall directly? HOT 1
- julia-1.10.0 _Py_DECREF segmentation faults (not present in 1.9.3)
- `Segmentation fault(core dumped)` when using multiple threads
- REPL crashes when importing pyvista objects
- Howto - Python yield statement HOT 1
- Segmentation fault ( Pycall [BUG] Segmentation fault at 0x0000000000000010 )
- Exception: EXCEPTION_ACCESS_VIOLATION at 0x7ffb1b1b0286 -- PyObject_Free
- build.jl is broken with mamba as conda provider HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from pycall.jl.