Python is a simple language and developed with programmer’s productivity and code readability in mind. Learning new language would be simple to complicated depending on language syntax, wierdness and many other factors.
Its universally accepted best way to learn programming language is to write programs and rewrite again.
Python makes learning curve easier. Python has certain features which makes easier to learn inside interpreter.
helpis function which takes a
functionand tells what exactly the object documentation.
integerclass properties and methods in nicer format.
diris a function list of methods associated with a particular object,
dir('python')lists all functions associated with string.
___all__is magic methods and
titleis normal functions.
import os; os.__file___In order to find the location of the module, it is convenient to use
modulename.__file__will return path of the source file. Note certain modules can be
.pyfiles, others are
.pyc, few are
Next time you code in python, open your favorite text editor and python interpreter and try all the hacks in python interpreter and read documentation.
__Ipython pro tip__Inside Ipython
%psource modulename prints source code of the module, useful in lot of cases.
Find out what
You're almost as happy as you think you are.
This work is licensed under a Creative Commons Attribution-ShareAlike 4.0 International License.