Skip to content

Instantly share code, notes, and snippets.

View gregorypease280's full-sized avatar

Gregory Pease gregorypease280

  • Los Angeles, California
View GitHub Profile
@omz
omz / FileBrowser.py
Created November 10, 2012 17:25
FileBrowser
import SimpleHTTPServer
import SocketServer
import webbrowser
import os
os.chdir('/')
Handler = SimpleHTTPServer.SimpleHTTPRequestHandler
httpd = SocketServer.TCPServer(("", 0), Handler)
port = httpd.server_address[1]
webbrowser.open('http://localhost:' + str(port), stop_when_done=True)
httpd.serve_forever()
@pudquick
pudquick / pipista.py
Created November 20, 2012 07:23
pipista - pip module (for installing other modules) for Pythonista
import os, os.path, sys, urllib2, requests
class PyPiError(Exception):
def __init__(self, value):
self.value = value
def __str__(self):
return repr(self.value)
def _chunk_report(bytes_so_far, chunk_size, total_size):
if (total_size != None):
@silverkors
silverkors / kbd_draw.py
Created November 20, 2012 21:35
Create an iPhone US keyboard with Pythonista
# -*- coding: utf-8 -*-
from scene import *
from PIL import Image, ImageDraw, ImageFont
row_rects = []
row_keys = []
n_row_rects = []
n_row_keys = []
@silverkors
silverkors / gui.py
Created November 20, 2012 21:36
The simple beginning of a gui for Pythonista - an input field and keyboard
# -*- coding: utf-8 -*-
from scene import *
from time import time
from copy import deepcopy
from PIL import Image, ImageDraw, ImageFont
global EventQ
def p_click():
@silverkors
silverkors / fileman.py
Created November 27, 2012 20:40
Useful filemanager for Pythonista, move files, delete and create files and directories
# -*- coding: utf-8 -*-
import os, sys, editor, shutil
from glob import glob
from scene import *
from time import time
from copy import deepcopy
from PIL import Image, ImageDraw, ImageFont
# https://gists.github.com/4034526
@omz
omz / Curve Demo.py
Created March 5, 2013 02:30
Curve Demo
import canvas
canvas.set_size(512, 512)
from_point = (10, 10)
cp1 = (40, 200) #control point 1
cp2 = (350, 50) #control point 2
to_point = (300, 300)
# Draw the actual curve:
@LandyQuack
LandyQuack / gui1.py
Created March 17, 2013 18:14
First experiments with a Pythonista GUI on the iPad
# A very simple first experiment in GUI creation using Pythonista
# on an iPad2. Creates two square buttons which change colour and
# make a noise when touched. It's modelled on what I vaguely remember
# of the innards of MS Windows
from scene import *
from random import random
import sound
# Base class for controls
@harryjubb
harryjubb / Find and Replace.py
Created June 1, 2013 18:58
Find and Replace in Pythonista for iPad
'''
Pythonista Find and Replace
===========================
Notices
-------
Copyright 2013 Harry Jubb.
This program is free software: you can redistribute it and/or modify
@stophlong
stophlong / pythonista_google_tts.py
Created February 2, 2014 19:28
Ios 7 pythonista script: takes clipboard (in Spanish) and reads it aloud (in Spanish) using Google Text to Speech
# -*- coding: utf-8 -*-
""" ios clipboard to google TTS (in Spanish)
This was written for ios pythonista, a python 2.x language. It takes whatever is in the clipboard
and reads it out using google text-to-speech. The present form takes Spanish and reads it aloud as my
interest is in learning to understand spoken Spanish. I take text from the immersion part of
Duolingo and listen. It should be quite easy to modify for different purposes.
On a jail-broken device one can even: copy to clipboard, use activator to launch the pythonista script, and
have it start speaking! I simple gathered some python from the web, fit it together, debugged a bit, and I
had a new tool. Pythonista blew my mind.
@cclauss
cclauss / watch_pythonista_forum.py
Last active November 25, 2020 17:27
Learning how to use feedparser... recent_entries() will print out info on all posts to the Pythonista forum in the past 24 hours. watch_feed() will print out info on the last post to the Pythonista forum. Sleeps for 15 minutes then check to see if there is a newer post. If so, prints out info on it and opens its URL in the webbrowser. Repeat.
#!/usr/bin/env python
'''
recent_entries() will print out info on all posts to the Pythonista forum in the past 24 hours.
watch_feed() will print out info on the last post to the Pythonista forum.
Sleeps for 15 minutes then check to see if there is a newer post.
If so, prints out info on it and opens its URL in the webbrowser. Repeat.
'''