Forum Archive

OS testing

Bumbo Cactoni

So, I have a question that actually might not be possible. I just recently remembered that the os package was a thing, so I’m trying to make it work. However, I have no clue what commands it would use on IOS. I know how to use it on the pc, but no such luck here. Please help? So far, I’ve tried things like, “nano hello.txt”, “python3 otherfilename.py”, and a couple others. Obviously, iOS doesn’t use Linux commands...

jmv38

try in the console:

import os
help(os)

you’ll get instructions

Bumbo Cactoni

I tried that, but it doesn’t list os.system() commands. I should have specified that’s what I was asking. Do you know any commands I can use in os.system()?

mcriley821

@Bumbo-Cactoni iOS is based on Unix so the commands are very similar to what you’d use on Linux. Idk where you could find an actual list of commands though (try googling ‘iOS terminal commands’).

JonB

os.system() is not supported on iOS.
Nor is subprocess. Apple has a very locked down system, and there is no shell commands that are usable.

What are you trying to actually do? Many shell commands can be accomplished in other ways. Look up https://GitHub.com/ywangd/stash

Bumbo Cactoni

@JonB
I wasn't trying anything in particular. I guess I was just curious if it worked.
Thank you!

JonB

Install stash, which has many common shell commands that are simulated in a shell like environment.

Keep in mind, the console you see in pythonista is not a shell -- it is the REPL interactive python environment that you get when just typing python standalone. Stash emulatates a bash like she'll in a standalone window.

Bumbo Cactoni

Where do I find stash?

Look up https://GitHub.com/ywangd/stash

Bumbo Cactoni

@JonB
Thank you!