News for hackers. Stuff that matters.
Re:Python Development on Linux and Why You Should Too by lutusp on Wednesday September 05, 2012 @05:56AM (#4478661)
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/

And if you're offline for any amount of time, the documentation can be downloaded:

http://docs.python.org/download.html (2.x)

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

Re:Python Development on Linux and Why You Should Too by takluyver on Wednesday September 05, 2012 @06:44AM (#4478763)
And Sympy's output in the IPython notebook is even nicer: http://i.imgur.com/ldfLd.png

To enable that, run:

  %load_ext sympyprinting
Re:Python Development on Linux and Why You Should Too by thronemonkey on Wednesday September 05, 2012 @10:56AM (#4479626)
holy shit, did not know about this. This was really the one thing from Mathematica that I was still missing in iPython. Thank you!
Re:Python Development on Linux and Why You Should Too by icebraining on Wednesday September 05, 2012 @06:39AM (#4478749)
You can actually paste the Unicode output here:

  ⎡        ⎽⎽⎽⎽⎽⎽⎽⎽⎽⎽⎽⎽⎽   ⎛       ⎽⎽⎽⎽⎽⎽⎽⎽⎽⎽⎽⎽⎽⎞⎤
  ⎢       ╱           2    ⎜      ╱           2 ⎟⎥
  ⎢-b + ╲╱  -4⋅a⋅c + b    -⎝b + ╲╱  -4⋅a⋅c + b  ⎠⎥
  ⎢─────────────────────, ───────────────────────⎥
  ⎣         2⋅a                     2⋅a          ⎦
Re:Python Development on Linux and Why You Should Too by TobbenTM on Wednesday September 05, 2012 @08:51AM (#4479083)
Re:Python Development on Linux and Why You Should Too by freehunter on Wednesday September 05, 2012 @09:21AM (#4479194)
That's interesting, it shows up perfectly for me in the comment (latest Firefox, Ubuntu 12.04).
Re:Python Development on Linux and Why You Should Too by chmike on Wednesday September 05, 2012 @10:29AM (#4479507)
Not on the iPad :(
Re:Python Development on Linux and Why You Should Too by lutusp on Wednesday September 05, 2012 @12:14PM (#4479997)
Yes, 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.
Re:Python Development on Linux and Why You Should Too by icebraining on Wednesday September 05, 2012 @10:56AM (#4479628)
Your browser's monospace font isn't monospace. You should choose a different one.
Re:Python Development on Linux and Why You Should Too by sp332 on Wednesday September 05, 2012 @11:11AM (#4479697)
If the monospace font doesn't support those characters, maybe the browser fell back to a non-monospace font.
Re:Python Development on Linux and Why You Should Too by icebraining on Wednesday September 05, 2012 @11:14AM (#4479706)
No, if you look at the ASCII version posted above, it's distorted too (the big parenthesis are wrong, for example).
Re:Python Development on Linux and Why You Should Too by muyuu on Wednesday September 05, 2012 @10:30AM (#4479516)
You can, but most people will see little boxes all over the place.
Re:Python Development on Linux and Why You Should Too by icebraining on Wednesday September 05, 2012 @10:57AM (#4479633)
True, but in my opinion they should install fonts with decent unicode support anyway.
Re:Python Development on Linux and Why You Should Too by crisnoble on Wednesday September 05, 2012 @11:08AM (#4479681)
And how would one go about doing that on an iPhone?
Re:Python Development on Linux and Why You Should Too by hntester123 on Wednesday September 05, 2012 @01:30PM (#4480376)
Though 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?