Created
December 14, 2023 02:27
-
-
Save qexat/1d6e334a5dd23b28ec05f0d6a60aa812 to your computer and use it in GitHub Desktop.
cppython
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # pyright: reportUnusedExpression = false | |
| import dataclasses | |
| import os | |
| import sys | |
| import typing | |
| @dataclasses.dataclass(slots=True) | |
| class CPPFile: | |
| file: typing.TextIO | |
| def __lshift__(self, string: str, /) -> typing.Self: | |
| self.file.write(string) | |
| return self | |
| cout = CPPFile(sys.stdout) | |
| endl = "\n" | |
| EXIT_SUCCESS = os.EX_OK | |
| def main() -> int: | |
| cout << "Hello World!" << endl | |
| return EXIT_SUCCESS | |
| if __name__ == "__main__": | |
| raise SystemExit(main()) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment