This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python3 | |
# -*- coding: utf-8 -*- | |
from http.server import HTTPServer | |
from http.server import BaseHTTPRequestHandler | |
from http import HTTPStatus | |
class MyHandler(BaseHTTPRequestHandler): | |
def do_GET(self): |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Python file downloader for Pythonista by OMZ Software | |
# By: EJM Software ---- http://ejm.cloudvent.net | |
# Source: https://gist.github.com/89edf288a15fde45682a | |
# ***************************************** | |
# This simple script uses the requests module to download files | |
# and the ui module to show a progress bar | |
# You can use this bookmarklet to download files from Safari: | |
# javascript:window.location='pythonista://filedownloader?action=run&argv='+encodeURIComponent(document.location.href); | |
import ui, console, clipboard, sys, requests, zipfile |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
print "Welcome to Austin's calculator, please type your equation. ex. 2+4" | |
calc = input(); print calc |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
print "Hello welcome to Austin's calculator. Would you like to use (b)asic functions or more (c)omplex functions?" | |
dec = (raw_input()) | |
if dec == "b": | |
print """(m)ultiply, (d)ivide, (a)dd, or (s)ubtract?. Don't forget, | |
this can only be integers or whole numbers.""" | |
answer = (raw_input()) | |
if answer == "m": #Multiplication |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from sys import argv | |
script, first, second, third = argv | |
print "The script is called:", script | |
print "Your first variable is:", first | |
print "Your second variable is:", second | |
print "Your third variable is:", third |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
age = raw_input("How old are you? ") | |
height = raw_input("How tall are you? ") | |
weight = raw_input("How much do you weigh? ") | |
print "So, you're %r old, %r tall and %r heavy." % (age, height, weight) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
print "How old are you?", | |
age = raw_input() | |
print "How tall are you?", | |
height = raw_input() | |
print "How much do you weigh?", | |
weight = raw_input() | |
print "So, you're %r old, %r tall and %r heavy." % ( | |
age, height, weight) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
persian_cat = "I'm split\non a line." | |
backslash_cat = "I'm \\ a \\ cat." | |
fat_cat = """ | |
I'll do a list: | |
\t* Cat food | |
\t* Fishies | |
\t* Catnip\n\t* Grass | |
""" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Here's some new strange stuff, remember type it exactly. | |
days = "Mon Tue Wed Thu Fri Sat Sun" | |
months = "Jan\nFeb\nMar\nApr\nMay\nJun\nJul\nAug" | |
print "Here are the days: ", days | |
print "Here are the months: ", months | |
print """ | |
There's something going on here. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
x = "There are %d types of people." % 10 | |
binary = "binary" | |
do_not = "don't" | |
y = "Those who know %s and those who %s." % (binary, do_not) | |
print x | |
print y | |
print "I said: %r." % x | |
print "I also said: '%s'." % y |
NewerOlder