開発環境
- 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 10(Systems)、Things to Do 10.5.を解いてみる。
Things to Do 10.5.
コード(Eacs, BBEdit)
#!/usr/bin/env python3
# -*-c doing: utf-8 -*_
import os
os.chdir('/usr/bin')
for dir in os.listdir('..')[:10]:
print(dir)
入出力結果(Terminal, IPython)
$ ./sample5.py bin include lib libexec local sbin share standalone X11 X11R6 $
0 コメント:
コメントを投稿