我正在尝试创建一个自己的包.包非常简单,它有一个python模块和一个bash脚本.我想把它们都安装好,/usr/local/bin以便它们可以直接执行.
这是我的setup.py档案:
from setuptools import setup
setup(
name='deploy',
.
.
.
install_requires=['pyyaml', 'cot', 'jsonschema'],
entry_points={
'console_scripts': [
'cloud_config = cloud_config:main',
],
},
scripts=['deploy.sh'],
)
Run Code Online (Sandbox Code Playgroud)
以下是输出的摘录pip install ...:
running install_scripts
copying build/scripts-2.7/deploy.sh -> /usr/local/lib/python2.7.10/bin
changing mode of /usr/local/lib/python2.7.10/bin/deploy.sh to 755
Installing cloud_config script to /usr/local/lib/python2.7.10/bin
Run Code Online (Sandbox Code Playgroud)
有了这个,我无法直接调用python或bash脚本.
有任何想法吗?
编辑:我运行pip的Ubuntu 16.04.1机器.只是尝试在Ubuntu 14.04机器上安装相同的包,行为是预期的.cloud_config.py并且deploy.sh都安装到了/usr/local/bin,我可以从系统的任何地方调用它们.
When I hover my mouse over an error/warning in VSCode, the documentation for that item appears by default. To actually check the error, I need to scroll down. Is there a way to show the error/warning above the documentation by giving it a higher priority?
Example: The documentation for Response is shown by default (1st screenshot). But I'm interested in the error, which is visible only after I scroll down (2nd screenshot).
使用Python 3,我有一个包含超过100,000个字符串(list1)的列表,每个字符串最多300个字符.我还有一个包含超过900万个子串的列表(list2) - 我想计算list2中子串的元素数量.例如,
list1 = ['cat', 'caa', 'doa', 'oat']
list2 = ['at', 'ca', 'do']
Run Code Online (Sandbox Code Playgroud)
我希望函数返回(映射到list2):
[2, 2, 1]
Run Code Online (Sandbox Code Playgroud)
通常,这非常简单,只需要很少.但是,由于列表的大小,我有效率问题.我想找到返回该计数器列表的最快方法.
我已经尝试过列表推导,生成器,地图,各种循环,我还没有找到一种快速的方法来完成这项简单的任务.理论上什么是完成这个目标的最快方法,最好O(len(list2))是快速采取措施?
我有wordpress启用的网站,我想创建一个功能块.这个特色区块的特色文章将陆续褪色.我把它用在工作fadeIn和fadeOutjQuery的的API,但是,有与执行问题.
这是我的代码 -
var count=0;
var sticky_count=<?php echo count($sticky);?>;
jQuery(document).ready(featured_block);
function featured_block() {
jQuery(".featured" + count % sticky_count).delay(5000).fadeOut(callback);
}
function callback() {
count++;
jQuery(".featured" + count % sticky_count).fadeIn().delay(5000);
jQuery(".featured" + count % sticky_count).fadeOut(callback);
}
Run Code Online (Sandbox Code Playgroud)
本fadeIn- fadeOut直到用户导航到页面底部的效果是工作的罚款.当用户位于页面底部时,当淡入淡出切换发生时,整个页面会向上滚动.
您可以在http://www.ronakg.com上看到这一点
请告知我如何避免页面滚动.
编辑:以下是HTML代码的样子 -
<div class="featured0">
...
</div>
<div class="featured1" style="display:none">
...
</div>
...
Run Code Online (Sandbox Code Playgroud) 我正在使用Github 上的CODEOWNERS文件来设置基于文件/文件夹的自动拉取请求审阅者。该系统运行良好,审阅者会自动添加到拉取请求中。
但是,我想仅针对发布分支而不是针对私有分支来限制此设置。当一个私有分支从发布分支中移除时,它也会获取CODEOWNERS文件,然后所有“拉取请求的自动审查者”设置。
有没有办法确保CODEOWNERS文件仅适用于特定分支?或者确保这个特定文件根本不会同步到其他分支的方法?
同样,我怎么找到$VIMRUNTIME?
我yum install vim-X11 vim-common vim-enhanced vim-minimal在CentOS 6.3上安装了vim