Can I detect if my code is running on cPython or Jython?

后端 未结 5 993
伪装坚强ぢ
伪装坚强ぢ 2020-12-07 00:49

I\'m working on a small django project that will be deployed in a servlet container later. But development is much faster if I work with cPython instead of Jython. So what I

5条回答
  •  野趣味
    野趣味 (楼主)
    2020-12-07 01:21

    if you're running Jython

    import platform
    platform.system()  
    

    return 'Java'
    here has some discussion, hope this helps.

提交回复
热议问题