|
Revision 73, 1.2 kB
(checked in by gak, 7 weeks ago)
|
|
Added svn executable flag on for scripts
|
-
Property svn:executable set to
*
-
Property svn:keywords set to
"Id Revision"
|
| Line | |
|---|
| 1 | #!/usr/bin/env python |
|---|
| 2 | """ |
|---|
| 3 | pycallgraph |
|---|
| 4 | |
|---|
| 5 | U{http://pycallgraph.slowchop.com/} |
|---|
| 6 | |
|---|
| 7 | Copyright Gerald Kaszuba 2007 |
|---|
| 8 | |
|---|
| 9 | This program is free software; you can redistribute it and/or modify |
|---|
| 10 | it under the terms of the GNU General Public License as published by |
|---|
| 11 | the Free Software Foundation; either version 2 of the License, or |
|---|
| 12 | (at your option) any later version. |
|---|
| 13 | |
|---|
| 14 | This program is distributed in the hope that it will be useful, |
|---|
| 15 | but WITHOUT ANY WARRANTY; without even the implied warranty of |
|---|
| 16 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|---|
| 17 | GNU General Public License for more details. |
|---|
| 18 | |
|---|
| 19 | You should have received a copy of the GNU General Public License |
|---|
| 20 | along with this program; if not, write to the Free Software |
|---|
| 21 | Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA |
|---|
| 22 | """ |
|---|
| 23 | |
|---|
| 24 | """ |
|---|
| 25 | This example demonstrates a simple use of pycallgraph. |
|---|
| 26 | """ |
|---|
| 27 | |
|---|
| 28 | import pycallgraph |
|---|
| 29 | |
|---|
| 30 | |
|---|
| 31 | class Banana: |
|---|
| 32 | |
|---|
| 33 | def __init__(self): |
|---|
| 34 | pass |
|---|
| 35 | |
|---|
| 36 | def eat(self): |
|---|
| 37 | pass |
|---|
| 38 | |
|---|
| 39 | |
|---|
| 40 | def main(): |
|---|
| 41 | pycallgraph.start_trace() |
|---|
| 42 | banana = Banana() |
|---|
| 43 | banana.eat() |
|---|
| 44 | pycallgraph.make_dot_graph('basic.png') |
|---|
| 45 | |
|---|
| 46 | if __name__ == '__main__': |
|---|
| 47 | main() |
|---|
| 48 | |
|---|
| 49 | # vim:set shiftwidth=4 tabstop=4 expandtab textwidth=79: |
|---|