1 Help function: View modules, functions, variables detailed description:
View Module
>>> Help ("modules")
moment the while I gather a list of all available modules
... Basehttpserver Array htmllib sets
Bastion ast
httplib sgmllib CDROM Asynchat ihooks sha
cgihttpserver asyncore
imaplib shelve Canvas Atexit imghdr shlex
configparser audiodev imp shutil
Cookie audioop importlib signal
DLFCN axi imputil site
Dialog Base64 Inspect sitecustomize
Docxmlrpcserver bdb io smtpd
filedialog binascii itertools
View Package
>>> help (' JSON ') Help on
package JSON:
NAME
json
FILE
/usr/lib/python2.7/json/__init_ _.py
MODULE DOCS
http://docs.python.org/library/json
DESCRIPTION
json (JavaScript Object notation)
View class
>>> Help (JSON. Jsondecoder) Help on
class Jsondecoder in module Json.decoder:
class Jsondecoder (__builtin__.object)
| Simple JSON
To view functions:
>>> Help (Json.dump) Help
on function dump in module JSON:
dump (obj, FP, Skipkeys=false, ensure_ascii= True, Check_circular=true, Allow_nan=true, Cls=none, Indent=none, Separators=none, encoding= ' Utf-8 ', default=None, * * kw)
Serialize ' obj ' as a JSON formatted stream to ' FP ' (a
'. Write () '-supporting File-like object).
If ' Skipkeys ' is true Then ' dict ' the keys that are not basic types
(' str ', ' Unicode ', ' int ', ' ', ' ', ' ' ', ' bool ', ' None '] would be
skipped instead of raising a ' typeerror '.
If ' Ensure_ascii ' is false, then the some chunks written to ' ' FP ' ' ' could
' ' Unicode ' instances, subject to normal P Ython ' str ' to ' '
Unicode ' coercion rules. Unless ' fp.write () ' Explicitly
understands ' Unicode ' (as in ' Codecs.getwriter () ')
Cause an error.
2 dir function: View functions or methods available to variables
>>> Import sys >>> dir (sys) [' __displayhook__ ', ' __doc__ ', ' __excepthook__ ', ' __name__ ', ' __package__ ', ' __stderr__ ', ' __stdin__ ', ' __stdout__ ', ' _clear_type_cache ', ' _current_frames ', ' _getframe ', ' _mercurial ', ' Api_ Version ', ' argv ', ' builtin_module_names ', ' byteorder ', ' call_tracing ', ' callstats ', ' copyright ', ' displayhook ', ' Dont_ Write_bytecode ', ' exc_clear ', ' exc_info ', ' exc_type ', ' excepthook ', ' exec_prefix ', ' executable ', ' exit ', ' exitfunc ', ' Flags ', ' float_info ', ' float_repr_style ', ' getcheckinterval ', ' getdefaultencoding ', ' getdlopenflags ', ' Getfilesystemencoding ', ' getprofile ', ' getrecursionlimit ', ' getrefcount ', ' getsizeof ', ' gettrace ', ' hexversion ', ' Last_traceback ', ' last_type ', ' last_value ', ' long_info ', ' maxint ', ' maxsize ', ' maxunicode ', ' meta_path ', ' modules ', ' Path ', ' path_hooks ', ' path_importer_cache ', ' platform ', ' prefix ', ' ps1 ', ' ps2 ', ' py3kwarning ', ' pydebug ', ' Setcheckinterval ', ' setdlopenflags ', ' setprofile ', ' setrecursionlimit ', ' settrace ', ' stdErr ', ' stdin ', ' stdout ', ' subversion ', ' Version ', ' Version_info ', ' warnoptions '
3 type function: Viewing the type of a variable
<type ' module ' >
>>> type (json.__name__)
<type ' str ' >
>>> type ( Json.decoder)
<type ' module ' >
4 Exit Python command line
WINDOWS:CTRL+Z Carriage return
Linux:ctrl+d
Note: Use Pydoc module to view document descriptions for modules