我有这个 Chuck 代码:
"examples/vento.txt" => string filename;
FileIO fio;
// open a file
fio.open(filename, FileIO.READ);
// ensure it's ok
if(!fio.good()) {
cherr <= "can't open file: " <= filename <= " for reading..." <= IO.newline();
me.exit();
}
fio.readLine() => string velocity;
fio.readLine() => string direction;
文本文件包含:
10
12
(它每分钟都用python更新)
我想将速度和方向转换为 int(或更好的浮点数)。
我怎样才能做到这一点?