Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

saberahul

macrumors 68040
Original poster
Nov 6, 2008
3,645
111
USA
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!
 

8.33

macrumors newbie
Aug 17, 2011
25
0
Spyder 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

macrumors 65816
Nov 30, 2003
1,387
28
Rome
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
Code:
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. :eek:
 

estorstenson

macrumors member
Jan 30, 2013
38
3
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

macrumors 68040
Original poster
Nov 6, 2008
3,645
111
USA
Sage looks interesting. May I ask why Python? If you want something Matlab like and free, why not GNU 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

macrumors regular
Apr 19, 2010
100
0
Using BBEdit With Python

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

macrumors 6502a
Dec 20, 2008
574
3
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

macrumors member
Jan 30, 2013
38
3
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

Moderator emeritus
Aug 16, 2005
19,366
979
New England
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" 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 seems to be the most full featured, and might well be worth the $5.

B
 

telecomm

macrumors 65816
Nov 30, 2003
1,387
28
Rome
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, 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

macrumors 68040
Original poster
Nov 6, 2008
3,645
111
USA
FWIW the latest versions of the iOS app give you "MATLAB in the cloud" 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 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!
 

saberahul

macrumors 68040
Original poster
Nov 6, 2008
3,645
111
USA
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

macrumors G3
Aug 19, 2008
9,368
6,352
The Anthropocene
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!
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.