2012年11月24日土曜日

開発環境

『初めてのPython 第3版』(Mark Lutz 著、夏目 大 訳、オライリー・ジャパン、2009年、ISBN978-4-87311-393-7) のIII部(ステートメント)14章(Pythonのドキュメント)の練習問題4を解いてみる。

その他参考書籍

4.

コマンドラインで「pydoc modules」とすればいい。

コード(TextWrangler)

sample.py

#!/usr/bin/env python3.3
#-*- coding: utf-8 -*-

"""
Hello, World!を出力する単純なプログラム
"""
print("Hello, World!")

入出力結果(Terminal)

$ pydoc modules

Please wait a moment while I gather a list of all available modules...

IN                  binascii            io                  select
__future__          binhex              itertools           setuptools
_abcoll             bisect              json                shelve
_ast                builtins            keyword             shlex
_bisect             bz2                 lib2to3             shutil
_codecs             cProfile            linecache           signal
_codecs_cn          calendar            locale              site
_codecs_hk          cgi                 logging             smtpd
_codecs_iso2022     cgitb               macpath             smtplib
_codecs_jp          chunk               macurl2path         sndhdr
_codecs_kr          cmath               mailbox             socket
_codecs_tw          cmd                 mailcap             socketserver
_collections        code                marshal             sqlite3
_compat_pickle      codecs              math                sre_compile
_csv                codeop              mimetypes           sre_constants
_ctypes             collections         mmap                sre_parse
_ctypes_test        colorsys            modulefinder        ssl
_curses             compileall          multiprocessing     stat
_curses_panel       concurrent          netrc               string
_datetime           configparser        nis                 stringprep
_dbm                contextlib          nntplib             struct
_dummy_thread       copy                nose                subprocess
_elementtree        copyreg             ntpath              sunau
_functools          crypt               nturl2path          symbol
_gestalt            csv                 numbers             symtable
_hashlib            ctypes              numpy               sys
_heapq              curses              opcode              sysconfig
_io                 datetime            operator            syslog
_json               dbm                 optparse            tabnanny
_locale             decimal             os                  tarfile
_lsprof             difflib             os2emxpath          telnetlib
_markerlib          dis                 parser              tempfile
_markupbase         distutils           pdb                 termios
_multibytecodec     doctest             pickle              test
_multiprocessing    dummy_threading     pickletools         textwrap
_pickle             easy_install        pipes               this
_posixsubprocess    email               pkg_resources       threading
_pyio               encodings           pkgutil             time
_random             errno               platform            timeit
_scproxy            fcntl               plistlib            tkinter
_socket             filecmp             poplib              token
_sqlite3            fileinput           posix               tokenize
_sre                fnmatch             posixpath           trace
_ssl                formatter           pprint              traceback
_string             fractions           profile             tty
_strptime           ftplib              pstats              turtle
_struct             functools           pty                 turtledemo
_symtable           gc                  pwd                 types
_testcapi           genericpath         py_compile          unicodedata
_thread             getopt              pyclbr              unittest
_threading_local    getpass             pydoc               urllib
_warnings           gettext             pydoc_data          uu
_weakref            glob                pyexpat             uuid
_weakrefset         grp                 queue               warnings
abc                 gzip                quopri              wave
aifc                hashlib             random              weakref
antigravity         heapq               re                  webbrowser
argparse            hmac                readline            wsgiref
array               html                readline_path       xdrlib
ast                 http                reprlib             xml
asynchat            idlelib             resource            xmlrpc
asyncore            imaplib             rlcompleter         xxlimited
atexit              imghdr              runpy               xxsubtype
audioop             imp                 sample              zipfile
base64              importlib           sched               zipimport
bdb                 inspect             scipy               zlib

Enter any module name to get more help.  Or, type "modules spam" to search
for modules whose descriptions contain the word "spam".

$

ちなみにJavaScriptの場合。(windowオブジェクトのプロパティで表示できるものを全て表示してみる。)

コード(TextWrangler)

var result = "";
for(var prop in window){
  result += prop + "\n";
}
$('#pre0').text(result);








						

0 コメント:

コメントを投稿