进度条不跟随脚本。我想在脚本执行时显示进度条。完成后应该停止。目前它正在显示完整的过程,然后进行打印输出。请在下面找到我的代码:
$Progress_bars = $main->AddProgressBar(
-pos => [10,840],
-background => [0,255,85],
-smooth => 1,
-size => [470,20],
);
my $intended_max = 100;
my $x = 11;
my $y = int($intended_max/$x);
$Progress_bars->SetRange(0,$x*$y);
for (1 .. $x) {
Win32::GUI::DoEvents();
$Progress_bars->SetStep($y);
$Progress_bars->StepIt();
Win32::Sleep(50);
}
$output = $telnet->print('ls');
print $output;