6/24/2012

Python 3 Easter Egg (Spoiler Alert)

One cool thing about Python 3, not only are batteries included, but it includes antigravity!

What I am referring to as antigravity is an Easter egg in Python 3.

By default, Python 2 is installed on most systems. If you want to install Python 3, then in Fedora I use:
# yum install python3




On the Raspberry Pi, or in Debian-based distributions in general like Ubuntu or Mint, I use:
$ sudo apt-get install python3


After the install finishes, in a GUI environment open up a terminal and start the Python 3 interpreter:
$ python3

Python 3.2.3 (default, Jun  8 2012, 05:40:06) 
[GCC 4.6.3 20120306 (Red Hat 4.6.3-2)] on linux2
Type "help", "copyright", "credits" or "license" for more information.

>>>import antigravity



It will pop up your browser to view this web page:
http://xkcd.com/353/

If you don't have a GUI started, then no web browser will pop up, and nothing happens. It looks like this:
Python 3

No comments:

About Me - WrightRocket

My photo

I've worked with computers for over 30 years, programming, administering, using and building them from scratch.

I'm an instructor for technical computer courses, an editor and developer of training manuals, and an Android developer.