好吧,在我的environment.py文件中,我可以通过以下方式记录东西:
logging.basicConfig(level=logging.DEBUG, filename="example.log")
def before_feature(context, feature):
logging.info("test logging")
Run Code Online (Sandbox Code Playgroud)
但当我在步骤文件中时,我无法执行日志记录:
logger = logging.getLogger(__name__)
logger.setLevel(logging.DEBUG)
@given("we have a step")
def step_impl(context):
logger.debug("Test logging 2")
Run Code Online (Sandbox Code Playgroud)
步骤内的日志消息不会显示.我正在使用python行为模块.有任何想法吗?
我在运行行为时尝试启用和禁用logcapture,但它没有任何区别.
我有这个超级简单的webapp,我可以通过Firefox Marketplace或Chrome Web Store作为应用程序安装,只需编辑简单的清单文件.现在使用威斯敏斯特项目我想将此应用程序推送到Windows应用商店.但是,在查看开发人员站点时,我发现只有非Visual Studio指南"即将推出",但我并不是在为微软支持非Windows开发人员而屏住呼吸.
那么,有没有人写过一篇博文或类似的东西来解释如何在非Windows平台上创建一个Windows应用商店应用程序(在我的情况下是Linux,但我想Mac OS X上的朋友也会以同样的方式受到影响)?或者它是不可能的,并且必须有一些Windows Gizmo来创建应用程序?
我期待使用pip安装hunspell软件包,但会引发以下错误:
Collecting hunspell
Using cached hunspell-0.4.1.tar.gz
Building wheels for collected packages: hunspell
Running setup.py bdist_wheel for hunspell ... error
Complete output from command /root/anaconda3/bin/python -u -c "import setuptools, tokenize;__file__='/tmp/pip-build-oyfpp3iy/hunspell/setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" bdist_wheel -d /tmp/tmphqvqt4lxpip-wheel- --python-tag cp34:
/root/anaconda3/lib/python3.4/distutils/extension.py:132: UserWarning: Unknown Extension options: 'compile_args', 'macros'
warnings.warn(msg)
running bdist_wheel
running build
running build_ext
building 'hunspell' extension
creating build
creating build/temp.linux-x86_64-3.4
gcc -pthread -fno-strict-aliasing -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -fPIC -I/usr/include/hunspell -I/root/anaconda3/include/python3.4m -c hunspell.c -o build/temp.linux-x86_64-3.4/hunspell.o
hunspell.c:21:22: erreur fatale: hunspell.h …
Run Code Online (Sandbox Code Playgroud) 我试图将我的脚本从使用线程转换为更酷的多处理(使用python 3.2和concurrent.futures
,但是这段代码崩溃了
with ThreadPoolExecutor(max_workers=MAX_THREADS) as executor:
for result in executor.map(lambda h:
validate_hostname(h, pci_ids, options.verbose),
get_all_hostnames()):
Run Code Online (Sandbox Code Playgroud)
我收到错误_pickle.PicklingError: Can't pickle <class 'function'>: attribute lookup builtins.function failed
.在阅读这个答案时,我认为问题在于不可能将lambda函数作为参数,executor.map()
并且为了使executor.map()
我需要开发一个参数函数,但是那些pci_ids
并且options.verbose
是变量所以我不能将它们指定为固定的帮助功能中的值.
有什么想法怎么办?