convert perl-script for voltcraft voltmeter to python [newbie]

Jean Dupont jeandupont115 at
Thu Feb 2 21:57:55 CET 2012

I'd like to read in the output of a voltcraft vc960 voltmeter
connected to a usb-port.
I found the perl-script below but I'd like to accomplish the same with
I guess I have to use the module serial but I don't know how I should
set the serial parameters so they are the same as in the perl-script.
Could someone supply me the command for setting the serial-parameters
in Python?



use strict;
use warnings;

use Device::SerialPort;

die("Usage: $0 /dev/ttyS0\n") unless $#ARGV == 0;

my ($devicepath) = @ARGV;

my $port = new Device::SerialPort($devicepath);
die "Couldn't open serial port" if ! defined $port;


#$port->read_char_time(5);     # wait 5ms per character
$port->read_const_time(200);   # 0.2 second per unfulfilled "read"
$| = 1; # autoflush STDOUT
while(1) {
        my ($nin, $in) = $port->read(255);
        print $in;


More information about the Python-list mailing list