6
tôi có mã Chuck này:ints Đọc từ một tập tin trong 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;
Các tập tin văn bản chứa:
10
12
(nó được cập nhật với python mỗi phút)
Tôi muốn chuyển đổi vận tốc và hướng sang int (hoặc float tốt hơn).
Tôi làm cách nào để thực hiện việc này?