cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Try the Materials Informatics Toolkit, which is designed to easily handle SMILES data. This and other helpful add-ins are available in the JMP® Marketplace
%3CLINGO-SUB%20id%3D%22lingo-sub-782950%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3EJMP%20Python%E7%B5%B1%E5%90%88%E3%82%92Python%E5%81%B4%E3%81%A7%E3%83%AA%E3%82%BB%E3%83%83%E3%83%88%E3%81%99%E3%82%8B%E6%96%B9%E6%B3%95%E3%81%AF%E3%81%82%E3%82%8A%E3%81%BE%E3%81%99%E3%81%8B%EF%BC%9F%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-782950%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3E%3CP%3EJMP%20%E3%82%BB%E3%83%83%E3%82%B7%E3%83%A7%E3%83%B3%E3%82%92%E9%96%89%E3%81%98%E3%81%9A%E3%81%AB%E3%80%81JMP%20%E3%81%AE%20Python%20%E5%81%B4%E3%81%A7%E3%80%8C%E3%81%99%E3%81%B9%E3%81%A6%E3%80%8D%E3%82%92%E3%82%AF%E3%83%AA%E3%82%A2%E3%81%99%E3%82%8B%E6%96%B9%E6%B3%95%E3%81%AF%E3%81%82%E3%82%8A%E3%81%BE%E3%81%99%E3%81%8B%20(JSL%20%E3%81%AE%20Delete%20Symbols()%20%E3%81%AB%E4%BC%BC%E3%81%9F%E3%82%82%E3%81%AE%E3%80%81%E3%81%BE%E3%81%9F%E3%81%AF%E3%82%AB%E3%83%BC%E3%83%8D%E3%83%AB%E3%82%92%E5%86%8D%E8%B5%B7%E5%8B%95%E3%81%99%E3%82%8B%E6%96%B9%E6%B3%95)%3F%3C%2FP%3E%0A%3CP%3E%20%3C%2FP%3E%0A%3CP%3E%E7%A7%81%E3%81%AF%E5%90%8C%E5%83%9A%E3%81%A8%20JMP%20Python%20%E7%B5%B1%E5%90%88%E3%82%92%E5%88%A9%E7%94%A8%E3%81%97%E3%81%9F%E3%82%A2%E3%83%97%E3%83%AA%E3%82%B1%E3%83%BC%E3%82%B7%E3%83%A7%E3%83%B3%E3%82%92%E9%96%8B%E7%99%BA%E3%81%97%E3%81%A6%E3%81%84%E3%81%BE%E3%81%99%E3%81%8C%E3%80%81Python%20%E3%82%B3%E3%83%BC%E3%83%89%E3%82%92%E5%A4%89%E6%9B%B4%E3%81%99%E3%82%8B%E3%81%9F%E3%81%B3%E3%81%AB%20JMP%20%E3%82%92%E9%A0%BB%E7%B9%81%E3%81%AB%E9%96%89%E3%81%98%E3%82%8B%E5%BF%85%E8%A6%81%E3%81%8C%E3%81%82%E3%82%8A%E3%81%BE%E3%81%99%E3%80%82%E3%81%93%E3%82%8C%E3%81%AF%E3%80%81%E5%8F%A4%E3%81%84%20Python%20%E3%82%B3%E3%83%BC%E3%83%89%E3%81%8C%E3%83%A1%E3%83%A2%E3%83%AA%E5%86%85%E3%81%AB%E5%AD%98%E5%9C%A8%E3%81%97%E3%80%81%E3%82%A4%E3%83%B3%E3%83%9D%E3%83%BC%E3%83%88%E3%81%AB%E3%82%88%E3%81%A3%E3%81%A6%E6%97%A2%E3%81%AB%E3%82%A4%E3%83%B3%E3%83%9D%E3%83%BC%E3%83%88%E3%81%95%E3%82%8C%E3%81%9F%E3%82%B3%E3%83%BC%E3%83%89%E3%81%8C%E4%B8%8A%E6%9B%B8%E3%81%8D%E3%81%95%E3%82%8C%E3%81%AA%E3%81%84%E3%81%A8%E3%81%84%E3%81%86%E5%95%8F%E9%A1%8C%E3%81%8C%E7%99%BA%E7%94%9F%E3%81%99%E3%82%8B%E3%81%9F%E3%82%81%E3%80%81Python%20%E3%82%92%E3%80%8C%E3%82%AF%E3%83%AA%E3%82%A2%E3%80%8D%E3%81%99%E3%82%8B%E3%81%9F%E3%82%81%E3%81%A7%E3%81%99%E3%80%82%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-LABS%20id%3D%22lingo-labs-782950%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3E%3CLINGO-LABEL%3E%E8%87%AA%E5%8B%95%E5%8C%96%E3%81%A8%E3%82%B9%E3%82%AF%E3%83%AA%E3%83%97%E3%83%88%3C%2FLINGO-LABEL%3E%3C%2FLINGO-LABS%3E%3CLINGO-SUB%20id%3D%22lingo-sub-782963%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3ERe%3A%20JMP%20Python%E7%B5%B1%E5%90%88%E3%82%92Python%E5%81%B4%E3%81%A7%E3%83%AA%E3%82%BB%E3%83%83%E3%83%88%E3%81%99%E3%82%8B%E6%96%B9%E6%B3%95%E3%81%AF%E3%81%82%E3%82%8A%E3%81%BE%E3%81%99%E3%81%8B%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-782963%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3E%3CP%3E%E7%84%A1%E8%A6%96%E3%81%95%E3%82%8C%E3%81%A6%E3%81%84%E3%82%8B%E3%83%A2%E3%82%B8%E3%83%A5%E3%83%BC%E3%83%AB%E3%82%92%E6%9B%B4%E6%96%B0%E3%81%97%E3%81%BE%E3%81%97%E3%81%9F%E3%80%82%E5%A4%9A%E3%81%8F%E3%81%AE%E9%A9%9A%E3%81%8D%E3%81%A8%E4%B8%8D%E6%80%9D%E8%AD%B0%20-%20%E6%B0%97%E3%81%A5%E3%81%8F%E3%81%BE%E3%81%A7...%3CBR%20%2F%3E%E3%81%82%E3%81%81%EF%BC%81%3C%2FP%3E%3CP%3E%20%3C%2FP%3E%3CP%3E%3CFONT%20face%3D%22courier%20new%2Ccourier%22%3E%E3%83%87%E3%83%AB%E3%81%AF%3C%2FFONT%3E%E6%A9%9F%E8%83%BD%E3%81%97%E3%81%BE%E3%81%99%E3%81%8B%EF%BC%9F%3C%2FP%3E%3CPRE%3E%3CCODE%20class%3D%22%20language-jsl%22%3Eimport%20sys%0Aprint(sys.path)%0Adel%20sys%0Aprint(sys.path)%3C%2FCODE%3E%3C%2FPRE%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-783147%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3ERe%3A%20JMP%20Python%E7%B5%B1%E5%90%88%E3%82%92Python%E5%81%B4%E3%81%A7%E3%83%AA%E3%82%BB%E3%83%83%E3%83%88%E3%81%99%E3%82%8B%E6%96%B9%E6%B3%95%E3%81%AF%E3%81%82%E3%82%8A%E3%81%BE%E3%81%99%E3%81%8B%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-783147%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3E%3CP%3E%3CEM%3E%3CSTRONG%3E%E5%95%8F%E9%A1%8C%3C%2FSTRONG%3E%3C%2FEM%3E%E3%81%8C%E3%81%82%E3%82%8A%E3%81%BE%E3%81%99%E3%80%82%E3%81%BB%E3%81%A8%E3%82%93%E3%81%A9%E3%81%AE%20Python%20%E3%82%B9%E3%82%AF%E3%83%AA%E3%83%97%E3%83%88%E3%81%A7%E3%81%AF%E3%80%81Python%20%E8%87%AA%E4%BD%93%E3%81%AE%E5%AD%98%E7%B6%9A%E6%9C%9F%E9%96%93%E3%81%8C%E3%82%B9%E3%82%AF%E3%83%AA%E3%83%97%E3%83%88%E3%81%A8%E5%90%8C%E3%81%98%E3%81%A7%E3%81%82%E3%82%8B%E3%81%93%E3%81%A8%E3%81%8C%E5%A4%9A%E3%81%84%E3%81%9F%E3%82%81%E3%80%81%E3%81%93%E3%81%AE%E5%95%8F%E9%A1%8C%E3%81%AF%E3%81%82%E3%81%BE%E3%82%8A%E8%AA%8D%E8%AD%98%E3%81%95%E3%82%8C%E3%81%BE%E3%81%9B%E3%82%93%E3%80%82%E9%95%B7%E6%99%82%E9%96%93%E3%81%AB%E3%82%8F%E3%81%9F%E3%81%A3%E3%81%A6%20Python%20%E3%82%92%E5%AF%BE%E8%A9%B1%E7%9A%84%E3%81%AB%E5%AE%9F%E8%A1%8C%E3%81%97%E3%80%81%E5%90%8C%E3%81%98%E5%AF%BE%E8%A9%B1%E5%9E%8B%E3%82%BB%E3%83%83%E3%82%B7%E3%83%A7%E3%83%B3%E5%86%85%E3%81%A7%E8%A4%87%E6%95%B0%E3%81%AE%E5%87%A6%E7%90%86%E3%82%92%E5%AE%9F%E8%A1%8C%E3%81%99%E3%82%8B%E3%81%A8%E3%80%81%E5%95%8F%E9%A1%8C%E3%81%AB%E6%B0%97%E3%81%A5%E3%81%8D%E5%A7%8B%E3%82%81%E3%82%8B%E3%81%A7%E3%81%97%E3%82%87%E3%81%86%E3%80%82NumPy%20%E3%81%AA%E3%81%A9%E3%80%81%E4%B8%80%E9%83%A8%E3%81%AE%20Python%20%E3%83%91%E3%83%83%E3%82%B1%E3%83%BC%E3%82%B8%E3%81%8C%20C%2FC%2B%2B%20(%E3%81%95%E3%82%89%E3%81%AB%E3%81%AF%20Fortran)%20%E3%81%A7%E5%AE%9F%E8%A3%85%E3%81%95%E3%82%8C%E3%81%A6%E3%81%84%E3%82%8B%E3%81%9F%E3%82%81%E3%80%81%E3%81%93%E3%81%AE%E5%95%8F%E9%A1%8C%E3%81%AF%E3%81%95%E3%82%89%E3%81%AB%E8%A4%87%E9%9B%91%E3%81%AB%E3%81%AA%E3%82%8A%E3%81%BE%E3%81%99%E3%80%82Python%20%E3%81%AF%E3%81%93%E3%82%8C%E3%82%89%E3%82%92%E5%85%B1%E6%9C%89%E3%83%A9%E3%82%A4%E3%83%96%E3%83%A9%E3%83%AA%E3%81%A8%E3%81%97%E3%81%A6%E3%83%AD%E3%83%BC%E3%83%89%E3%81%97%E3%80%81%E5%86%8D%E8%B5%B7%E5%8B%95%E4%BB%A5%E5%A4%96%E3%81%AB%E5%AE%9F%E8%A1%8C%E4%B8%AD%E3%81%AE%E3%83%97%E3%83%AD%E3%82%BB%E3%82%B9%E3%81%8B%E3%82%89%E5%85%B1%E6%9C%89%E3%83%A9%E3%82%A4%E3%83%96%E3%83%A9%E3%83%AA%E3%82%92%E5%AE%89%E5%85%A8%E3%81%AB%E3%82%A2%E3%83%B3%E3%83%AD%E3%83%BC%E3%83%89%E3%81%99%E3%82%8B%E6%96%B9%E6%B3%95%E3%81%AF%E3%81%82%E3%82%8A%E3%81%BE%E3%81%9B%E3%82%93%E3%80%82JMP%20%E3%81%AF%20Python%20%E5%85%B1%E6%9C%89%E3%83%A9%E3%82%A4%E3%83%96%E3%83%A9%E3%83%AA%E8%87%AA%E4%BD%93%E3%81%AB%E9%96%A2%E3%81%97%E3%81%A6%E5%90%8C%E6%A7%98%E3%81%AE%E7%8A%B6%E6%B3%81%E3%81%AB%E3%81%82%E3%82%8A%E3%80%81%E3%82%A2%E3%83%B3%E3%83%AD%E3%83%BC%E3%83%89%E3%81%A7%E3%81%8D%E3%81%BE%E3%81%9B%E3%82%93%E3%80%82%E3%81%AF%E3%81%84%E3%80%81%20%3CSTRONG%3E%3CEM%3Edel%20%E3%81%AF%3C%2FEM%3E%3C%2FSTRONG%3E%E3%82%AA%E3%83%96%E3%82%B8%E3%82%A7%E3%82%AF%E3%83%88%E3%82%92%E8%A7%A3%E6%94%BE%E3%81%99%E3%82%8B%E3%81%9F%E3%82%81%E3%81%AB%E6%A9%9F%E8%83%BD%E3%81%97%E3%81%BE%E3%81%99%E3%80%82%E3%81%9F%E3%81%A0%E3%81%97%E3%80%81del%20sys%20%E3%81%AF%E6%9C%9F%E5%BE%85%E3%81%A9%E3%81%8A%E3%82%8A%E3%81%AE%E5%8B%95%E4%BD%9C%E3%82%92%E3%81%97%E3%81%BE%E3%81%9B%E3%82%93%E3%80%82%E3%81%93%E3%82%8C%E3%81%AF%E3%80%81%E3%80%8C%E3%83%A2%E3%82%B8%E3%83%A5%E3%83%BC%E3%83%AB%E3%80%8D%E3%82%92%E5%89%8A%E9%99%A4%E3%81%BE%E3%81%9F%E3%81%AF%E3%82%A2%E3%83%B3%E3%83%AD%E3%83%BC%E3%83%89%E3%81%97%E3%81%9F%E3%82%8A%E3%80%81%E4%BE%9D%E5%AD%98%E3%81%99%E3%82%8B%20dll%20%E3%82%92%E3%82%A2%E3%83%B3%E3%83%AD%E3%83%BC%E3%83%89%E3%81%97%E3%81%9F%E3%82%8A%E3%81%99%E3%82%8B%E3%81%AE%E3%81%A7%E3%81%AF%E3%81%AA%E3%81%8F%E3%80%81%E3%83%AD%E3%83%BC%E3%83%89%E3%81%95%E3%82%8C%E3%81%9F%E3%83%A2%E3%82%B8%E3%83%A5%E3%83%BC%E3%83%AB%E3%81%B8%E3%81%AE%E5%8F%82%E7%85%A7%E3%82%92%E4%BF%9D%E6%8C%81%E3%81%97%E3%81%A6%E3%81%84%E3%82%8B%E3%80%8Csys%E3%80%8D%E3%82%AA%E3%83%96%E3%82%B8%E3%82%A7%E3%82%AF%E3%83%88%E3%82%92%E5%89%8A%E9%99%A4%E3%81%99%E3%82%8B%E3%81%A0%E3%81%91%E3%81%A7%E3%81%99%E3%80%82%E3%82%82%E3%81%86%201%20%E3%81%A4%E3%81%AE%E5%81%B4%E9%9D%A2%E3%81%AF%E3%80%81sys%20%E3%81%AF%20Python%20%E3%81%AE%E7%B5%84%E3%81%BF%E8%BE%BC%E3%81%BF%E3%83%A2%E3%82%B8%E3%83%A5%E3%83%BC%E3%83%AB%E3%81%A7%E3%81%82%E3%82%8A%E3%80%81%E3%83%AD%E3%83%BC%E3%83%89%E3%81%95%E3%82%8C%E3%81%9F%E3%83%A2%E3%82%B8%E3%83%A5%E3%83%BC%E3%83%AB%E3%81%A8%E5%90%8C%E3%81%98%E3%81%A7%E3%81%AF%E3%81%AA%E3%81%84%E3%81%93%E3%81%A8%E3%81%A7%E3%81%99%E3%80%82%E3%81%95%E3%82%89%E3%81%AB%E3%80%8Csys%E3%80%8D%E3%82%92%E5%89%8A%E9%99%A4%E3%81%97%E3%81%A6%E3%82%82%E3%80%81sys.path%20%E3%81%AB%E5%88%A5%E3%81%AE%E3%83%91%E3%82%B9%E3%82%92%E8%BF%BD%E5%8A%A0%E3%81%99%E3%82%8B%E3%81%AA%E3%81%A9%E3%80%81%E8%A1%8C%E3%81%A3%E3%81%9F%E5%A4%89%E6%9B%B4%E3%81%AF%E3%82%AF%E3%83%AA%E3%83%BC%E3%83%B3%E3%82%A2%E3%83%83%E3%83%97%E3%81%95%E3%82%8C%E3%81%BE%E3%81%9B%E3%82%93%E3%80%82%3C%2FP%3E%0A%3CP%3E%20%3C%2FP%3E%0A%3CP%3E%3CSPAN%3E%E3%81%9D%E3%81%86%E3%81%97%E3%81%9F%E5%A0%B4%E5%90%88%3A%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3E%20%3C%2FP%3E%0A%3CPRE%3Esys.path.append('%2Fusr%2Flocal%2Fbin')%0Aprint(sys.path)%0Adel%20sys%0Aprint(sys.path).%20%20%23%20gives%20error%20on%20sys%0Aimport%20sys%0Aprint(sys.path).%20%20%23%20still%20contains%20the%20%2Fusr%2Flocal%2Fbin%20addition%0A%3C%2FPRE%3E%0A%3CP%3E%E4%B8%8A%E8%A8%98%E3%81%AF%E3%80%81%E3%82%BF%E3%83%BC%E3%83%9F%E3%83%8A%E3%83%AB%20%E3%82%A6%E3%82%A3%E3%83%B3%E3%83%89%E3%82%A6%E3%81%AE%E5%AF%BE%E8%A9%B1%E5%9E%8B%E3%82%BB%E3%83%83%E3%82%B7%E3%83%A7%E3%83%B3%E3%81%A7%E5%AE%9F%E8%A1%8C%E3%81%95%E3%82%8C%E3%81%BE%E3%81%97%E3%81%9F%E3%80%82Python%20%E3%82%92%E7%B5%82%E4%BA%86%E3%81%97%E3%81%A6%E5%86%8D%E8%B5%B7%E5%8B%95%E3%81%97%E3%81%9F%E5%A0%B4%E5%90%88%E3%81%AB%E3%81%AE%E3%81%BF%E3%80%81sys.path%20%E3%81%8B%E3%82%89%20%2Fusr%2Flocal%2Fbin%20%E3%81%8C%E3%82%AF%E3%83%AA%E3%82%A2%E3%81%95%E3%82%8C%E3%81%BE%E3%81%97%E3%81%9F%E3%80%82%E5%94%AF%E4%B8%80%E3%81%AE%E7%8F%BE%E5%AE%9F%E7%9A%84%E3%81%AA%E6%96%B9%E6%B3%95%E3%81%AF%E3%80%81%E3%82%BB%E3%83%83%E3%82%B7%E3%83%A7%E3%83%B3%E3%81%A7%E4%BD%BF%E7%94%A8%E3%81%95%E3%82%8C%E3%81%9F%E3%81%99%E3%81%B9%E3%81%A6%E3%81%AE%E5%A4%89%E6%95%B0%E3%82%92%E8%BF%BD%E8%B7%A1%E3%81%97%E3%80%81%E3%82%BB%E3%83%83%E3%82%B7%E3%83%A7%E3%83%B3%E3%81%AE%E7%B5%82%E4%BA%86%E6%99%82%E3%81%AB%E3%81%9D%E3%82%8C%E3%82%89%E3%82%92%E5%89%8A%E9%99%A4%E3%81%99%E3%82%8B%E3%81%93%E3%81%A8%E3%81%A7%E3%81%99%E3%80%821%20%E3%81%A4%E3%81%AE%E6%96%B9%E6%B3%95%E3%81%AF%E3%80%81%E5%90%84%E5%A4%89%E6%95%B0%E3%82%92%E3%83%AA%E3%82%B9%E3%83%88%E3%81%BE%E3%81%9F%E3%81%AF%E8%BE%9E%E6%9B%B8%E3%81%AB%E5%85%A5%E3%82%8C%E3%81%A6%E3%80%81%E3%82%BB%E3%83%83%E3%82%B7%E3%83%A7%E3%83%B3%E3%81%AE%E7%B5%82%E4%BA%86%E6%99%82%E3%81%AB%E3%82%B3%E3%83%B3%E3%83%86%E3%83%8A%E3%83%BC%E3%82%92%E5%89%8A%E9%99%A4%E3%81%99%E3%82%8B%E3%81%93%E3%81%A8%E3%81%A7%E3%81%99%E3%80%82%3C%2FP%3E%0A%3CP%3E%E7%A7%81%E3%81%AF%E3%80%81%E3%82%B0%E3%83%AD%E3%83%BC%E3%83%90%E3%83%AB%E7%92%B0%E5%A2%83%E3%81%A7%E5%AE%9F%E8%A1%8C%E3%81%95%E3%82%8C%E3%81%AA%E3%81%84%E3%82%B3%E3%83%BC%E3%83%89%E3%82%92%E8%A8%AD%E5%AE%9A%E3%81%A7%E3%81%8D%E3%82%8B%20Python%20%E3%82%B5%E3%83%96%E3%82%A4%E3%83%B3%E3%82%BF%E3%83%BC%E3%83%97%E3%83%AA%E3%82%BF%E3%81%AE%E4%BD%BF%E7%94%A8%E3%81%AB%E3%81%A4%E3%81%84%E3%81%A6%E8%AA%BF%E6%9F%BB%E3%81%97%E3%81%A6%E3%81%84%E3%81%BE%E3%81%99%E3%80%82%E3%82%B5%E3%83%96%E3%82%A4%E3%83%B3%E3%82%BF%E3%83%BC%E3%83%97%E3%83%AA%E3%82%BF%E3%81%AF%E7%8B%AC%E7%AB%8B%E3%81%97%E3%81%A6%E3%81%8A%E3%82%8A%E3%80%81%E3%82%B5%E3%83%96%E3%82%A4%E3%83%B3%E3%82%BF%E3%83%BC%E3%83%97%E3%83%AA%E3%82%BF%E3%82%92%E3%82%B7%E3%83%A3%E3%83%83%E3%83%88%E3%83%80%E3%82%A6%E3%83%B3%E3%81%99%E3%82%8B%E3%81%A8%20Python%20%E3%81%AE%E3%82%B7%E3%83%A3%E3%83%83%E3%83%88%E3%83%80%E3%82%A6%E3%83%B3%E3%81%A8%E5%86%8D%E8%B5%B7%E5%8B%95%E3%81%AE%E3%82%88%E3%81%86%E3%81%AB%E5%8B%95%E4%BD%9C%E3%81%99%E3%82%8B%E3%81%A8%E3%81%84%E3%81%86%E8%80%83%E3%81%88%E3%81%AB%E5%9F%BA%E3%81%A5%E3%81%84%E3%81%A6%E3%81%84%E3%81%BE%E3%81%99%E3%80%82%E7%8F%BE%E6%99%82%E7%82%B9%E3%81%A7%E3%81%AF%E3%80%81JMP%20%E3%82%BB%E3%83%83%E3%82%B7%E3%83%A7%E3%83%B3%E3%81%AE%E5%AD%98%E7%B6%9A%E6%9C%9F%E9%96%93%E4%B8%AD%E3%81%AB%E3%83%A1%E3%82%A4%E3%83%B3%E3%81%AE%20Python%20%E3%82%A4%E3%83%B3%E3%82%BF%E3%83%BC%E3%83%97%E3%83%AA%E3%82%BF%E3%82%92%E5%AE%89%E5%85%A8%E3%81%AB%E3%82%B7%E3%83%A3%E3%83%83%E3%83%88%E3%83%80%E3%82%A6%E3%83%B3%E3%81%97%E3%81%A6%E5%86%8D%E8%B5%B7%E5%8B%95%E3%81%99%E3%82%8B%E6%96%B9%E6%B3%95%E3%81%AF%E8%A6%8B%E3%81%A4%E3%81%8B%E3%81%A3%E3%81%A6%E3%81%84%E3%81%BE%E3%81%9B%E3%82%93%E3%80%82%3C%2FP%3E%0A%3CP%3E%20%3C%2FP%3E%0A%3CP%3E%E7%8F%BE%E5%9C%A8%E3%81%AEPython%E3%81%AE%E3%83%A2%E3%82%B8%E3%83%A5%E3%83%BC%E3%83%AB%E5%86%8D%E3%83%AD%E3%83%BC%E3%83%89%E3%81%AE%E6%85%A3%E4%BE%8B%EF%BC%88Python%203.4%E4%BB%A5%E9%99%8D%EF%BC%89%E3%81%AF%E3%80%81%3C%2FP%3E%0A%3CPRE%20class%3D%22lang-py%20s-code-block%22%3E%3CCODE%20class%3D%22hljs%20language-python%22%20data-highlighted%3D%22yes%22%3E%3CSPAN%20class%3D%22hljs-keyword%22%3Eimport%3C%2FSPAN%3E%20importlib%0Aimportlib.reload(modulename)%3C%2FCODE%3E%3C%2FPRE%3E%0A%3CP%3E%E3%82%B7%E3%82%B9%E3%83%86%E3%83%A0%E3%82%92%E3%83%AA%E3%83%AD%E3%83%BC%E3%83%89%E3%81%97%E3%82%88%E3%81%86%E3%81%A8%E3%81%99%E3%82%8B%E3%81%A8%3C%2FP%3E%0A%3CPRE%3E%26gt%3B%26gt%3B%26gt%3B%20importlib.reload(sys)%0A%3CMODULE%3E%3C%2FMODULE%3E%3C%2FPRE%3E%0A%3CP%3Enumpy%20%E3%82%92%E3%83%AA%E3%83%AD%E3%83%BC%E3%83%89%E3%81%99%E3%82%8B%E3%81%A8%E3%80%81%E6%AC%A1%E3%81%AE%E5%87%BA%E5%8A%9B%E3%81%8C%E5%BE%97%E3%82%89%E3%82%8C%E3%81%BE%E3%81%99...%3C%2FP%3E%0A%3CPRE%3E%26gt%3B%26gt%3B%26gt%3B%20importlib.reload(np)%0A%2FLibrary%2FFrameworks%2FPython.framework%2FVersions%2F3.11%2Flib%2Fpython3.11%2Fimportlib%2F__init__.py%3A169%3A%20UserWarning%3A%20The%20NumPy%20module%20was%20reloaded%20(imported%20a%20second%20time).%20This%20can%20in%20some%20cases%20result%20in%20small%20but%20subtle%20issues%20and%20is%20discouraged.%0A%20%20_bootstrap._exec(spec%2C%20module)%0A%3CMODULE%3E%3C%2FMODULE%3E%3C%2FPRE%3E%0A%3CP%3EUserWarning%E3%81%AB%E6%B3%A8%E6%84%8F%E3%81%97%E3%81%A6%E3%81%8F%E3%81%A0%E3%81%95%E3%81%84%3A%3C%2FP%3E%0A%3CP%3E%E3%83%A6%E3%83%BC%E3%82%B6%E3%83%BC%E8%AD%A6%E5%91%8A%3A%20NumPy%20%E3%83%A2%E3%82%B8%E3%83%A5%E3%83%BC%E3%83%AB%E3%81%8C%E5%86%8D%E3%83%AD%E3%83%BC%E3%83%89%E3%81%95%E3%82%8C%E3%81%BE%E3%81%97%E3%81%9F%20(2%20%E5%9B%9E%E7%9B%AE%E3%81%AE%E3%82%A4%E3%83%B3%E3%83%9D%E3%83%BC%E3%83%88)%E3%80%82%E3%81%93%E3%82%8C%E3%81%AB%E3%82%88%E3%82%8A%E3%80%81%E5%B0%8F%E3%81%95%E3%81%84%E3%81%AA%E3%81%8C%E3%82%89%E3%82%82%E5%BE%AE%E5%A6%99%E3%81%AA%E5%95%8F%E9%A1%8C%E3%81%8C%E7%99%BA%E7%94%9F%E3%81%99%E3%82%8B%E5%A0%B4%E5%90%88%E3%81%8C%E3%81%82%E3%82%8A%E3%80%81%E6%8E%A8%E5%A5%A8%E3%81%95%E3%82%8C%E3%81%BE%E3%81%9B%E3%82%93%E3%80%82_bootstrap._exec(spec%2C%20module)%3C%2FP%3E%0A%3CP%3E%20%3C%2FP%3E%0A%3CP%3E%E3%83%A2%E3%82%B8%E3%83%A5%E3%83%BC%E3%83%AB%E3%82%92%E3%83%AA%E3%83%AD%E3%83%BC%E3%83%89%E3%81%99%E3%82%8B%E3%80%8C%E5%85%AC%E5%BC%8F%E3%80%8D%E3%81%AE%E6%96%B9%E6%B3%95%E3%81%A7%E3%81%82%E3%81%A3%E3%81%A6%E3%82%82%E3%80%81%E5%95%8F%E9%A1%8C%E3%81%8C%E7%99%BA%E7%94%9F%E3%81%99%E3%82%8B%E5%8F%AF%E8%83%BD%E6%80%A7%E3%81%8C%E3%81%82%E3%82%8A%E3%81%BE%E3%81%99%E3%80%82%3C%2FP%3E%0A%3CP%3Eimportlib.reload()%20%E3%81%AF%E3%80%81%E3%83%A2%E3%82%B8%E3%83%A5%E3%83%BC%E3%83%AB%E3%81%AE%E3%82%BD%E3%83%BC%E3%82%B9%E3%81%B8%E3%81%AE%E5%A4%89%E6%9B%B4%E3%81%8C%E3%83%AA%E3%83%AD%E3%83%BC%E3%83%89%E3%81%BE%E3%81%A7%E5%8F%8D%E6%98%A0%E3%81%95%E3%82%8C%E3%81%AA%E3%81%84%E3%81%9F%E3%82%81%E3%80%81%E3%82%B3%E3%83%BC%E3%83%89%E5%86%85%E3%81%A7%20Python%20%E3%83%A2%E3%82%B8%E3%83%A5%E3%83%BC%E3%83%AB%E3%82%92%E9%96%8B%E7%99%BA%E3%81%99%E3%82%8B%E5%A0%B4%E5%90%88%E3%81%AB%E6%9C%80%E9%81%A9%E3%81%A7%E3%81%99%E3%80%82%E3%81%93%E3%82%8C%E3%81%AB%E3%82%88%E3%82%8A%E3%80%81Python%20%E3%82%B3%E3%83%BC%E3%83%89%E3%81%AE%20.pyc%20%E3%81%B8%E3%81%AE%E5%86%8D%E3%82%B3%E3%83%B3%E3%83%91%E3%82%A4%E3%83%AB%E3%81%8C%E5%BC%B7%E5%88%B6%E3%81%95%E3%82%8C%E3%82%8B%E5%8F%AF%E8%83%BD%E6%80%A7%E3%81%8C%E3%81%82%E3%82%8A%E3%81%BE%E3%81%99%E3%80%82%3C%2FP%3E%3C%2FLINGO-BODY%3E
Choose Language Hide Translation Bar
jthi
Super User

Is there a way to reset JMP Python integrations Python side

Is there any way how I could clear "everything" in the Python side of JMP without closing the JMP session (something similar to Delete Symbols() in JSL or a way to restart the kernel)?

 

I'm developing application utilizing JMP Python integration with my colleague and as we make changes to the Python code we have to keep constantly closing JMP. We do this to "clear" the Python as we run into issues where old Python code is in the memory and imports won't overwrite already imported code.

-Jarmo
1 ACCEPTED SOLUTION

Accepted Solutions

Re: Is there a way to reset JMP Python integrations Python side

There are issues.  In most Python scripts, the issue isn't noticed much because the lifetime of Python itself is usually the same as the script.  You would begin to notice if you ran Python interactively for a long session, doing multiple things within the same interactive session.  This is further complicated by some of the Python packages are implemented in C/C++ ( and even Fortran ) such as NumPy.  Python loads these as shared libraries, and there is no safe way to unload the shared library from a running process, other than a restart.  JMP is in a similar position with the Python shared library itself, it can't be unloaded.  Yes, del works to release objects. However, del sys isn't doing what you might expect.  This isn't deleting or unloading the 'module' or unloading dependent dlls, it's simply deleting the 'sys' object that's holding the references to the loaded module.  The other aspect is that sys is a Python built-in module, not the same as a loaded module.  Further deleting 'sys' doesn't clean up any changes you may have made, for example appending another path to sys.path.

 

If you do:

 

sys.path.append('/usr/local/bin')
print(sys.path)
del sys
print(sys.path).  # gives error on sys
import sys
print(sys.path).  # still contains the /usr/local/bin addition

The above was run in an interactive session in a terminal window.  Only exiting Python and restarting cleared the /usr/local/bin from sys.path.  The only real way is for you to keep track of all the variables used in a session and then delete them at the end of the 'session'.  One way would be to put each variable in a list, or dictionary, then delete the container at the end of the session. 

I am researching the use of Python sub-interpreters which could allow setting up code that doesn't run in the global environment, the idea being the sub-interpreter is independent, and shutting down the sub-interpreter would act like a shut down and restart of Python. At present, I haven't found a way to safely shut down and restart the main Python interpreter within the lifetime of a JMP session.

 

 The current Python practice to reload a module ( starting with Python 3.4) is

import importlib
importlib.reload(modulename)

Trying to reload sys gives

>>> importlib.reload(sys)
<module 'sys' (built-in)>

Reloading numpy, gives the following output...

>>> importlib.reload(np)
/Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/importlib/__init__.py:169: UserWarning: The NumPy module was reloaded (imported a second time). This can in some cases result in small but subtle issues and is discouraged.
  _bootstrap._exec(spec, module)
<module 'numpy' from '/Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/site-packages/numpy/__init__.py'>

Note the UserWarning:

UserWarning: The NumPy module was reloaded (imported a second time). This can in some cases result in small but subtle issues and is discouraged. _bootstrap._exec(spec, module)

 

Even with the 'official' way of reloading a module can cause issues.  

importlib.reload() works great for when you are developing a Python module in code, since changes to the a module's source will not be reflected until a reload.  Which potentially forces a recompile to .pyc of the Python code.

View solution in original post

2 REPLIES 2
hogi
Level XII

Re: Is there a way to reset JMP Python integrations Python side

Updated modules which are ignored. Many suprises and wonders - till you notice...
Argh!

 

does del work?

import sys
print(sys.path)
del sys
print(sys.path)

Re: Is there a way to reset JMP Python integrations Python side

There are issues.  In most Python scripts, the issue isn't noticed much because the lifetime of Python itself is usually the same as the script.  You would begin to notice if you ran Python interactively for a long session, doing multiple things within the same interactive session.  This is further complicated by some of the Python packages are implemented in C/C++ ( and even Fortran ) such as NumPy.  Python loads these as shared libraries, and there is no safe way to unload the shared library from a running process, other than a restart.  JMP is in a similar position with the Python shared library itself, it can't be unloaded.  Yes, del works to release objects. However, del sys isn't doing what you might expect.  This isn't deleting or unloading the 'module' or unloading dependent dlls, it's simply deleting the 'sys' object that's holding the references to the loaded module.  The other aspect is that sys is a Python built-in module, not the same as a loaded module.  Further deleting 'sys' doesn't clean up any changes you may have made, for example appending another path to sys.path.

 

If you do:

 

sys.path.append('/usr/local/bin')
print(sys.path)
del sys
print(sys.path).  # gives error on sys
import sys
print(sys.path).  # still contains the /usr/local/bin addition

The above was run in an interactive session in a terminal window.  Only exiting Python and restarting cleared the /usr/local/bin from sys.path.  The only real way is for you to keep track of all the variables used in a session and then delete them at the end of the 'session'.  One way would be to put each variable in a list, or dictionary, then delete the container at the end of the session. 

I am researching the use of Python sub-interpreters which could allow setting up code that doesn't run in the global environment, the idea being the sub-interpreter is independent, and shutting down the sub-interpreter would act like a shut down and restart of Python. At present, I haven't found a way to safely shut down and restart the main Python interpreter within the lifetime of a JMP session.

 

 The current Python practice to reload a module ( starting with Python 3.4) is

import importlib
importlib.reload(modulename)

Trying to reload sys gives

>>> importlib.reload(sys)
<module 'sys' (built-in)>

Reloading numpy, gives the following output...

>>> importlib.reload(np)
/Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/importlib/__init__.py:169: UserWarning: The NumPy module was reloaded (imported a second time). This can in some cases result in small but subtle issues and is discouraged.
  _bootstrap._exec(spec, module)
<module 'numpy' from '/Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/site-packages/numpy/__init__.py'>

Note the UserWarning:

UserWarning: The NumPy module was reloaded (imported a second time). This can in some cases result in small but subtle issues and is discouraged. _bootstrap._exec(spec, module)

 

Even with the 'official' way of reloading a module can cause issues.  

importlib.reload() works great for when you are developing a Python module in code, since changes to the a module's source will not be reflected until a reload.  Which potentially forces a recompile to .pyc of the Python code.