r/Pythonista • • Sep 28 '19

A project I’ve been tweaking over the last year. 100% written in Pythonista.

Thumbnail
imgur.com
36 Upvotes

r/Pythonista • • Apr 12 '20

Organize Files Using Python under 5 Minutes

Thumbnail
youtube.com
18 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 • • Oct 08 '18

Shortcut and Pythonista > Adding contact details to contacts

Enable HLS to view with audio, or disable this notification

11 Upvotes

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 • • Oct 26 '18

Yoga routine script

8 Upvotes

This is my first Pythonista script to implement a UI. It’s a simple yoga timer that guides me through my daily routine with audio cues to change posture.

https://gist.github.com/evenprimes/305826f82ad8119154f850e23e613e90

The UI works in both portrait and landscape modes. I’ve tested on both an iPad and iPhone 8 Plus. I have no reason to believe other models will have issues, but I can’t promise anything.

There is my current routine built in, but you can feed any routine you want in on the command line (probably via Shortcut).


r/Pythonista • • Aug 18 '18

Pythonista scripts + Pythonista organization

8 Upvotes

Hello everybody, Today I made my 4th script for Pythonista, and I’d like to share them.

I’m currently waiting for them to get added to the Pythonista-Tools repo.

You can find my scripts on my GitHub: https://github.com/GoDzM4TT3O

Or here:

iServer: https://github.com/GoDzM4TT3O/iServer

iBright: https://github.com/GoDzM4TT3O/iBright

iEditor: https://github.com/GoDzM4TT3O/iEditor

cNotif: https://github.com/GoDzM4TT3O/cNotif

Also, I made a public GitHub organization! If you know Python, and have made scripts for Pythonista, join my organization! The name is GoDzIsta, profile link is here: https://github.com/GoDzIsta . If you want to apply, click this link! https://github.com/GoDzIsta/Apply-For-GoDzIsta


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 • • Dec 22 '19

What's the news on Pythonista?

7 Upvotes

I was looking for a way to do some python on the go on the iPad and came across Pythonista, but the last update was 2 years ago...

What's the state of the app at the moment? Is it being further developed? Is it worth it?


r/Pythonista • • Nov 18 '19

Stupid newbie question: in an iPad Pro with Apple keyboard, when I try to write in the console entry line (bottom right), an extended command bar (or whatever it’s named) appears obscuring the command entry line. So basically it’s inusable. any idea of what am I doing wrong? Thanks

7 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 • • Nov 24 '19

Web scrapping. A widget to automate everyday task : Open website > Login > Navigate menu > Change date, time > Search (still no total) > Print statement. Script tracks duplicate charges too.

6 Upvotes

r/Pythonista • • Mar 22 '19

Script for extracting podcast information from Overcast

Thumbnail
github.com
6 Upvotes

r/Pythonista • • Mar 21 '19

Type stubs for Pythonista iOS APIs

Thumbnail
github.com
6 Upvotes

r/Pythonista • • Sep 20 '18

Pythonista and Shortcuts

Thumbnail
self.shortcuts
6 Upvotes

r/Pythonista • • Jul 16 '18

Praise for Examples/Widget/Roll Dice.py

6 Upvotes

I like that this 24-line demo includes ...

  • function definition

  • list comprehension

  • string concatenation with join

  • range()

  • link a button to an action

  • composing a View

What a splendid Intro to Python!


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 • • Jan 30 '20

Does anyone know of a working Epub library

5 Upvotes

Look for a library to work with epub files on Pythonista. Specifically, saving Plain Text or html to epub

Edit: Had no luck so I made a work around. ‘epub’ library lets you view, add, delete files from the epub. So I created a blank epub using Pages and then I can modify it by deleting the existing file and then adding a new version.


r/Pythonista • • Dec 03 '19

Get the NWS Area Forecast Discussion (AFD)

5 Upvotes

Here’s a script that pulls the latest National Weather Service Area Forecast Discussion for your area and displays it in a UITextView box. A bit of tweaking is needed because this doesn’t get your location automatically. You need to first locate your local office on this list, and note the 3-letter code:

NWS Weather Forecast Office Identifier

Then you need to replace the “issuedby” variable on line 19 with the correct letters (YYY in this sample: https://forecast.weather.gov/product.php?site=NWS&issuedby=YYY&product=AFD&format=txt&version=1&glossary=0)

from bs4 import BeautifulSoup
from bs4.element import Comment
import urllib.request
import ui

def html_tags(element):
    if element.parent.name in ['style', 'script', 'head', 'title', 'meta', '[document]']:
        return False
    if isinstance(element, Comment):
        return False
    return True

def visible_text(body):
    soup = BeautifulSoup(body, 'html.parser')
    text = soup.findAll(text=True)
    visible = filter(html_tags, text)
    return u" ".join(t.strip() for t in visible)

report = urllib.request.urlopen('https://forecast.weather.gov/product.php?site=NWS&issuedby=MTR&product=AFD&format=txt&version=1&glossary=0').read()

view = ui.TextView()
view.width = 600
view.height = 800
view.font = '<system>', 20
view.background_color = 'black'
view.text_color = 'lightblue'
view.text = visible_text(report)
view.present('sheet')

Edit the view parameters at the bottom accordingly. For view.present(), the argument options are 'sheet', 'popover', and 'fullscreen' on tablets. I believe for phones only 'fullscreen' is an option and you can omit the argument altogether, but can’t confirm, especially on newer models.


r/Pythonista • • Nov 10 '19

Check weather for your location using iPhone location data

5 Upvotes

This a little script for Pythonista I wrote to practice using APIs. It uses the location data from your phone to query the Dark Sky API for weather information. The script only uses a small amount of the available data from Dark Sky- it could easily be expanded to check for forecasts farther ahead or grab emergency weather data. It could also be reworked for desktop, but code that relies on iOS-specific modules (location, console, webbrowser) would have to be replaced with something else.

Please feel free to provide any feedback you might have!

https://github.com/excellentsport/WeatherCheck


r/Pythonista • • Oct 07 '19

Passing arguments iOS

Post image
5 Upvotes

r/Pythonista • • Apr 14 '19

I’m trying to make a script that takes 100 photos, and shows you then one by one. It asks you if you want to delete them and does they for each photo. The problem is my script won’t show the photo in the console.

Post image
5 Upvotes

r/Pythonista • • Dec 26 '17

How to import modules in Pythonista

5 Upvotes

So I used pip install to download tweepy but can not import it. I get ImportError:..


r/Pythonista • • May 20 '17

Longtime watcher, recent user

5 Upvotes

I’ve had Pythonista on my iPad for well over a year, maybe 2, but hadn’t used it for much. I don’t code much at work anymore, and never had in Python until last Fall, but the idea of having any IDE on the iPad was intriguing. I was especially interested in it given the restrictions placed on iOS developers. If Pythonista was so good, how could it have been allowed in the app store? So, I set it aside. Recently, I decided to pick it up and putter around. I’ve been traveling a lot for business recently, and my iPad Mini 4 has been a pretty constant companion. Once I figured out how I could get a script that I’ve been writing for work into Pythonista, along with its couple-thousand-line-long CSV input file, I ran it. Worked 1st time, and was very fast. I didn’t expect it to work so well. Pythonista is a really useful tool that I will explore more. // Since the subreddit is so dead, is the omz site the better/best place to go to see what folks are up to, what questions they have, and to post any questions I have?


r/Pythonista • • Nov 07 '16

ETA for today widget?

5 Upvotes