Lib/sys
Hint:
if not defined pylibConfigIsolated, this module will call setlocale(LC_CTYPE, ""), a.k.a. changing locale to user's configure, just as CPython's initialization.
under shared lib in POSIX, paramStr and paramCount are not available
Vars
orig_argv = newPyListOfCap(argc)
- .. hint:: rely on paramCount<https://nim-lang.org/docs/cmdline.html#paramCount>_ and paramStr<https://nim-lang.org/docs/cmdline.html#paramStr%2Cint>_. See their document for availability. Source Edit
stderr = newNoEncTextIO(stderr, "<stderr>", DefNewLine)
- Source Edit
stdin = newNoEncTextIO(stdin, "<stdin>", DefNewLine)
- Source Edit
stdout = newNoEncTextIO(stdout, "<stdout>", DefNewLine)
- Source Edit
Lets
dunder_stderr = stderr
- __stderr__ Source Edit
dunder_stdin = stdin
- __stdin__ Source Edit
dunder_stdout = stdout
- __stdout__ Source Edit
Consts
float_info = (max: 1.7976931348623157e+308, max_exp: 1024, max_10_exp: 308, min: 2.2250738585072014e-308, min_exp: -1021, min_10_exp: -307, dig: 15, mant_dig: 53, epsilon: 2.220446049250313e-16, radix: 2)
- float_info.rounds is defined as a getter, see rounds Source Edit
hexversion = 201472
- Source Edit
implementation = ("pynim", (0, 9, 5, "alpha", 0), 2309, false)
- Source Edit
platform: PyStr = "linux"
-
Note: the value is standalone for bare system
and haiku/netbsd appended with major version instead of "unknown". In short, this won't be "unknown" as Python does.
Source Edit version_info = (major: 3, minor: 13, patch: 0, releaselevel: "final", serial: 0)
- Source Edit
Procs
proc getdefaultencoding(): PyStr {....raises: [], tags: [], forbids: [].}
-
Return the current default encoding used by the Unicode implementation.
Always "utf-8" in Nim
Source Edit proc getfilesystemencoding(): PyStr {....raises: [], tags: [], forbids: [].}
- Source Edit
Converters
converter noneStdstream(n: NoneType): typeof(stdout) {....raises: [], tags: [], forbids: [].}
- Source Edit
Templates
template executable(): PyStr
-
returns:
- when nimscript, path of Nim;
- when JavaScript:
- on browser: empty string
- on NodeJS/Deno: executable path of Node/Deno
- otherwise, it's the path of current app/exe.