Python Glossary Русский

Python 3.13+platformfunction

platform.ios_ver()

specific operating systems

iOS/iPadOS details: system, release, model, is_simulator. On other systems, macOS included, it returns the defaults.

Syntax

platform.ios_ver(system='', release='', model='', is_simulator=False)

It arrived with official iOS support in 3.13 and can be called on any OS without error: outside iOS every field is empty and is_simulator is False. On iOS platform.system() returns 'iOS' or 'iPadOS' rather than 'Darwin', so code that checked for 'Darwin' stops recognising Apple devices.

Examples

import platform
info = platform.ios_ver()
print(info._fields)  # → ('system', 'release', 'model', 'is_simulator')
print(info)  # → ? вне iOS IOSVersionInfo(system='', release='', model='', is_simulator=False)

See also

Open in the full glossarydocs.python.orgReport an inaccuracy