Description

OperatingSystem is a cross-platform library for managing computer properties and actions.

Examples

Robot Framework

*** Settings ***
Library    RPA.Desktop.OperatingSystem

*** Tasks ***
Get computer information
    ${boot_time}=   Get Boot Time  as_datetime=${TRUE}
    ${machine}=     Get Machine Name
    ${username}=    Get Username
    &{memory}=      Get Memory Stats
    Log Many        ${memory}

Python

from RPA.Desktop.OperatingSystem import OperatingSystem

def get_computer_information():
    ops = OperatingSystem()
    print(f"Boot time    : { ops.get_boot_time(as_datetime=True) }\n"
          f"Machine name : { ops.get_machine_name() }\n"
          f"Username     : { ops.get_username() }\n"
          f"Memory       : { ops.get_memory_stats() }\n")

if __name__ == "__main__":
    get_computer_information()

API Documentation

  • Robot Framework API
  • Python module API