Go to advanced search

by bryancole
Sat Jul 06, 2013 11:12 am
Forum: Graphics programming
Topic: GUI design tool selection
Replies: 3
Views: 4440

Re: GUI design tool selection

This is kinda challenging because the Pi GUIs are (at the moment) not hardware accelerated, which means that drawing a plot in real time is not easy. Certainly. you wouldn't expect matlab to run on the Pi. Thee are a couple of approaches which *might* be OK: - Use PyQt with PyQwt. Qwt is a technical...
by bryancole
Sun Apr 21, 2013 4:31 pm
Forum: Python
Topic: Experience of creating Python to C interpreter libraries?
Replies: 9
Views: 2086

Re: Experience of creating Python to C interpreter libraries

Python's socket object has a class method constructor socket.fromfd(fd, family, type[, proto]) (see module docs). This lets you construct a python socket from a raw file descriptor.
by bryancole
Fri Apr 19, 2013 11:15 am
Forum: Python
Topic: Experience of creating Python to C interpreter libraries?
Replies: 9
Views: 2086

Re: Experience of creating Python to C interpreter libraries

I'm not totally clear what you're asking so excuse me if this is not of interest, but one excellent way to write python C-extensions is using Cython (www.cython.org). Cython compiles pure python code to a C module using the python API. The Cython language also extends python allowing you to add C ty...
by bryancole
Mon Oct 29, 2012 1:19 pm
Forum: OpenVG
Topic: How to get key input in OpenVG
Replies: 1
Views: 3067

Re: How to get key input in OpenVG

You can simply read bytes from the keyboard device file (/dev/input/keyboard or something like that - I don't have my rpi to hand to check). You need a key-map to convert the keyboard key code to a letter/symbol. As to drawing text, you need to calculate some paths for each glyph you want to render....
by bryancole
Thu Aug 09, 2012 7:31 am
Forum: Python
Topic: Data Structure Class
Replies: 18
Views: 2921

Re: Data Structure Class

(yeay Iain M Banks!) I'd just like to mention the concept of "namespaces" as a means of organising data. In python, the easiest way to define a namespace is with a class definition (another way is to use a module). If your data is truely global (i.e. you want the same values to be available to every...
by bryancole
Wed Jun 27, 2012 7:07 am
Forum: Python
Topic: RS232, PLC and Python.
Replies: 9
Views: 7734

Re: RS232, PLC and Python.

To comment on your question about saving acquisitions to a file: you can use a txt-file if you like, but pythom makes a few other options available. sqlite is an embedded SQL database which comes with python and is good for relational or table-like data. If your acquisitions comprise a block of numb...
by bryancole
Wed Jun 27, 2012 6:27 am
Forum: Python
Topic: RS232, PLC and Python.
Replies: 9
Views: 7734

Re: RS232, PLC and Python.

For RS232, you need the PySerial package. See

http://pyserial.sourceforge.net/

On linux, it's a fairly simple wrapper for the /dev/ttyS* serial port devices but it makes RS232 access fairly painless.

HTH
BC
by bryancole
Fri Jun 15, 2012 8:13 am
Forum: Python
Topic: ANN: Python bindings to OpenVG on the RPi
Replies: 0
Views: 2147

ANN: Python bindings to OpenVG on the RPi

For anyone interested in hardware accelerated 2D graphics on the RPi, I want to publicise some python bindings to the OpenVG API on the RPi. The code is available at: https://bitbucket.org/bryancole/rpi_vid_core As with the GLES bindings, these operate outside of X-windows. You need to have Cython i...
by bryancole
Sun Jun 10, 2012 7:56 am
Forum: Python
Topic: Running compiled code
Replies: 3
Views: 3890

Re: Running compiled code

".pyc" files contain python bytecode. When you run python source code, it gets compiled to bytecode for the interpreter to run (this always happens - it's how python works). You can run bytecode files without the source-code but they do not run any faster. The python bytecode compilation only speeds...

Go to advanced search