Home  >  Q&A  >  body text

shadowsocks - python中hasattr(sys, "frozen")是什么意思?

最近在看shadowsocks源代码,有些地方不是很懂,比如如下代码中的frozen是啥意思?官方文档没有查到~

# fix py2exe
    if hasattr(sys, "frozen") and sys.frozen in \
            ("windows_exe", "console_exe"):
        p = os.path.dirname(os.path.abspath(sys.executable))
        os.chdir(p)
巴扎黑巴扎黑2740 days ago1879

reply all(1)I'll reply

  • PHPz

    PHPz2017-04-18 09:45:58

    Related to the cx_freeze library. This is a library used to package programs into exe under windows and inject a variable frozen into sys.

    reply
    0
  • Cancelreply