Programming with hardware in python [closed]

2019-01-30 20:23发布

I am starting to get a bit bored of programming little toys that I have been making recently, and I would love to starting programming and interacting with hardware.

The only problem is that I am mostly a python guy who hasn't really learned or used any other language. Can I still interact with hardware with python?

Also, what hardware can I interact with? I don't really have stuff lying around that I can use, so I would have to buy a kit or something. What are some cheap options for this?

9条回答
趁早两清
2楼-- · 2019-01-30 21:06

You can use ctypes for interfacing with hardware. It'll let you call into native libraries, so you can essentially use it to do anything that C can do. This is of course assuming that you want to interact with hardware via your host computer running Python.

I've used ctypes for a couple of projects:

I found it generally pretty easy to use, but it helped that I already knew C/C++.

查看更多
狗以群分
3楼-- · 2019-01-30 21:07

Many pc's still have parellel ports, and a python module exists for interacting with the parallel port, though I haven't used it.

The parallel port may be the simplest way to start controlling hardware, as you can attach the simplest of electronics to it. Just an led will get you something visible straight away.

Then, as Jon Cage mentions, you could get a Pic programmer

查看更多
小情绪 Triste *
4楼-- · 2019-01-30 21:14

The new Raspberry Pi devices have a good range of I/O and Python seems to be the most commonly used language for them.

查看更多
登录 后发表回答