-
Notifications
You must be signed in to change notification settings - Fork 62
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
How to run cell containing Python script (within Pluto) #258
Comments
Update Also: realized only later Discussions were enabled, this shouldn't be an issue. It would still be interesting to know if is possible to run entire Python scripts residing in a cell (not an external script.py), the documentation wasn't explicit about this. |
It's possibly a bit buried, but there are functions https://cjdoris.github.io/PythonCall.jl/stable/pythoncall-reference/#PythonCall.@pyexec Your example using PyCall can be rewritten using PythonCall as @pyexec """
from package import something
global pyfun
def function pyfun():
return something()
"""
julia_funWrap = @pyeval "pyfun" You need |
Thank you!! |
Hi!
Thank you for this package, switching over from PyCall.
I'm using Pluto and I had a cell that had only Python code:
This would allow me to define several helper functions (that call other functions) all in Python, and then wrap those functions so that I can call them from Julia when needed.
Is it possible to do something similar in PythonCall?
I have a script that I'd like to reuse, the alternative being writing Julia helper functions instead, wrapping the inner calls, as well as prepare the necessary inputs so that they can be passed.
This example seems to point instead towards writing "hybrid" Python/Julia code:
https://discourse.julialang.org/t/passing-parameters-to-a-python-function-via-pycall-that-need-to-be-in-a-dict-form/84691/4
The text was updated successfully, but these errors were encountered: