Skip to content

Commit 0fde754

Browse files
committed
print to main
1 parent 723b2f6 commit 0fde754

File tree

2 files changed

+7
-3
lines changed

2 files changed

+7
-3
lines changed

example/main.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,4 +11,8 @@
1111
}
1212
pw = PyWorker("./worker.py", type="pyodide", config=config)
1313

14+
def console_print(x):
15+
print(x)
16+
1417
pw.sync.session = io.request
18+
pw.sync.console_print = console_print

example/worker.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,13 +7,13 @@
77
import pyscript_fsspec_client.client
88

99
fs = fsspec.filesystem("pyscript")
10-
print(fs.ls("local"))
10+
sync.console_print(str(fs.ls("local")))
1111

1212
out = fs.cat("local/mdurant/code/fsspec-proxy/pyproject.toml")
13-
print("binary:", type(out), out)
13+
sync.console_print(str(("binary:", type(out), out)))
1414

1515
out = fs.cat("local/mdurant/code/fsspec-proxy/pyproject.toml", start=0, end=10)
16-
print("binary:", type(out), out)
16+
sync.console_print(str(("binary:", type(out), out)))
1717

1818
fs.pipe_file("local/mdurant/code/fsspec-proxy/OUTPUT", b"hello world")
1919

0 commit comments

Comments
 (0)