開発環境
- OS X Yosemite - Apple (OS)
- Emacs (CUI)、BBEdit - Bare Bones Software, Inc. (GUI) (Text Editor)
- Python 3.4 (プログラミング言語)
Introducing Python: Modern Computing in Simple Packages(Bill Lubanovic (著)、 O'Reilly Media)のChapter 5(Py Boxes: Modules, Packages, and Programs)、Things to Do 5.4.を解いてみる。
Things to Do 5.4.
コード(BBEdit)
zoo.py
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
def hours():
print('Open 9-5 daily')
入出力結果(Terminal, IPython)
$ ipython Python 3.4.2 (default, Nov 1 2014, 16:32:22) Type "copyright", "credits" or "license" for more information. IPython 2.3.1 -- An enhanced Interactive Python. ? -> Introduction and overview of IPython's features. %quickref -> Quick reference. help -> Python's own help system. object? -> Details about 'object', use 'object??' for extra details. In [1]: from zoo import hours as info In [2]: info() Open 9-5 daily In [3]: quit() $
0 コメント:
コメントを投稿