我是TKINTER / PYTHON的新手
以下是一个示例语法。我想基本上继续检查MYSQL单元格以查看状态是否从down更改为其他任何内容并将更改报告给shell列表框。
我想经常检查,从而监视db活动,一旦状态根据该单元格发生变化,停止执行after()过程并完成列表框更新。
// If there are no characters finish
if (read.empty()) {
return 0;
}
// Get the first character
char lastChar = read[0];
int count = 1; // We have counted one character for now
// Go through each character (note start from 1 instead of 0)
for(int i = 1; i < read.size(); i++) {
// Get the next char
char newChar = read[i];
// If it is different, print the current count and reset the counter
if (lastChar != newChar) {
cout << lastChar << count;
count = 1;
lastChar = newChar;
} else { // Else increase the counter
count++;
}
}
// Print the last one
cout << lastChar << count;
return 0;