Created
October 7, 2020 07:12
-
-
Save orzklv/26cc07a2000c14d00d3439e24228cb54 to your computer and use it in GitHub Desktop.
True error handled python importing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# | |
# 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