Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import pstats
- import sys
- def main():
- if len(sys.argv) > 1: file = sys.argv[1]
- else:
- if sys.version_info.major==3:
- file = input("Enter pathname:")
- else:
- file = raw_input("Enter pathname:")
- if file == "": file = r"C:\Users\User\Desktop\main.prof"
- p = pstats.Stats(file)
- p.strip_dirs().sort_stats(-1).print_stats()
- if __name__ == '__main__':
- main()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement