python怎么隐藏代码-如何在python中隐藏方法?

  • Post author:
  • Post category:python


我只是想知道,如何隐藏特殊

__.*__

python*中的方法?尤其是我正在使用一个带有制表符完成的交互式Python解释器,我只想显示我的模块公开的方法…

谢谢,

Myyn/

*(至少来自使用python shell的用户)

现在看起来是这样的:

h[2] >>> Q.

Q.ALL( Q.__delattr__( Q.__getattribute__(

Q.__package__ Q.__sizeof__( Q.find_values(

Q.json

Q.DEFAULT_CONDITION( Q.__dict__ Q.__hash__(

Q.__reduce__( Q.__str__( Q.get_loops_total_platform(

Q.jsonlib

Q.SUCCESSFUL( Q.__doc__ Q.__init__(

Q.__reduce_ex__( Q.__subclasshook__( Q.get_platforms(

Q.memoize(

Q.__all__ Q.__file__ Q.__name__

Q.__repr__( Q.cached_open( Q.get_snippets(

Q.__class__( Q.__format__( Q.__new__(

Q.__setattr__( Q.find_results( Q.get_subjects(

h[2] >>> Q.

我希望它看起来像:

h[2] >>> Q.

Q.ALL( Q.find_values( Q.json

Q.DEFAULT_CONDITION( Q.get_loops_total_platform(

Q.jsonlib Q.SUCCESSFUL( Q.get_platforms(

Q.memoize( Q.cached_open( Q.get_snippets(

Q.find_results( Q.get_subjects(

h[2] >>> Q.