Welcome!
This is the community forum for my apps Pythonista and Editorial.
For individual support questions, you can also send an email. If you have a very short question or just want to say hello — I'm @olemoritz on Twitter.
Programatically retrieve device on which the script is running
-
Please pardon me if this topic has already been discussed, but is there any way to programatically find out whether a script is running on an iPhone or on an iPad and make the script behave accordingly?
Thank you,
Uwe
-
-
sys.platform gives 'ios' in pythonista.
platform.machine() returns the hardware, such as Ipad3,3 on my devuce, and probably the iphone version on others.Of course, you can also checkui.screen_size.
-
@JonB Thanks for the hint, platform.machine() does the job for me. I read about it in the documentation and falsely assumed that this was about the processor architecture. Should have given it a try.