微信公众号搜"智元新知"关注
微信扫一扫可直接关注哦!

检测用户是否正在运行bpython shell

如何解决检测用户是否正在运行bpython shell

我想检测用户是否正在运行bpython shell。

我环顾四周,但找不到任何有用的东西。例如,尝试导入bpython并依靠它是错误的肯定结果,因为用户可以安装bpython但实际上运行的是完全不同的shell。

有没有很好的方法

解决方法

以下内容可在我的系统上工作,但我不确定它的可移植性:

const Triangle = ({ position,color }) => {
  const mesh = useRef(null);
  return (
    <mesh castShadow ref={mesh} position={position}>
      <tetrahedronGeometry
        attach="geometry"
        args={[0.6,0]}
        applyMatrix={new THREE.Matrix4().makeRotationAxis(
          new THREE.Vector3(2,-1).normalize(),Math.atan(Math.sqrt(2))
        )}
      />
      <meshStandardMaterial attach="material" color={color} />
    </mesh>
  );
};

请注意,可以通过将非bpython解释器重命名为import sys from pathlib import Path executable_name = Path(sys.argv[0]).name is_bpython = executable_name == 'bpython' 或将bpython重命名为其他方法来轻易地欺骗该方法。

版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。