Skip to content

Commit 2745900

Browse files
committed
basic os module
1 parent 6fa2005 commit 2745900

File tree

2 files changed

+27
-0
lines changed

2 files changed

+27
-0
lines changed

os/os.module.go

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
package os
2+
3+
// Copyright 2022 The go-python Authors. All rights reserved.
4+
// Use of this source code is governed by a BSD-style
5+
// license that can be found in the LICENSE file.
6+
7+
import (
8+
"github.com/go-python/gpython/py"
9+
)
10+
11+
func init() {
12+
13+
methods := []*py.Method{}
14+
15+
globals := py.StringDict{
16+
"error": py.OSError,
17+
}
18+
19+
py.RegisterModule(&py.ModuleImpl{
20+
Info: py.ModuleInfo{
21+
Name: "os",
22+
Doc: "Miscellaneous operating system interfaces",
23+
},
24+
Methods: methods,
25+
Globals: globals,
26+
})
27+
}

os/os.test.py

Whitespace-only changes.

0 commit comments

Comments
 (0)