Hi!
I would like to write multi-platform scripts for Pythonista on iOS, Mac and Windows.
Do you know a way how a script which is executed within Pythonista can check that it is executed within Pythonista and not on a Mac?
Hi!
I would like to write multi-platform scripts for Pythonista on iOS, Mac and Windows.
Do you know a way how a script which is executed within Pythonista can check that it is executed within Pythonista and not on a Mac?
@elkrause helo. you can try this
Great @stephen thank you! It works well!
@elkrause outstanding! have a good one π
If you're only looking to determine which OS you're on (and not whether you're in the Pythonista IDE specifically), you can do that with:
from sys import platform
print(platform)
If you're on iPhone/iPad, platform should be "iOS". If you're on macOS, you should get "darwin". Windows should be "win32" I believe.
@WyldKard
~~almost correct βΊοΈ heres what i get get from print(platform.platform()) on iPad Air2~~
~~Darwin-19.3.0-iPad5,4-64bit~~
~~might be because of iPadOS?~~
stand corrected...
print(sys.platform)
>>> ios
sorry ππ
π just realised i can never trust the platform module again lol