A python explains itself in detail

Getting smarter makes me feel stupid, but now that I know, I must be smart again, right?

I could have done all of this with a single Python built-in function. "help(os)". So now I am stupid->smarter.


# -*- coding: utf-8 -*- import os #This is used as such: # python this.py>next.py # python next.py>osfunk.txt print "import os" def ossy (): for i in dir(os): if i[1]!='_': if i[1]>'Z': t=str(i) print "print '----- %s ---'" % (t) print "print os."+i+".__doc__" print "print " ossy()

The point of the code is to create a program that creates a file. This only creates a text file, however the complete program creates an indexed HTML document that allows me to auto document the functions in a specific module of interest using HTML tags. In the second stage of this it creates a file with elements as such:

----- chdir ---
chdir(path)

Change the current working directory to the specified path.

0 comments:

Automated Intelligence

Automated Intelligence
Auftrag der unendlichen LOL katzen