import this
secret = "Tbbq Wbo! abj tb fvta hc sbe gur znvyvat yvfg bire ng vclguba.bet"
The Zen of Python, by Tim Peters Beautiful is better than ugly. Explicit is better than implicit. Simple is better than complex. Complex is better than complicated. Flat is better than nested. Sparse is better than dense. Readability counts. Special cases aren't special enough to break the rules. Although practicality beats purity. Errors should never pass silently. Unless explicitly silenced. In the face of ambiguity, refuse the temptation to guess. There should be one-- and preferably only one --obvious way to do it. Although that way may not be obvious at first unless you're Dutch. Now is better than never. Although never is often better than *right* now. If the implementation is hard to explain, it's a bad idea. If the implementation is easy to explain, it may be a good idea. Namespaces are one honking great idea -- let's do more of those!
Josh mentioned that there are two range commands, range
and xrange
.
Run the code below to see which one is faster, and then read the documentation for the two to see why this is the case.
timeit?
%timeit range(100)
%timeit xrange(100)
Create the stub default profile (if you haven't already)
$ ipython profile create
This will create the stubs for the default profile
now you can change these defaults.
To find where your profile is stored:
In [1]: import IPython
In [2]: IPython.utils.path.locate_profile()
Example:if you want the _
and __
methods to show up by default when doing tab-completion
c.IPCompleter.omit__names
Another example: you can add your own startup message (or execute your desired commands at startup) like I have:
.../profile_default/startup/README
import IPython
IPython.utils.path.locate_profile()
u'/home/pi/.ipython/profile_default'
IPython.utils.path.locate_profile()+'/startup/README'
u'/home/pi/.ipython/profile_default/startup/README'
cat IPython.utils.path.locate_profile()+'/startup/README'