小编Hec*_*Hec的帖子

在python altinstall期间./configure --enable-shared究竟做了什么?

当我用python 2.7.12 altinstall时

./configure --prefix =/opt/python --enable-shared

它出现为python 2.7.5(系统默认python)

但没有

--enable共享

它出现在2.7.12,我错过了什么?

这是RHEL 7.2


这不是一个路径问题:

没有--enable-shared

[root @myrig~]#/ opt/python/bin/python2.7 -V

Python 2.7.12

使用--enable-shared

[root @myrig~]#/ opt/python/bin/python2.7 -V

Python 2.7.5

python python-2.7

13
推荐指数
3
解决办法
1万
查看次数

How to make dynamic stub functions on the fly?

I have a class with about 200 stub functions, they look something like this:

def name1(self, **kwargs):
    return self.run('name-1', kwargs)

def name2(self, ** kwargs):
    return self.run('name-2', kwargs)
Run Code Online (Sandbox Code Playgroud)

So on and so forth.

There is a run function that takes care of the real work.

I want to reduce the 200 stub function to just 1 dynamic function that gets called when you make a call to the class with a method name that doesn't exist.

How do I do this?

python

5
推荐指数
1
解决办法
565
查看次数

标签 统计

python ×2

python-2.7 ×1