Skip to content

Instantly share code, notes, and snippets.

@orzklv
Created October 7, 2020 07:12
Show Gist options
  • Save orzklv/26cc07a2000c14d00d3439e24228cb54 to your computer and use it in GitHub Desktop.
Save orzklv/26cc07a2000c14d00d3439e24228cb54 to your computer and use it in GitHub Desktop.
True error handled python importing
#
# Starting import process here
#
# Global scopic functions
from __future__ import print_function
# Loading installed modules
try:
print('Importing "os" Module')
import os
print('"os" Module import completed successfully')
#
# Ending import section and if errors occur
# It will be consoled with explanation
#
except ImportError as e:
print("Import of modules has failed with error of: " + str(e.name))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment