Skip to content

Instantly share code, notes, and snippets.

@TheLittleNaruto
Created October 19, 2021 11:11
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save TheLittleNaruto/b728aadee1b097ddc2aebefb98380e22 to your computer and use it in GitHub Desktop.
Save TheLittleNaruto/b728aadee1b097ddc2aebefb98380e22 to your computer and use it in GitHub Desktop.
try:
cartonCounterRouter = importlib.import_module("cartonCounterRouter")
except ImportError:
print("error in importing cartonCounterRouter")
# Some code goes..............
@app.route('/api/carton/counter', methods=['POST'])
def carton_counter():
return route_req("carton", cartonCounterRouter)
#
# return route_req("carton", cartonCounterRouter)
# NameError: name 'cartonCounterRouter' is not defined
#
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment