Posted by arkadian
on August 29, 2011
Components & Materials,
Linux /
Comments Off
29 Aug 2011
Omnima UK sell a tiny little board for less than £40, that runs on openWRT Linux and has ethernet, WiFi and a USB port. It seems to be a great base for simple projects, when we need more power than one arduino.
Link to product
I’ve ordered one to try something I have in mind.
Btw, at the openWRT site, there is a VM available. I downloaded and tried it yesterday, but I had problems connecting USB peripherals…. Never mind. I have to say I loved the web interface and the precompiled binaries and the fact you can ran python on it!
11 Sep 2011
I’ve now received the device. It runs Fonera (have a look at some screenshots and more info here). Easy to access through a web interface. I tried to load the latest Fonera software and it didn’t quite work; now the device won’t boot. I’m able to log in to it using telnet and a serial cable, but I haven’t been able to load the old bin file yet… I’ll keep you posted…
Tags: Linux, openWRT, Python
Posted by arkadian
on August 13, 2011
Python,
Uncategorized,
examples /
Comments Off
1
2
3
| import ImageGrab
img = ImageGrab.grab()
img.save('arkadian.png','PNG') |
A quick and easy way to take a snapshot of your current window.
You can always use JPG, but the quality is better in PNG.
Works in Windows and requires PIL.
Tags: PIL, Python
Posted by admin
on July 05, 2011
Python,
examples /
Comments Off
Here is a very simple python script that marges two pdf files, using the pyPDF library.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
| import os.path
import pyPdf
pdfOne = "C:\\a.pdf"
pdfTwo = "C:\\b.pdf"
merged = "C:\\c.pdf"
if os.path.exists(pdfOne) and os.path.exists(pdfTwo):
output = pyPdf.PdfFileWriter()
pdfOne = pyPdf.PdfFileReader(open(pdfOne, "rb"))
for page in range(pdfOne.getNumPages()):
output.addPage(pdfOne.getPage(page))
pdfTwo = pyPdf.PdfFileReader(open(pdfTwo, "rb"))
for page in range(pdfTwo.getNumPages()):
output.addPage(pdfTwo.getPage(page))
outputStream = open(merged, "wb")
output.write(outputStream)
outputStream.close() |
Tags: example, pdf, Python
Posted by admin
on July 31, 2010
Python /
Comments Off
Eli Bendersky has three interesting posts on plotting data with Python and matplotlib:
matplotlib-plotting-with-python
matplotlib-with-wxpython-guis
matplotlib-with-pyqt-guis
Thanks for sharing Eli!
Tags: GUI, Python
Posted by arkadian
on July 25, 2010
Python,
examples /
Comments Off
With the arrival of the iPads, we’ve been changing many of our processes in order to put information on the fingertips of our senior mgmt team. Our key app right now is Dropbox and we convert most of the files to pdf.
Dropbox is a great little tool, as it enables us to update files on the fly. As it stands right now though, it is not suitable for wide corporate use for 3 reasons.
The first reason is that it doesn’t have a central admin point. For example, I can share folders with my contacts, and my contacts can share folders with others. Ideally, you need a service where access management is controlled centrally. If an employee leaves, we don’t want him/her to be able to access confidential data.
The second reason is that you cannot save the dropbox folder on the company network. To bypass the access mgmt control issue, my original plan was to set up a pc with dropbox and save the dropbox folder in one of our network drives. That would allow our colleagues to save files directly in specific folders (within the dropbox folder, saved in our network). This problem was solved by writing a simple sync script in python that synchronises various folders and files from our network with the dropbox folder which is located on a single machine. This solution turned up to be a better solution in the end as I managed to pick up a lot of files from their original network locations and sync them with the local dropbox folder, meaning that most of my colleagues kept saving their files as normal and minutes later these files would appear on the various ipads. A simple python script allowed us to avoid installing dropbox on every pc and creating an administrative nightmare for ourselves!
The third reason is that, due to the way dropbox saves files in a remote cloud, we don’t quite control our files. This can be addressed with a corporate company-owned dropbox server.
By having a single pc with drobox installed and a python script that syncs the files every couple of minutes, we created a practical configuration that allows our senior mgmt team to access the files they need on their ipads, without having to install dropbox on various machines, create accounts, share folders and create an admin nightmare for ourselves.
Tags: DropBox, iPad, Python
Posted by admin
on April 24, 2010
Processing,
Python,
examples /
Comments Off
Gnuplot is a great command line tool that creates very quickly graphs from data files.
The official site of Gnuplot is: http://www.gnuplot.info/ . To see examples of graphs produced by Gnuplot, you should have a look here: http://gnuplot.sourceforge.net/demo_4.4/.
Using python and gnuplot, I produced approx 80 graphs similar to the one below, that fitted nicely on 5 A4 pages. 
Python scans a very long file with all the historical data and passes the required data for each graph to gnuplot. The result is 80 graphs as png files in less than a minute. Then another script in processing puts everything together in a 5 page pdf file (2 cols x 8 rows = 16 per page). AutoHotKey is what “glues” everything together and makes this a “single click” solution.
Tags: autohotkey, Gnuplot, Processing, Python