開発環境
- OS X Mavericks - Apple(OS)
- Emacs (CUI)、BBEdit - Bare Bones Software, Inc. (GUI) (Text Editor)
- Python (プログラミング言語)
Learning Python (Mark Lutz (著)、Oreilly & Associates Inc)のPart Ⅰ.(Getting Started)、Test Your Knowledge: Part I Exercises、2. (Programs)を解いてみる。
その他参考書籍
2. (Programs)
コード(BBEdit)
module1.py
print('Hello module world!')
入出力結果(Terminal)
$ python3 module1.py
Hello module world!
$ python3
Python 3.3.3 (default, Dec 2 2013, 01:40:21)
[GCC 4.2.1 Compatible Apple LLVM 5.0 (clang-500.2.79)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> import module1
Hello module world!
>>> import imp
>>> imp.reload(module1)
Hello module world!
<module 'module1' from './module1.py'>
>>> exec("print('Hello module world!')")
Hello module world!
>>> exec("imp.reload(module1)")
Hello module world!
>>> quit()
$
0 コメント:
コメントを投稿