Python Forum
How to import Octave to Python
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
How to import Octave to Python
#1
Greetings for the day,
I am a beginner with Python. I want to import octave in Python.
I want python takes the octave file and show the result in the python window.
Thank You.
Reply
#2
Are you talking about interpreting and executing Octave code by Python or translate octave code to Python code?

Look at oct2py package.

Having an octave file of intermediate complexity, you probably will need to
rewrite it using specific (external) Python libraries (e.g. Numpy, scipy etc.). In very simple cases
, e.g.x=2; y=3; z = x + y, that code could be executed directly by Python (or easily translated to Python).
Reply
#3
(Apr-24-2019, 10:00 AM)scidam Wrote: Are you talking about interpreting and executing Octave code by Python or translate octave code to Python code?

Look at oct2py package.

Having an octave file of intermediate complexity, you probably will need to
rewrite it using specific (external) Python libraries (e.g. Numpy, scipy etc.). In very simple cases
, e.g.x=2; y=3; z = x + y, that code could be executed directly by Python (or easily translated to Python).

Thank you for your reply.
I want to execute octave code in Python and results were shown in the Python window.
I have gone through the link given by you and download the latest version of oct2py. But I am not able to understand what to do with that file. I am a Windows user.
From where I can get the Python libraries (numpy and scipy)?
Is there any other library needed to import octave to python?
Reply
#4
Greetings for the day.
I have successfully imported octave in Python and now I am able to execute my Octave program through python.

Following steps are needed to be done:
1) Install Numpy with command 'pip install numpy'
2) Install Scipy with command 'pip install scipy'
3) Install oct2py with command 'pip install oct2py'
4) Set the path of the octave if needed with command setx path "path of octave;

Thank You.
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  wordpress-python-xmlrpc. I can import 1 file. How do I import the entire folder? SamLearnsPython 0 3,279 Jul-05-2018, 06:21 AM
Last Post: SamLearnsPython

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020