Skip to content

Instantly share code, notes, and snippets.

View Moosems's full-sized avatar
👨‍💻
Still programming!

Moosems Moosems

👨‍💻
Still programming!
  • United States
  • 19:53 (UTC -05:00)
View GitHub Profile
@Moosems
Moosems / stdin.mojo
Created August 15, 2024 03:53 — forked from thatstoasty/stdin.mojo
Reading from stdin using mojo and recreating the Python input function
from builtin.io import _dup
from memory import UnsafePointer, memcpy
from sys import os_is_windows, external_call
@value
struct stdin:
"""A read only file handle to the stdin stream."""
alias file_descriptor = 0