PDA

View Full Version : Matlab like Python editor




saberahul
Feb 25, 2013, 08:50 PM
I'll admit I have no idea what I'm talking about when it comes to Python but it seems to be similar to Matlab - which I know well. I'm mainly looking for a single app where I can type in some code (in Python, and free) and press some button or keyboard command to run it.

In other words, any apps (far better looking) than Terminal where I can type 4 + 4 [enter] and get 8?

Thanks!



mobilehaathi
Feb 25, 2013, 08:52 PM
Open a terminal and type python

saberahul
Feb 25, 2013, 08:53 PM
Open a terminal and type python

Thanks. I'm aware I can do that but am looking for a 3rd party app with lots of pretty buttons and a pretty UI. Anything like this exist?

mobilehaathi
Feb 25, 2013, 08:54 PM
Thanks. I'm aware I can do that but am looking for a 3rd party app with lots of pretty buttons and a pretty UI. Anything like this exist?

Try http://www.sagemath.org/ and see if there are GUI add-ons...

Ap0ks
Feb 26, 2013, 04:19 AM
You could try any of the following: http://en.wikipedia.org/wiki/List_of_integrated_development_environments_for_Python#Python

8.33
Feb 26, 2013, 05:39 AM
Spyder (https://code.google.com/p/spyderlib/) may be worth a try. I have tried it before, but it was a bit flakey at the time. May have improved now.

Edit: tried it on Windows where getting python to work is a nightmare. Mac may be happier.

telecomm
Feb 26, 2013, 02:30 PM
Try http://www.sagemath.org/ and see if there are GUI add-ons...

I'd also suggest having a look at Sage.

Sage might work if you like the notebook view, once you've got sage running type notebook() in the command line and it'll open up your web browser where you can essentially type commands in directly (though it's a bit limited if you're looking to do much Python coding, it's handy if you want to do lots of math).

Edit: oh, and to close the notebook view, go back to the terminal window any type control+c to end the notebook, then control+d to exit sage completely... the documentation for Sage is one of the weak points, and it took me a while to figure this out. :o

balamw
Feb 26, 2013, 02:33 PM
Sage looks interesting. May I ask why Python? If you want something Matlab like and free, why not GNU Octave (http://www.gnu.org/software/octave/)?

B

estorstenson
Feb 26, 2013, 02:48 PM
I think what you are looking for is: http://matplotlib.org/ You'll want to get iPython, numpy and possibly scipy, but there are a few distributions that package up numerical oriented packages together, and they'll usually have these together. One (non-free, depending on your situation) is http://www.enthought.com/products/epd.php. It's free for students and academics. There are probably quite a few others as well, and it's usually easy enough to install the components you need, too, if you are somewhat familiar with the command line.

saberahul
Feb 26, 2013, 05:38 PM
Sage looks interesting. May I ask why Python? If you want something Matlab like and free, why not GNU Octave (http://www.gnu.org/software/octave/)?

B

Looking to learn a new language with Python. Matlab is good but not as universal - for example, I cannot use it on my iPhone without running Matlab on my computer which is a very expensive product.

kaydell.leavitt
Feb 26, 2013, 11:36 PM
I edit Python using BBEdit. BBEdit has a good Mac GUI and is full-feaured including being able to view invisible tabs and spaces which can be important when working with Python text files to keep the indentation consistent.

BBEdit also has a feature called "Zap Gremlins" that you can use to eliminate bad characters from your source code.

It also has a feature to be able to compare source files and even whole directories so that you can see the differences between versions.

And BBEdit allows you to run source code, including Python, from BBEdit without leaving it.

BBEdit doesn't have a command line. But if you really need to work interactively on occasion, you can go to Terminal and type in "python".

If you don't want to use BBEdit, there is a version of IDLE that runs on Mac OS X that has both an editor and a window with an interactive mode. I don't like IDLE because when I first tried it, I chose "Preferenes" from the Apple menu and it crashed. So, I lost my confidence in it.

You can google for "BBEdit Download" or "Python Mac IDLE Download" and find these products.

If you want something like BBEdit, nearly as good, but free. There is TextWrangler. You can find that by googling for "Text Wrangler Download".

macjram
Feb 26, 2013, 11:40 PM
Sublime Text 2

You can run your python code on it (to some extent) and it has a shell. It's free trial kind of lasts forever, just say no to when it asks you to purchase.

I love it.

estorstenson
Feb 27, 2013, 10:03 AM
If you aren't actually looking for Matlab's graphing functionality, you might look at ipython's HTML Notebook. It gives you an interactive shell that you can record your sessions and then access them remotely (assuming you can reach your machine via a web browser@some random port). It's still very much a command line oriented tool, but it has some interesting features: http://ipython.org/ipython-doc/dev/interactive/htmlnotebook.html

There are several IDEs that support python, but they don't necessarily offer you a shell that is much different than the standard interactive Python shell. iPython is probably the best, and does integrate nicely with Matplotlib for graphing things as you explore your data.

balamw
Feb 27, 2013, 10:28 AM
I cannot use it on my iPhone without running Matlab on my computer which is a very expensive product.

FWIW the latest versions of the iOS app give you "MATLAB in the cloud (http://www.mathworks.com/mobile/connect-to-cloud.html)" functionality if you have a license under maintenance. It's definitely not cheap, but for what I use it for it's worth every penny.

There are also similar apps for octave. i.e. cheaper. I haven't used either.

e.g.

https://itunes.apple.com/us/app/octave-cloud/id508953667?mt=8
https://itunes.apple.com/us/app/octave-remote/id467653632?mt=8


There are several IDEs that support python, but they don't necessarily offer you a shell that is much different than the standard interactive Python shell.

I spent some time looking at the iOS options since that seems to be a bit of a driver for the OP and found this generally to be true there too.

Of the ones I did find, Pythonista (http://omz-software.com/pythonista/) seems to be the most full featured, and might well be worth the $5.

B

telecomm
Feb 27, 2013, 12:06 PM
As always, there are Sage alternatives as well, check out

https://itunes.apple.com/ca/app/sage-math/id496492945?mt=8

which is basically a front end for the Sage online notebook. (Incidentally, I've been using the facility of developing interactive mathematics activities using the Sage Cell Server (http://www.sagemath.org/eval.html), and it's proven really useful, as Sage interactive content can be embedded directly into a webpage - no flash, no java.)

Sage incorporates mathplotlib, Octave, R, Maxima, NumPy, SciPy, etc., so it's really the one to beat. ;)

saberahul
Feb 27, 2013, 07:07 PM
FWIW the latest versions of the iOS app give you "MATLAB in the cloud (http://www.mathworks.com/mobile/connect-to-cloud.html)" functionality if you have a license under maintenance. It's definitely not cheap, but for what I use it for it's worth every penny.

There are also similar apps for octave. i.e. cheaper. I haven't used either.

e.g.

https://itunes.apple.com/us/app/octave-cloud/id508953667?mt=8
https://itunes.apple.com/us/app/octave-remote/id467653632?mt=8



I spent some time looking at the iOS options since that seems to be a bit of a driver for the OP and found this generally to be true there too.

Of the ones I did find, Pythonista (http://omz-software.com/pythonista/) seems to be the most full featured, and might well be worth the $5.

B

Yup, Pythonista is the one I'm looking for (now if I could only find something as nice looking and feature filled on the Mac). Love the interactive screen where I can do simple calcs on the go. Thanks!

msjones
Feb 28, 2013, 05:27 AM
I use CodeRunner (https://itunes.apple.com/us/app/coderunner/id433335799?mt=12). It has a small price tag but the application is pretty good.

saberahul
Feb 28, 2013, 05:44 PM
So did a lot of research and came across R64. Did more research and came across RStudio. These apps are awesome! They aren't python but they definitely replace Matlab and look great too (RStudio does).

mobilehaathi
Feb 28, 2013, 10:29 PM
So did a lot of research and came across R64. Did more research and came across RStudio. These apps are awesome! They aren't python but they definitely replace Matlab and look great too (RStudio does).

R certainly doesn't replace Matlab for much outside of statistics...

Although if it satisfies your needs, great!