Moved re for python identifier to var, added error checking for opening module.