Skip to content

Implement a pyimport string macro#755

Open
JamesWrigley wants to merge 1 commit intoJuliaPy:mainfrom
JamesWrigley:pyimport-str
Open

Implement a pyimport string macro#755
JamesWrigley wants to merge 1 commit intoJuliaPy:mainfrom
JamesWrigley:pyimport-str

Conversation

@JamesWrigley
Copy link
Contributor

This helps usability by automatically converting Python import statements into their Julia equivalents.

Example from the docs:

pyimport"""
import numpy as np
from scipy import linalg, optimize
from os.path import join as pathjoin
"""

# Converted to:
const np = pyimport("numpy")
const linalg = pyimport("scipy" => "lingalg")
const optimize = pyimport("scipy" => "optimize")
const pathjoin = pyimport("os.path" => "join")

This helps usability by automatically converting Python import statements into
their Julia equivalents.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant