Register a SA Forums Account here!
JOINING THE SA FORUMS WILL REMOVE THIS BIG AD, THE ANNOYING UNDERLINED ADS, AND STUPID INTERSTITIAL ADS!!!

You can: log in, read the tech support FAQ, or request your lost password. This dumb message (and those ads) will appear on every screen until you register! Get rid of this crap by registering your own SA Forums Account and joining roughly 150,000 Goons, for the one-time price of $9.95! We charge money because it costs us money per month for bills, and since we don't believe in showing ads to our users, we try to make the money back through forum registrations.
 
  • Locked thread
mantaworks
May 6, 2005

by Fragmaster

FuraxVZ posted:

The online Diving into Python is pretty good, and I was thinking of getting the dead-tree version. Is there better?

The only suggestion I can make is take one that uses version 2.5. DIP is written for 2.3 and as such has a kind of roundabout way of dealing with things that can be more elegantly written in 2.5.

Adbot
ADBOT LOVES YOU

mantaworks
May 6, 2005

by Fragmaster

Marzzle posted:

How do I install a .egg on python in os x? I have installed "easy_install" or at least I think I did

code:
>>> easy_install /Users/name/Downloads/mpl.egg

Traceback (most recent call last):
  File "<pyshell#8>", line 1, in <module>
    easy_install /Users/name/Downloads/mpl.egg
NameError: name 'easy_install' is not defined
It's taken me like 3 hours trying to get this thing on here.

The module is matplotlib and I just renamed the thing since it was driving me crazy.

Don't execute it in python's interactive prompt, execute it into a command line (ie Terminal).

mantaworks
May 6, 2005

by Fragmaster

Alan Greenspan posted:

This returns the entire array in one huge line. Is there a cute way to add the line breaks? Nothing matters but shortness of the source code. Is there a way to make the code I wrote shorter?

Write it in perl.

mantaworks
May 6, 2005

by Fragmaster

drcru posted:

How do I convert a 4bit binary number to a decimal without using anything like character strings or anything like int("10111", 2)?

I never learned how to do it manually :(

e: this is a "so I know how to do it in the future" type of question!

Binary isn't really a format like a string or an int. Your binary is represented by one of the built-in types such as an array of strings or a long or whatever. The conversion from <random type> to int is different for every <random type>.

(there is a possibility that the language du jour has a special binary type, then again there will be a built-in function to go from binary to decimal)

edit: wait did I read the question wrong; do you want an explanation of the logic behind the conversion from binary to decimal? Google is better equipped to handle that question. (edit2: and yaoi prophet too ;) )

  • Locked thread