[Image](/uploads/documents/d/c/f/f/dcff3d9f70403fc7fe9fcc283f05b024/p3_2.jpg)
## 先不讨论这些工具的优劣
先给大家介绍一下
如何使用c2
py来调用C++代码
## 在此之前给大家看一下要调用的C++代码源文件
• 我肯定是会拿上期所的API来作示范:
(看一眼就好了)
|Name|Size|
|---|---|
|ThostFtdcMdApi KB|
|ThostFtdcUserApiDataType.h|251 KB|
|ThostFtdcUserApiStruct.h|232 KB|
## c2
py的使用分两步走
· 第一步,生成.pyd (.so) 文件
|1|c2
py generate vnctp|||
|---|---|---|---|
|2|ThostFtdcMdApi.h|||
|3|ThostFtdcTraderApi mduserapi||
|14|--setup-lib|thosttraderapi||
|15|--setup-use-patches|||
|16||||
|17|python ./setup.
py build|||
• 第二步,调用代码,并享受完备的type hint。
| import vnctp |
0 码力 |
12 页 |
1.24 MB
| 2 年前 3 user commands 10
2.6 New CLI 10
2.7 New deployers 10
2.8 New package_id 11
2.9 compatibility.py 11
2.10 New lockfiles 11
2.11 New configuration and environment management 11
2.12 Multi-revision Conan commands examples ..... 259
8 Reference ..... 265
8.1 Commands ..... 265
8.2 conanfile.py ..... 372
8.3 conanfile.txt ..... 443
8.4 Recipe tools ..... 445
8.5 Configuration files ... package is defined by a “conanfile.py”. This is a file that defines the package’s dependencies, sources, how to build the binaries from sources, etc. One package “conanfile.py” recipe can generate any arbitrary 0 码力 |
694 页 |
4.13 MB
| 1 年前 3 用户无法访问该目录下以下划线开始的文件和目录。
例如,给定如下文件结构:
.
— A
— a. py
— B
— b. py
— c. py
三个 python 文件都含有 main PyWebIO 应用函数。
如果使用以上路径调用`path_deploy()`,你可以通过URL http:// :/A/b`来访问b.py文件中的PyWebIO应用。若文件在运行`path_deploy()`之后被 当请求一个文件夹时是否显示默认的索引页面,默认为 True。index 也可以为一个函数来自定义索引页面,其接收请求的文件夹路径作为参数,返回页面 HTML 字符串。你可以在文件夹中创建一个 index.py PyWebIO 应用文件来重写文件夹的索引页。
• static_dir (str) – 应用静态文件目录。目录下的文件可以通过 http://:/static/files PyWebIO 应用
## Django
使用pywebio.platform.django.webio_view()来获取在 Django 中运行 PyWebIO 应用的视图函数:
# urls.py
from Django.urls import path
from pywebio.platform.django import webio_view
# `task_func` is PyWebIO 0 码力 |
123 页 |
1.72 MB
| 2 年前 3 user commands 10
2.6 New CLI 10
2.7 New deployers 10
2.8 New package_id 11
2.9 compatibility.py 11
2.10 New lockfiles 11
2.11 New configuration and environment management 11
2.12 Multi-revision Conan runners examples ..... 292
8 Reference ..... 305
8.1 Commands ..... 305
8.2 conanfile.py ..... 427
8.3 conanfile.txt ..... 504
8.4 Recipe tools ..... 506
8.5 Configuration files ... package is defined by a “conanfile.py”. This is a file that defines the package’s dependencies, sources, how to build the binaries from sources, etc. One package “conanfile.py” recipe can generate any arbitrary 0 码力 |
795 页 |
4.99 MB
| 1 年前 3 this in a text file, name it to something like quotes_spider.py and run the spider using the runspider command:
scrapy runspider quotes_spider.py -o quotes.jl
When this finishes you will have in the quotes car.\u201d"}
...
## What just happened?
When you ran the command scrapy runspider quotes_spider.py, Scrapy looked for a Spider definition inside it and ran it through its crawler engine.
The crawl /site-packages/twisted/protocols/tls.py", line 63, in
from twisted.internet._sslverify import _setAcceptableProtocols
File "[...] /site-packages/twisted/internet/_sslverify.py", line 38, in 0 码力 |
354 页 |
1.39 MB
| 2 年前 3 management command.
Depending on exact setup, importing of the translation might look like:
$./manage.py import_project --name-template 'Documentation: %s'
--file-format po \
project https://github /manage.py import_project --name-template 'Directory 1: %s'
--file-format po \
project https://github.com/project/docs.git master \
'docs/locale/*/LC_MESSAGES/dir1/**.po'
$./manage.py import_project download a tarball) and unpack them, see Installing Weblate.
3. Copy weblate/settings_example.py to weblate/settings.py and adjust it to match your setup. You will at least need to configure database connection 0 码力 |
224 页 |
1.62 MB
| 2 年前 3
|