editorPane.setText("<html><head><style>" +
"p {font-family: Segoe UI; font-size:14;}" +
"</style></head>" +
"<body><p>It Works!</p></body></html>");
func collectionView(_ collectionView: UICollectionView, cellForItemAt indexPath: IndexPath) -> UICollectionViewCell
{
// Add More Photos Cell
if indexPath.item == 0
{
let cell = collectionView.dequeueReusableCell(withReuseIdentifier: "AddMorePhotosCell", for: indexPath) as! AddMorePhotosCell
return cell
}
// Photos Cell
else
{
// offset the index by -1 for the FirstCell
let asset = assets[indexPath.item - 1]
// the rest of the stuff
}
}
包含# setup.py
from setuptools import setup
from setuptools.command.install import install
from subprocess import check_call
class CustomInstall(install):
def run(self):
check_call("./build.sh")
install.run(self)
setup(
name='customlib',
packages=['customlib'],
version='0.0.1',
...
cmdclass={'install': CustomInstall}
)
步骤,超过10分钟完成。
是否有PyPi方法“打包”build.sh
的输出以加快make & make install
进程?
答案 0 :(得分:1)
使用wheel。轮是传递Python包的一种很好的标准格式,它可以包含为各种体系结构编译的C代码。 PyPI支持为项目上传轮子,pip会在可用时下载它们。
非常有用的文档可以在这里找到:https://packaging.python.org/tutorials/distributing-packages/#packaging-your-project