有人使用 Python 进行嵌入式项目吗?

2023-11-07Python开发问题
1

本文介绍了有人使用 Python 进行嵌入式项目吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着跟版网的小编来一起学习吧!

问题描述

我的公司正在将 Python 用于一个相对简单的嵌入式项目.还有其他人在嵌入式平台上使用 Python 吗?总的来说,它对我们来说效果很好,可以快速开发应用程序,快速调试.我喜欢这种语言的整体简洁".

My company is using Python for a relatively simple embedded project. Is anyone else out there using Python on embedded platforms? Overall it's working well for us, quick to develop apps, quick to debug. I like the overall "conciseness" of the language.

我在日常工作中遇到的唯一真正问题是,与常规编译器相比,缺少静态检查可能会导致在运行时引发问题,例如一个简单的意外 cat 字符串和 print 语句中的 int 可能会导致整个应用程序崩溃.

The only real problem I have in day to day work is that the lack of static checking vs a regular compiler can cause problems to be thrown at run-time, e.g. a simple accidental cat of a string and an int in a print statement can bring the whole application down.

推荐答案

我们在很多地方都使用python 带有 ARM 处理器的嵌入式板卡 和 16 MB 的 RAM(运行 linux).

We use python in quite a lot of embedded boards with ARM processors and 16 MB of RAM (running linux).

它工作得非常好,而且很容易快速编写自定义代码——这是 python 的强项之一.

It works really well and is really easy to make custom code quickly - one of the strong points of python.

至于代码的可靠性 - 我们尝试实现 100% 的测试覆盖率.用 python 编写测试非常快,它会给你一种美妙的自信感.我们使用 twisted trial 来运行测试并报告覆盖率,但还有许多其他工具可用.

As for reliability of the code - we try to have 100% test coverage. Writing tests with python is very quick and it gives you a wonderful feeling of confidence. We use twisted trial to run the tests and report on coverage, but there are many other tools available.

根据我的经验,python + 测试比任何其他替代方案更可靠且编写速度更快.

In my experience python + tests is more reliable and much quicker to write than any other alternatives.

嵌入式工作的唯一缺点是有时 python 可能很慢,有时它使用大量内存(相对而言).这还没有给我们带来节目停止问题,如果它成为问题,python 很容易分析速度和内存.

The only downsides for embedded work is that sometimes python can be slow and sometimes it uses a lot of memory (relatively speaking). This hasn't causes us a show stopping problem yet, and python is quite easy to profile for both speed and memory if it becomes a problem.

pychecker 也是一个非常有用的工具,它可以捕获很多常见错误.

pychecker is a very useful too also which will catch quite a lot of common errors.

这篇关于有人使用 Python 进行嵌入式项目吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

The End

相关推荐

在xarray中按单个维度的多个坐标分组
groupby multiple coords along a single dimension in xarray(在xarray中按单个维度的多个坐标分组)...
2024-08-22 Python开发问题
15

Pandas中的GROUP BY AND SUM不丢失列
Group by and Sum in Pandas without losing columns(Pandas中的GROUP BY AND SUM不丢失列)...
2024-08-22 Python开发问题
17

pandas 有从特定日期开始的按月分组的方式吗?
Is there a way of group by month in Pandas starting at specific day number?( pandas 有从特定日期开始的按月分组的方式吗?)...
2024-08-22 Python开发问题
10

GROUP BY+新列+基于条件的前一行抓取值
Group by + New Column + Grab value former row based on conditionals(GROUP BY+新列+基于条件的前一行抓取值)...
2024-08-22 Python开发问题
18

PANDA中的Groupby算法和插值算法
Groupby and interpolate in Pandas(PANDA中的Groupby算法和插值算法)...
2024-08-22 Python开发问题
11

PANAS-基于列对行进行分组,并将NaN替换为非空值
Pandas - Group Rows based on a column and replace NaN with non-null values(PANAS-基于列对行进行分组,并将NaN替换为非空值)...
2024-08-22 Python开发问题
10