A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://microbit-micropython.readthedocs.io/en/latest/os.html below:

Website Navigation


The os Module — BBC micro:bit MicroPython 1.1.1 documentation

The os Module

MicroPython contains an os module based upon the os module in the Python standard library. It’s used for accessing what would traditionally be termed as operating system dependent functionality. Since there is no operating system in MicroPython the module provides functions relating to the management of the simple on-device persistent file system and information about the current system.

To access this module you need to:

We assume you have done this for the examples below.

Functions
os.listdir()

Returns a list of the names of all the files contained within the local persistent on-device file system.

os.remove(filename)

Removes (deletes) the file named in the argument filename. If the file does not exist an OSError exception will occur.

os.size(filename)

Returns the size, in bytes, of the file named in the argument filename. If the file does not exist an OSError exception will occur.

os.uname()

Returns information identifying the current operating system. The return value is an object with five attributes:

Note

There is no underlying operating system in MicroPython. As a result the information returned by the uname function is mostly useful for versioning details.


RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4