Python 的文件系統
Upcoming SlideShare
Loading in...5
×
 

Python 的文件系統

on

  • 535 views

 

Statistics

Views

Total Views
535
Views on SlideShare
527
Embed Views
8

Actions

Likes
1
Downloads
6
Comments
0

2 Embeds 8

http://www.linkedin.com 5
https://www.linkedin.com 3

Accessibility

Categories

Upload Details

Uploaded via as Apple Keynote

Usage Rights

© All Rights Reserved

Report content

Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
  • Full Name Full Name Comment goes here.
    Are you sure you want to
    Your message goes here
    Processing…
Post Comment
Edit your comment
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n

Python 的文件系統 Python 的文件系統 Presentation Transcript

  • Python wzyang@kkbox.com
  • • docstring• pydoc• ipython• doctest• sphinx
  • docstring
  • docstring• Class Method Class Method• Class Method __doc__
  • class MyClass(): def plus(self, x): return x + 1mc = MyClass()y = mc.plus(1)
  • This is a moduleclass MyClass(): This is my Class def plus(self, x): The method pluses one. return x + 1mc = MyClass()print mc.__doc__print mc.plus.__doc__
  • This is a moduleclass MyClass(): def plus(self, x): return x + 1import sysprint sys.modules[__name__].__doc__
  • pydoc
  • $pydoc MyClass
  • $pydoc -p 8080
  • ipython.A better interactive mode. $easy_install ipython
  • doctest
  • class MyClass(): def plus(self, x): The method pluses one. >>> mc = MyClass() >>> mc.plus(1) 2 return x + 1if __name__ == __main__: import doctest doctest.testmod()
  • Sphinx$easy_install sphinx
  • $sphinx-quickstart
  • :mod:`MyClass` Module+++++++++++++++++++++This is my class..... autoclass:: MyClass.MyClass :members:
  • $make html