kopia lustrzana https://github.com/micropython/micropython-lib
os.path: Implement dirname(), basename().
rodzic
0b53579d85
commit
caa1b279ac
|
@ -28,6 +28,12 @@ def split(path):
|
||||||
head = "/"
|
head = "/"
|
||||||
return (head, r[1])
|
return (head, r[1])
|
||||||
|
|
||||||
|
def dirname(path):
|
||||||
|
return split(path)[0]
|
||||||
|
|
||||||
|
def basename(path):
|
||||||
|
return split(path)[1]
|
||||||
|
|
||||||
def exists(path):
|
def exists(path):
|
||||||
return os.access(path, os.F_OK)
|
return os.access(path, os.F_OK)
|
||||||
|
|
||||||
|
|
Ładowanie…
Reference in New Issue