Skip to content

Commit 37373a4

Browse files
committed
Logging tqdm
1 parent 4147629 commit 37373a4

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

script.js

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -223,12 +223,19 @@ async function runCodeInline() {
223223

224224
pyodide.setStdout({
225225
batched: (text) => {
226+
console.log('=== STDOUT BATCH ===');
227+
console.log('Raw text:', JSON.stringify(text));
228+
226229
fullOutput += text;
227230

231+
console.log('Full output so far:', JSON.stringify(fullOutput));
232+
228233
// First, add \n after any \r that isn't already followed by \n
229234
// This ensures tqdm completion moves to new line
230235
let fixed = fullOutput.replace(/\r(?!\n)/g, '\r\n');
231236

237+
console.log('After fixing \\r:', JSON.stringify(fixed));
238+
232239
// Now split by \n and process
233240
const lines = fixed.split('\n');
234241
const cleanLines = [];
@@ -249,6 +256,8 @@ async function runCodeInline() {
249256
}
250257
}
251258

259+
console.log('Clean lines:', cleanLines);
260+
252261
output.innerHTML = `<pre style="margin: 0; color: #d4d4d4; white-space: pre-wrap;">${escapeHtml(cleanLines.join('\n'))}</pre>`;
253262
}
254263
});

0 commit comments

Comments
 (0)