Skip to content

Instantly share code, notes, and snippets.

View Xiard's full-sized avatar

David Cater Xiard

  • Phoenix, Arizona
View GitHub Profile
@Xiard
Xiard / pylistmodules.py
Last active April 29, 2019 21:01 — forked from lrq3000/pylistmodules.py
List recursively all imports of modules along with versions done from your Python application.Tested on Python 2.7. No dependencies except standard Python libs.
from __future__ import print_function
# !/usr/bin/env python
# encoding: utf-8
# Copyright (C) 2001-2007 Martin Blais. All Rights Reserved
# Copyright (C) 2010 Bear http://code-bear.com/bearlog/
# Copyright (C) 2013 lrq3000
# Excerpt from SnakeFood to recursively list all imports of modules using AST parsing
# Additions to print the versions of each module if available