You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I would like to call a python function only. For this reason I want to add a python file to my julia package containing this function.
I cannot translate this function to julia because it's generating some errors because some components used in cvxpy (the package I'm using), nonetheless it works fine when I use it alone in python. Thus, I want to avoid creating a whole package only for one function, but I need a python script nonetheless.
Any ideas or thoughts?
The text was updated successfully, but these errors were encountered:
silgon
changed the title
Add a file with functions instead of a package.
Add a file with functions instead of importing a package.
Mar 30, 2016
@pyimport can import any Python module including the one you wrote, no need to register a Python package for it, just check out #48. Is that what you're asking about?
I wanted to import a python script created inside the julia project, because I only had a function depending on some python packages. I don't need it anymore because I did another workaround, but it would be maybe interesting to now the answer =)
You should just be able to do pybuiltin("execfile")("myfile.py"). As I understand it, execfile is the Python equivalent of Julia's include, which seems to be what you want.
(For importing a local module, you just need to set the path appropriately, as @cstjean mentioned.)
I would like to call a python function only. For this reason I want to add a python file to my julia package containing this function.
I cannot translate this function to julia because it's generating some errors because some components used in
cvxpy
(the package I'm using), nonetheless it works fine when I use it alone in python. Thus, I want to avoid creating a whole package only for one function, but I need a python script nonetheless.Any ideas or thoughts?
The text was updated successfully, but these errors were encountered: