Skip to content

How to run cell containing Python script (within Pluto) #258

Closed
@danvinci

Description

@danvinci

Hi!
Thank you for this package, switching over from PyCall.

I'm using Pluto and I had a cell that had only Python code:

begin
py"""

from package import something

def function pyfun():
    return something()

"""
julia_funWrap = py"pyfun"

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions