Forum Archive

Start Pythonista Python Program from Iphone home screen so it doesn't close / enter Pythonista after stopping

mborus

Hi,

I'm trying to write some simple prototypes which I would like to hand out to people to test on some Iphones I give them. These are old Iphone5 with iOS 10.2 and just pythonista installed.

It's a simple GUI, with some text fields and some buttons.

Is is possible to write the code in a way that it's not possible to close the window without killing it?

As a bonus question, can I code protect Pythonista on those devices so that the test user cant access the code at all? Or is there a way to convert the prototype to a real app if approved?

JonB

you could, in pythonista_startup, launch your ui, which would be a custom ui.View that forces a crash in View.close. you would also want to catch KeyboardExceptions, and crash

it would always be possible to start via safe mode, though. also, there is a slight delay before the interpreter starts.

there is an xcode template that lets you create full up apps, there are a few forum posts on the tricks.

JonB

Regarding hiding the source code... You could run it through something like pyminifier, with obfuscation, nonlatin, and compression turned on, so that it is at least hard for the casual user to see what is going on easily. So even though they might be able to open the editor of the cancel startup, they would have to work to decompress, then understand the code. Don't save your bank account info this way...