3 ms·
A quote from the article: "Install this bad boy with the simple command sudo apt-get install python ..." Two things: 1. Fedora and related distribution users
by lutusp 14y ago
A quote from the article: "Install this bad boy with the simple command sudo apt-get install python ..."
Two things:
1. Fedora and related distribution users will want to say "yum -y install python" instead.
2. But it's hard to imagine a distribution that doesn't have Python installed by default, because so many Linux system utilities are written in Python.
Another quote: "Alternatively, you can just start hacking away and use StackOverflow to fill in any of the gaps in your knowledge."
Yes, good suggestion, but there's always the searchable online Python documentation:
http://www.python.org/doc/ http://www.python.org/doc/
And if you're offline for any amount of time, the documentation can be downloaded:
http://docs.python.org/download.html http://docs.python.org/download.html (2.x)
http://docs.python.org/py3k/download.html http://docs.python.org/py3k/download.html (3.x)
Python has some amazing libraries -- even symbolic algebra (what Mathematica does):
from sympy import *
x,a,b,c = var('x a b c')
pprint(solve(a * x**2 + b * x + c,x), use_unicode=False)
The result:
_____________ / _____________\
/ 2 | / 2 |
-b + \/ -4*a*c + b -\b + \/ -4*a*c + b /
[---------------------, -----------------------]
2*a 2*a
The Unicode output is, of course, much nicer:
http://i.imgur.com/fR7qO.png http://i.imgur.com/fR7qO.png
- icebraining 14y agoYou can actually paste the Unicode output here: ⎡ ⎽⎽⎽⎽⎽⎽⎽⎽⎽⎽⎽⎽⎽ ⎛ ⎽⎽⎽⎽⎽⎽⎽⎽⎽⎽⎽⎽⎽⎞⎤ ⎢ ╱ 2 ⎜ ╱ 2 ⎟⎥ ⎢-b + ╲╱ -4⋅a⋅c + b -⎝b + ╲╱ -4⋅a⋅c + b ⎠⎥ ⎢─────────────────────, ───────────────────────⎥ ⎣ 2⋅a 2⋅a ⎦
- TobbenTM 14y agoWell... http://i.imgur.com/Rxh63.png http://i.imgur.com/Rxh63.png
- freehunter 14y agoThat's interesting, it shows up perfectly for me in the comment (latest Firefox, Ubuntu 12.04).
- chmike 14y agoNot on the iPad :(
- icebraining 14y agoYour browser's monospace font isn't monospace. You should choose a different one.
- sp332 14y agoIf the monospace font doesn't support those characters, maybe the browser fell back to a non-monospace font.
- icebraining 14y agoNo, if you look at the ASCII version posted above, it's distorted too (the big parenthesis are wrong, for example).
- lutusp 14y agoYes, I see the problem -- I assumed that other browsers were using a monospace font for the HN monospace-markup sections. This isn't always the case. Even my rendering in Google Chrome on Linux isn't perfect.
- muyuu 14y agoYou can, but most people will see little boxes all over the place.
- icebraining 14y agoTrue, but in my opinion they should install fonts with decent unicode support anyway.
- crisnoble 14y agoAnd how would one go about doing that on an iPhone?
- takluyver 14y agoAnd Sympy's output in the IPython notebook is even nicer: http://i.imgur.com/ldfLd.png http://i.imgur.com/ldfLd.png To enable that, run: %load_ext sympyprinting
- thronemonkey 14y agoholy shit, did not know about this. This was really the one thing from Mathematica that I was still missing in iPython. Thank you!
- hntester123 14y agoThough your comment was not in reply to me, thanks for the above info. I knew about IPython but not about the IPython Notebook or the QtConsole. I just googled for IPython notebook and read some of that info, but can you give an example or two of what that style of working is useful for? Is it good for exploratory stuff?