跳转到主要内容

用Python控制徕卡显微镜

项目描述

leicacam

build-badge pypi-version wheel Documentation Status

概述

用Python控制徕卡显微镜

安装

  • leicacam的最新版本需要Python 3.5+
  • 如果您需要继续使用Python 2.7,请将leicacam的版本锁定在0.3.0。

使用pip安装

pip3 install leicacam

示例

与显微镜通信

from leicacam import CAM

cam = CAM()   # initiate and connect, default localhost:8895

# some commands are created as short hands
# start matrix scan
response = cam.start_scan()
print(response)

# but you could also create your own command with a list of tuples
command = [('cmd', 'enableall'),
           ('value', 'true')]
response = cam.send(command)
print(response)

# or even send it as a bytes string (note the b)
command = b'/cmd:enableall /value:true'
response = cam.send(command)
print(response)

文档

请参阅API参考中可用的命令: http://leicacam.rtfd.org

开发

安装依赖项并将leicacam的开发版本链接到pip

pip install -r requirements_dev.txt

代码格式化

我们使用black代码格式化器来自动格式化代码。这需要Python 3.6进行开发。

black ./

测试

tox

本地构建文档

要构建文档

pip install -r docs/requirements.txt
make docs

项目详情


下载文件

下载适用于您平台的文件。如果您不确定选择哪个,请了解更多关于 安装包 的信息。

源代码分发

leicacam-0.4.2.tar.gz (11.1 kB 查看哈希值)

上传时间 源代码

构建分发

leicacam-0.4.2-py3-none-any.whl (8.2 kB 查看哈希值)

上传时间 Python 3

支持