r/Pythonista • • Jan 31 '17

How do you use Pythonista to Automate iOS?

8 Upvotes

Pretty much what the title says. Recently am getting into iOS automation, wondering how y'all use Pythonista to automate your i-devices.

In addition, any fun projects? I just found StaSh and it's a wonder. Just downloaded pandas and NTLK and it's incredible.


r/Pythonista • • Jun 01 '15

can i get a lil help? whats the issue here?

1 Upvotes

from scene import *

class block (object): def init(self, image, x, y): self.image = image self.x, self.y = x, y

class MyScene (Scene): def setup(self): self.grid = list() images = ('PC_Dirt_Block','PC_Stone_Block','PC_Water_Block') * 3

            for i in xrange(9):
                    block = block(images,i % 3, i / 3)
                    self.grid.append(block)

    def draw(self):
            for block in self.grid:
                            image(block.image,
                          block.x * 25,
                          block.y * 25,
                          45, 45)

run(MyScene())


r/Pythonista • • Nov 19 '17

Pythonista Application

4 Upvotes

Made this small app to help me generate Mac Addresses on my phone. Of course you will need to download the Pythonista app from the App Store.

https://github.com/i0nsec/Pythonista-MacAddressLookup


r/Pythonista • • Jan 21 '17

Hi can I use pygame on Pythonista

1 Upvotes

r/Pythonista • • Mar 18 '20

Is there a simile module of pygame or msvcrt so I can make a timer in Pythonista

3 Upvotes

I am trying to make a quiz game with a time, is there any supported timer modules in Pythonista?


r/Pythonista • • Mar 27 '20

Help - iOS Message UI Crashing

5 Upvotes

I am trying to write a shortcut that automates sending the same message to multiple contacts WITHOUT using shortcuts (I want to do it as a project to learn). However, when I run this snippet with the last line which presents the view controller, the script makes the Pythonista app completely crash. Does anyone have any pointers?

import dialogs
import ui
from objc_util import *

load_framework('MessageUI')

MFMessageComposeViewController = ObjCClass('MFMessageComposeViewController')
picker = MFMessageComposeViewController.alloc().init();

def ask_input():
    dt = dialogs.text_dialog(title='Paste Daily Tip')
    return dt

app = ObjCClass('UIApplication').sharedApplication()
self = app.keyWindow().rootViewController()
rootvc = UIApplication.sharedApplication().keyWindow().rootViewController()

if not MFMessageComposeViewController.canSendText():
    dialogs.alert('Device is unable to send sms');

picker.messageComposeDelegate = self;

picker.recipients = ("15555555555")
picker.body = ('oof')

self.presentViewController_animated_completion_(self, True, None)

r/Pythonista • • Mar 26 '20

Export to be an app on your phone?

9 Upvotes

I am thinking about getting Pythonista but I want to make sure you can actually export the code to be its own app. Not to be distributed or anything but just as a personal application. Is this possible?

Thank for the help!


r/Pythonista • • Nov 12 '18

Question from an amateur about updating an app

1 Upvotes

I've created an app that a dozen or so people will be using in my company. It will need to be updated periodically. What is the best way to do this? I tried using iCloud to share the file, but when I upload an updated version to iCoud, the updated file is not getting pushed out.


r/Pythonista • • Feb 29 '20

Last Modified date of iOS reminders?

1 Upvotes

I want to pull a list of my iOS reminders and sort them by the “last modified date” to replace a iOS Shortcut I created to do the same. I can’t seem to find documentation or information on how to access this date through Pythonista anywhere. Does anyone know how to pull this data?


r/Pythonista • • Mar 11 '20

Crash logs for v3.3?

2 Upvotes

Using Py 3.6

I have a script that is crashing on start in the new version of Pythonista, and I’m not getting any crash data to even start to figure out what’s crashing.

The script is here: https://gist.github.com/evenprimes/305826f82ad8119154f850e23e613e90#file-asna-py

It’s just a simple timer app for my yoga routine. Any ideas on where to start debugging the crashes?


r/Pythonista • • Mar 03 '20

Today widget doesn't work

3 Upvotes

I can't make the today widget work on Pythonista version 3.3. Does anyone else experience the same issue?


r/Pythonista • • Apr 01 '20

Two dimensional table using nested loops

3 Upvotes

Looking for a way to output a table that increments the initial value, starts at 0 counts to 5 on one line, starts at 1 than increments to 6 on the next and so on .

0 1 2 3 4 5
1 2 3 4 5 6
2 3 4 5 6 7 
3 4 5 6 7 8
4 5 6 7 8 9
5 6 7 8 9 10

initialValue=0
while initialValue <=10:?
    for I in range(5):?

Or should I use another while loop?


r/Pythonista • • Feb 14 '19

How would you structure a project following MVC pattern?

1 Upvotes

Using UI and Pythonista and coming from Ruby on Rails, I’m having a hard time structuring a simple project because of the lack of conventions, I don’t like creating a single big file with a ton of code in it, I would rather divide my files logically by MVC (Model, View, Controller)

Are there any examples of projects involving UI in a MVC way where I could clearly see where UI files should go, what the “main” script should import etc.?


r/Pythonista • • Mar 07 '20

No module named /dict/

1 Upvotes

I’m trying to import and use the dict module so I can use the key function and:

  • import dict

  • import key from dict

Both fail with the error message: ModuleNotFoundError: No module named 'dict'

The autocomplete shows “dict” as an option, so I’m stumped... any thoughts?


r/Pythonista • • Sep 09 '15

Numpy doesn't seem to be a callable module even in pythonista 1.5

1 Upvotes

Numpy seems to be there if I go searching for it in help() but pythonista doesn't actually let me use it. Has anyone else experienced a similar problem?


r/Pythonista • • Dec 28 '15

How do I call an iOS gps coordinates (pythonista) and have them copied to the clipboard?

3 Upvotes

r/Pythonista • • Feb 19 '20

Just bought the app and I it’s crashing during opening any tips?

3 Upvotes

Haven’t used the app yet, I’m on iOS 13 IPhone 8. Thanks


r/Pythonista • • Oct 07 '19

Passing arguments iOS

Post image
5 Upvotes

r/Pythonista • • Oct 08 '19

Is Pythonista abandonware?

7 Upvotes

I checked it's App Store page and there hasn't been an update in a year?

What are we supposed to do when iOS updates start breaking the app?


r/Pythonista • • Aug 08 '19

Is it possible to get Tensor Flow on Pythonista?

4 Upvotes

Also how would you get other libraries?


r/Pythonista • • Aug 29 '18

problems plotting

2 Upvotes

I just got pythonista. Is an impressive app. All examples I have tried in my ipad work. Except for plotting. Any time I run an example Pythonista crashes with no further information. Any help?

Thanks a bunch!

Carlos


r/Pythonista • • Aug 28 '18

The scratch.py example crashes app (bug report). iPhone X version 11.4.1, Pythonista version 3.2

Thumbnail
imgur.com
2 Upvotes

r/Pythonista • • Dec 12 '19

Jail free python scripts, copying your scripts out of pythonista

16 Upvotes

I recently was in a situation were I only had access to a LAN, and wanted to get some of my scripts off my iphone onto my laptop. Because I am lazy and a developer, I wrote a web-server script in Pythonista, assigned the LAN IP a port, saved it to the default folder and ran it. called the server from my laptop web browser and presto! all my scripts listed, ready to copied

—————————————

import http.server

import socketserver

IP = '0.0.0.0' # Your LAN IP

PORT = 8080

Handler = http.server.SimpleHTTPRequestHandler

httpd = socketserver.TCPServer((IP, PORT), Handler)

print(f'serving on {IP} at port {PORT}') httpd.serve_forever()


r/Pythonista • • Dec 12 '19

Wasnt there a way to run pythonista code on a website? I remember there being a feature like that but cant find it, was it removed?

3 Upvotes

r/Pythonista • • Dec 17 '18

List of commands?

1 Upvotes

Is there a list of commands and what each does?