Advertisement
Guest User

Untitled

a guest
May 22nd, 2015
202
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.42 KB | None | 0 0
  1. #!/usr/bin/env python
  2. #
  3. # Copyright 2007 Doug Hellmann.
  4. #
  5.  
  6. """Retrieving the source code for a module within a zip archive.
  7.  
  8. """
  9. #end_pymotw_header
  10.  
  11. import zipimport
  12.  
  13. importer = zipimport.zipimporter('zipimport_example.zip')
  14. for module_name in ['zipimport_get_code', 'zipimport_get_source']:
  15. source = importer.get_source(module_name)
  16. print '=' * 80
  17. print module_name
  18. print '=' * 80
  19. print source
  20. print
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement